tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
alshabib | ab98466 | 2014-12-04 18:56:18 -0800 | [diff] [blame] | 2 | <!-- |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 3 | ~ Copyright 2014-present Open Networking Foundation |
alshabib | ab98466 | 2014-12-04 18:56:18 -0800 | [diff] [blame] | 4 | ~ |
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ~ you may not use this file except in compliance with the License. |
| 7 | ~ You may obtain a copy of the License at |
| 8 | ~ |
| 9 | ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ~ |
| 11 | ~ Unless required by applicable law or agreed to in writing, software |
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ~ See the License for the specific language governing permissions and |
| 15 | ~ limitations under the License. |
| 16 | --> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 17 | <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 18 | name="ONOS Rules" |
| 19 | xmlns="http://pmd.sf.net/ruleset/1.0.0" |
| 20 | xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" |
| 21 | xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 22 | |
| 23 | <description>ONOS PMD rules</description> |
| 24 | |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 25 | |
| 26 | <rule ref="category/java/errorprone.xml"> |
| 27 | <exclude name="EmptyCatchBlock"/> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 28 | </rule> |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 29 | <rule ref="category/java/errorprone.xml/EmptyCatchBlock"> |
| 30 | <properties> |
| 31 | <property name="allowCommentedBlocks" value="true"/> |
| 32 | </properties> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 33 | </rule> |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 34 | <rule ref="category/java/bestpractices.xml"/> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 35 | <rule ref="rulesets/java/optimizations.xml"> |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 36 | <exclude name="AvoidInstantiatingObjectsInLoops"/> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 37 | </rule> |
| 38 | |
| 39 | <rule ref="rulesets/java/strings.xml"> |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 40 | <exclude name="AvoidDuplicateLiterals"/> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 41 | </rule> |
| 42 | <rule ref="rulesets/java/braces.xml"/> |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 43 | <rule ref="category/java/codestyle.xml"> |
| 44 | <!-- Explicit public keyword in interface methods is acceptable --> |
| 45 | <exclude name="UnnecessaryModifier"/> |
| 46 | <exclude name="UselessParentheses"/> |
| 47 | <exclude name="ShortClassName"/> |
| 48 | <exclude name="ShortMethodName"/> |
| 49 | <exclude name="ShortVariable"/> |
| 50 | <exclude name="LongVariable"/> |
| 51 | <exclude name="MethodArgumentCouldBeFinal"/> |
| 52 | <exclude name="LocalVariableCouldBeFinal"/> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 53 | </rule> |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 54 | <rule ref="category/java/codestyle.xml/VariableNamingConventions"> |
| 55 | <properties> |
| 56 | <!-- ONOS allows the name "log" for static final Loggers --> |
| 57 | <property name="violationSuppressRegex" value=".*'log'.*"/> |
| 58 | </properties> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 59 | </rule> |
| 60 | |
| 61 | <rule ref="rulesets/java/clone.xml"/> |
| 62 | <rule ref="rulesets/java/strictexception.xml"/> |
| 63 | <rule ref="rulesets/java/design.xml"> |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 64 | <exclude name="GodClass"/> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 65 | </rule> |
| 66 | <rule ref="rulesets/java/coupling.xml"> |
Carmelo Cascone | 27b9712 | 2019-11-12 10:34:05 -0800 | [diff] [blame] | 67 | <exclude name="LawOfDemeter"/> |
| 68 | <exclude name="ExcessiveImports"/> |
| 69 | <!-- Suppress Removed misconfigured rule warning --> |
| 70 | <exclude name="LoosePackageCoupling"/> |
tom | 50a76dd | 2014-09-02 15:18:35 -0700 | [diff] [blame] | 71 | </rule> |
| 72 | </ruleset> |
| 73 | |