1 | <?xml version="1.0"?>
|
---|
2 | <ruleset name="JOSM ruleset"
|
---|
3 | xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
---|
4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
---|
5 | xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
|
---|
6 |
|
---|
7 | <description>JOSM PMD ruleset</description>
|
---|
8 |
|
---|
9 | <rule ref="category/java/bestpractices.xml">
|
---|
10 | <exclude name="AccessorClassGeneration"/>
|
---|
11 | <exclude name="AccessorMethodGeneration"/>
|
---|
12 | <exclude name="ArrayIsStoredDirectly"/>
|
---|
13 | <exclude name="AvoidPrintStackTrace"/>
|
---|
14 | <exclude name="AvoidReassigningParameters"/>
|
---|
15 | <exclude name="AvoidStringBufferField"/>
|
---|
16 | <exclude name="AvoidUsingHardCodedIP"/>
|
---|
17 | <exclude name="ConstantsInInterface"/>
|
---|
18 | <exclude name="ForLoopCanBeForeach"/>
|
---|
19 | <exclude name="GuardLogStatement"/>
|
---|
20 | <exclude name="JUnit4TestShouldUseAfterAnnotation"/>
|
---|
21 | <exclude name="JUnit4TestShouldUseTestAnnotation"/>
|
---|
22 | <exclude name="LooseCoupling"/>
|
---|
23 | <exclude name="MethodReturnsInternalArray"/>
|
---|
24 | <exclude name="OneDeclarationPerLine"/>
|
---|
25 | <exclude name="PositionLiteralsFirstInComparisons"/>
|
---|
26 | <exclude name="PreserveStackTrace"/>
|
---|
27 | <exclude name="ReplaceHashtableWithMap"/>
|
---|
28 | <exclude name="SwitchStmtsShouldHaveDefault"/>
|
---|
29 | <exclude name="SystemPrintln"/>
|
---|
30 | <exclude name="UnusedFormalParameter"/>
|
---|
31 | <exclude name="UseVarargs"/>
|
---|
32 | </rule>
|
---|
33 | <rule ref="category/java/bestpractices.xml/PreserveStackTrace">
|
---|
34 | <properties>
|
---|
35 | <property name="violationSuppressXPath" value="//PrimaryExpression/PrimaryPrefix/Name[@Image='BugReport.intercept']"/>
|
---|
36 | </properties>
|
---|
37 | </rule>
|
---|
38 | <rule ref="category/java/bestpractices.xml/UnusedFormalParameter">
|
---|
39 | <properties>
|
---|
40 | <property name="violationSuppressXPath" value="//Annotation[MarkerAnnotation/Name/@Image='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]"/>
|
---|
41 | </properties>
|
---|
42 | </rule>
|
---|
43 | <rule ref="category/java/codestyle.xml">
|
---|
44 | <exclude name="AbstractNaming"/>
|
---|
45 | <exclude name="AtLeastOneConstructor"/>
|
---|
46 | <exclude name="AvoidFinalLocalVariable"/>
|
---|
47 | <exclude name="AvoidPrefixingMethodParameters"/>
|
---|
48 | <exclude name="BooleanGetMethodName"/>
|
---|
49 | <exclude name="CallSuperInConstructor"/>
|
---|
50 | <exclude name="CommentDefaultAccessModifier"/>
|
---|
51 | <exclude name="ConfusingTernary"/>
|
---|
52 | <exclude name="ControlStatementBraces"/>
|
---|
53 | <exclude name="DefaultPackage"/>
|
---|
54 | <exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
|
---|
55 | <exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
|
---|
56 | <exclude name="ForLoopsMustUseBraces"/>
|
---|
57 | <exclude name="IfElseStmtsMustUseBraces"/>
|
---|
58 | <exclude name="IfStmtsMustUseBraces"/>
|
---|
59 | <exclude name="LocalVariableCouldBeFinal"/>
|
---|
60 | <exclude name="LongVariable"/>
|
---|
61 | <exclude name="MethodArgumentCouldBeFinal"/>
|
---|
62 | <exclude name="MethodNamingConventions"/>
|
---|
63 | <exclude name="OnlyOneReturn"/>
|
---|
64 | <exclude name="PrematureDeclaration"/>
|
---|
65 | <exclude name="ShortClassName"/>
|
---|
66 | <exclude name="ShortMethodName"/>
|
---|
67 | <exclude name="ShortVariable"/>
|
---|
68 | <exclude name="TooManyStaticImports"/>
|
---|
69 | <exclude name="UnnecessaryConstructor"/>
|
---|
70 | <exclude name="UselessParentheses"/>
|
---|
71 | <exclude name="VariableNamingConventions"/>
|
---|
72 | <exclude name="WhileLoopsMustUseBraces"/>
|
---|
73 | </rule>
|
---|
74 | <rule ref="category/java/codestyle.xml/ShortMethodName">
|
---|
75 | <properties>
|
---|
76 | <property name="violationSuppressXPath" value="//MethodDeclarator[@Image='at' or @Image='ht' or @Image='of' or @Image='ok' or @Image='tr']
|
---|
77 | | //MethodDeclarator/../../Annotation/MarkerAnnotation/Name[@Image='Deprecated']
|
---|
78 | | //MethodDeclarator/../../../..[@Image='LambertConformalConic']"/>
|
---|
79 | </properties>
|
---|
80 | </rule>
|
---|
81 | <rule ref="category/java/codestyle.xml/MethodNamingConventions">
|
---|
82 | <properties>
|
---|
83 | <property name="violationSuppressXPath" value="//MethodDeclarator/../../../..[@Image='Functions' or @Image='PseudoClasses' or @Image='Role' or @Image='TaggingPreset']"/>
|
---|
84 | </properties>
|
---|
85 | </rule>
|
---|
86 | <rule ref="category/java/codestyle.xml/VariableNamingConventions">
|
---|
87 | <properties>
|
---|
88 | <property name="violationSuppressXPath" value="//FieldDeclaration[@Public='true']
|
---|
89 | | //FieldDeclaration/../Annotation/MarkerAnnotation/Name[@Image='pref']
|
---|
90 | | //FieldDeclaration/Type/ReferenceType/ClassOrInterfaceType[@Image!='Boolean' and
|
---|
91 | @Image!='Byte' and
|
---|
92 | @Image!='Character' and
|
---|
93 | @Image!='Class' and
|
---|
94 | @Image!='Double' and
|
---|
95 | @Image!='Enum' and
|
---|
96 | @Image!='Float' and
|
---|
97 | @Image!='Integer' and
|
---|
98 | @Image!='Long' and
|
---|
99 | @Image!='Number' and
|
---|
100 | @Image!='Short' and
|
---|
101 | @Image!='String' ]"/>
|
---|
102 | </properties>
|
---|
103 | </rule>
|
---|
104 | <rule ref="category/java/codestyle.xml/LongVariable">
|
---|
105 | <properties>
|
---|
106 | <property name="minimum" value="44"/>
|
---|
107 | </properties>
|
---|
108 | </rule>
|
---|
109 | <rule ref="category/java/design.xml">
|
---|
110 | <exclude name="AvoidCatchingGenericException"/>
|
---|
111 | <exclude name="AvoidDeeplyNestedIfStmts"/>
|
---|
112 | <exclude name="AvoidRethrowingException"/>
|
---|
113 | <exclude name="CollapsibleIfStatements"/>
|
---|
114 | <exclude name="CouplingBetweenObjects"/>
|
---|
115 | <exclude name="CyclomaticComplexity"/>
|
---|
116 | <exclude name="DataClass"/>
|
---|
117 | <exclude name="ExceptionAsFlowControl"/>
|
---|
118 | <exclude name="ExcessiveClassLength"/>
|
---|
119 | <exclude name="ExcessiveImports"/>
|
---|
120 | <exclude name="ExcessiveMethodLength"/>
|
---|
121 | <exclude name="ExcessiveParameterList"/>
|
---|
122 | <exclude name="ExcessivePublicCount"/>
|
---|
123 | <exclude name="GodClass"/>
|
---|
124 | <exclude name="ImmutableField"/>
|
---|
125 | <exclude name="LawOfDemeter"/>
|
---|
126 | <exclude name="LoosePackageCoupling"/>
|
---|
127 | <exclude name="NcssCount"/>
|
---|
128 | <exclude name="NPathComplexity"/>
|
---|
129 | <exclude name="SignatureDeclareThrowsException"/>
|
---|
130 | <exclude name="SimplifiedTernary"/>
|
---|
131 | <exclude name="SimplifyConditional"/>
|
---|
132 | <exclude name="SingularField"/>
|
---|
133 | <exclude name="SwitchDensity"/>
|
---|
134 | <exclude name="TooManyFields"/>
|
---|
135 | <exclude name="TooManyMethods"/>
|
---|
136 | <exclude name="UseObjectForClearerAPI"/>
|
---|
137 | <exclude name="UselessOverridingMethod"/>
|
---|
138 | <exclude name="UseUtilityClass"/>
|
---|
139 | </rule>
|
---|
140 | <rule ref="category/java/design.xml/SignatureDeclareThrowsException">
|
---|
141 | <properties>
|
---|
142 | <property name="violationSuppressXPath" value="//MethodDeclaration/../Annotation/MarkerAnnotation/Name[@Image='Override']"/>
|
---|
143 | <property name="IgnoreJUnitCompletely" value="true"/>
|
---|
144 | </properties>
|
---|
145 | </rule>
|
---|
146 | <rule ref="category/java/errorprone.xml">
|
---|
147 | <exclude name="AssignmentInOperand"/>
|
---|
148 | <exclude name="AssignmentToNonFinalStatic"/>
|
---|
149 | <exclude name="AvoidBranchingStatementAsLastInLoop"/>
|
---|
150 | <exclude name="AvoidCatchingNPE"/>
|
---|
151 | <exclude name="AvoidDuplicateLiterals"/>
|
---|
152 | <exclude name="AvoidFieldNameMatchingMethodName"/>
|
---|
153 | <exclude name="AvoidFieldNameMatchingTypeName"/>
|
---|
154 | <exclude name="AvoidInstanceofChecksInCatchClause"/>
|
---|
155 | <exclude name="AvoidLiteralsInIfCondition"/>
|
---|
156 | <exclude name="BeanMembersShouldSerialize"/>
|
---|
157 | <exclude name="CompareObjectsWithEquals"/>
|
---|
158 | <exclude name="ConstructorCallsOverridableMethod"/>
|
---|
159 | <exclude name="DataflowAnomalyAnalysis"/>
|
---|
160 | <exclude name="DoNotCallSystemExit"/>
|
---|
161 | <exclude name="DontImportSun"/>
|
---|
162 | <exclude name="EmptyIfStmt"/>
|
---|
163 | <exclude name="EmptyWhileStmt"/>
|
---|
164 | <exclude name="MissingBreakInSwitch"/>
|
---|
165 | <exclude name="MissingSerialVersionUID"/>
|
---|
166 | <exclude name="MissingStaticMethodInNonInstantiatableClass"/>
|
---|
167 | <exclude name="NonStaticInitializer"/>
|
---|
168 | <exclude name="NullAssignment"/>
|
---|
169 | <exclude name="ReturnEmptyArrayRatherThanNull"/>
|
---|
170 | <exclude name="SimpleDateFormatNeedsLocale"/>
|
---|
171 | <exclude name="SingleMethodSingleton"/>
|
---|
172 | <exclude name="SingletonClassReturningNewInstance"/>
|
---|
173 | <exclude name="TestClassWithoutTestCases"/>
|
---|
174 | <exclude name="UseProperClassLoader"/>
|
---|
175 | </rule>
|
---|
176 | <rule ref="category/java/performance.xml">
|
---|
177 | <exclude name="AvoidInstantiatingObjectsInLoops"/>
|
---|
178 | <exclude name="AvoidUsingShortType"/>
|
---|
179 | <exclude name="ConsecutiveLiteralAppends"/>
|
---|
180 | <exclude name="InefficientEmptyStringCheck"/>
|
---|
181 | <exclude name="SimplifyStartsWith"/>
|
---|
182 | <exclude name="TooFewBranchesForASwitchStatement"/>
|
---|
183 | <exclude name="UseArrayListInsteadOfVector"/>
|
---|
184 | <exclude name="UselessStringValueOf"/>
|
---|
185 | <exclude name="UseStringBufferForStringAppends"/>
|
---|
186 | </rule>
|
---|
187 |
|
---|
188 | </ruleset>
|
---|