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