blob: 156e6f9cfe3f92afd8b568556b8ddd4d14e7b1d8 [file] [log] [blame]
tom50a76dd2014-09-02 15:18:35 -07001<?xml version="1.0" encoding="UTF-8"?>
alshabibab984662014-12-04 18:56:18 -08002<!--
Brian O'Connora09fe5b2017-08-03 21:12:30 -07003 ~ Copyright 2014-present Open Networking Foundation
alshabibab984662014-12-04 18:56:18 -08004 ~
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 -->
tom50a76dd2014-09-02 15:18:35 -070017<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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" >
22
23 <description>ONOS PMD rules</description>
24
25 <rule ref="rulesets/java/unnecessary.xml" >
26 <exclude name="UselessParentheses" />
27 </rule>
28 <rule ref="rulesets/java/basic.xml">
29 <exclude name="EmptyCatchBlock"/>
30 </rule>
31 <rule ref="rulesets/java/basic.xml/EmptyCatchBlock">
32 <properties>
33 <property name="allowCommentedBlocks" value="true"/>
34 </properties>
35 </rule>
36 <rule ref="rulesets/java/unusedcode.xml">
37 <!-- Explicit public keyword in interface methods is acceptable -->
38 <exclude name="UnusedModifier" />
39 </rule>
40 <rule ref="rulesets/java/imports.xml"/>
41 <rule ref="rulesets/java/optimizations.xml">
42 <exclude name="LocalVariableCouldBeFinal" />
43 <exclude name="MethodArgumentCouldBeFinal" />
44 <exclude name="AvoidInstantiatingObjectsInLoops" />
45 </rule>
46
47 <rule ref="rulesets/java/strings.xml">
48 <exclude name="AvoidDuplicateLiterals" />
49 </rule>
50 <rule ref="rulesets/java/braces.xml"/>
51 <rule ref="rulesets/java/naming.xml">
52 <exclude name="AvoidInstantiatingObjectsInLoops" />
53 <exclude name="ShortClassName" />
54 <exclude name="ShortMethodName" />
55 <exclude name="ShortVariable" />
56 <exclude name="LongVariable" />
57 </rule>
58 <rule ref="rulesets/java/naming.xml/VariableNamingConventions">
59 <properties>
60 <!-- ONOS allows the name "log" for static final Loggers -->
61 <property name="violationSuppressRegex" value=".*'log'.*"/>
62 </properties>
63 </rule>
64
65 <rule ref="rulesets/java/clone.xml"/>
66 <rule ref="rulesets/java/strictexception.xml"/>
67 <rule ref="rulesets/java/design.xml">
68 <exclude name="GodClass" />
69 </rule>
70 <rule ref="rulesets/java/coupling.xml">
71 <exclude name="LawOfDemeter" />
72 <exclude name="ExcessiveImports" />
73 <!-- Suppress Removed misconfigured rule warning -->
74 <exclude name="LoosePackageCoupling" />
75 </rule>
76</ruleset>
77