blob: 7c862a32c421054008ff4cb3ef87465194f35385 [file] [log] [blame]
Ray Milkey70d91cc2014-03-18 15:22:27 -07001<?xml version="1.0" encoding="UTF-8"?>
2<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 name="ONOS Rules"
4 xmlns="http://pmd.sf.net/ruleset/1.0.0"
5 xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
6 xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" >
7
8 <description>ONOS PMD rules</description>
9
10 <rule ref="rulesets/java/unnecessary.xml" >
11 <exclude name="UselessParentheses" />
12 </rule>
13 <rule ref="rulesets/java/basic.xml">
14 <exclude name="EmptyCatchBlock"/>
15 </rule>
16 <rule ref="rulesets/java/basic.xml/EmptyCatchBlock">
17 <properties>
18 <property name="allowCommentedBlocks" value="true"/>
19 </properties>
20 </rule>
Yuta HIGUCHIe28831a2014-03-24 17:17:48 -070021 <rule ref="rulesets/java/unusedcode.xml">
22 <!-- Explicit public keyword in interface methods is acceptable -->
23 <exclude name="UnusedModifier" />
24 </rule>
Ray Milkey70d91cc2014-03-18 15:22:27 -070025 <rule ref="rulesets/java/imports.xml"/>
26 <rule ref="rulesets/java/optimizations.xml">
27 <exclude name="LocalVariableCouldBeFinal" />
28 <exclude name="MethodArgumentCouldBeFinal" />
29 <exclude name="AvoidInstantiatingObjectsInLoops" />
30 </rule>
31
32 <rule ref="rulesets/java/strings.xml">
33 <exclude name="AvoidDuplicateLiterals" />
34 </rule>
35 <rule ref="rulesets/java/braces.xml"/>
36 <rule ref="rulesets/java/naming.xml">
37 <exclude name="AvoidInstantiatingObjectsInLoops" />
Ray Milkey92897212014-07-21 10:33:16 -070038 <exclude name="ShortClassName" />
Ray Milkey70d91cc2014-03-18 15:22:27 -070039 <exclude name="ShortMethodName" />
40 <exclude name="ShortVariable" />
41 <exclude name="LongVariable" />
42 </rule>
Ray Milkeyec497712014-03-20 17:51:22 -070043 <rule ref="rulesets/java/naming.xml/VariableNamingConventions">
44 <properties>
45 <!-- ONOS allows the name "log" for static final Loggers -->
46 <property name="violationSuppressRegex" value=".*'log'.*"/>
47 </properties>
48 </rule>
49
Ray Milkey70d91cc2014-03-18 15:22:27 -070050 <rule ref="rulesets/java/clone.xml"/>
51 <rule ref="rulesets/java/strictexception.xml"/>
52 <rule ref="rulesets/java/design.xml">
53 <exclude name="GodClass" />
54 </rule>
55 <rule ref="rulesets/java/coupling.xml">
56 <exclude name="LawOfDemeter" />
57 <exclude name="ExcessiveImports" />
Yuta HIGUCHIe28831a2014-03-24 17:17:48 -070058 <!-- Suppress Removed misconfigured rule warning -->
59 <exclude name="LoosePackageCoupling" />
Ray Milkey70d91cc2014-03-18 15:22:27 -070060 </rule>
Yuta HIGUCHIe28831a2014-03-24 17:17:48 -070061</ruleset>
62