Changeset 18332 in josm for trunk/tools/pmd
- Timestamp:
- 2021-12-20T14:12:10+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/pmd/josm-ruleset.xml
r15588 r18332 4 4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 5 5 xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> 6 6 7 7 <description>JOSM PMD ruleset</description> 8 8 9 9 <rule ref="category/java/bestpractices.xml"> 10 10 <exclude name="AccessorClassGeneration"/> … … 22 22 <exclude name="JUnit4TestShouldUseAfterAnnotation"/> 23 23 <exclude name="JUnit4TestShouldUseTestAnnotation"/> 24 <exclude name="LiteralsFirstInComparisons" reason="Introduced in 6.24, some positives in source code at this time. Replaces PositionLiteralsFirstInComparisons."/> 24 25 <exclude name="LooseCoupling"/> 25 26 <exclude name="MethodReturnsInternalArray"/> 26 27 <exclude name="OneDeclarationPerLine"/> 27 <exclude name="PositionLiteralsFirstInComparisons"/>28 28 <exclude name="PreserveStackTrace"/> 29 29 <exclude name="ReplaceHashtableWithMap"/> 30 30 <exclude name="SwitchStmtsShouldHaveDefault"/> 31 31 <exclude name="SystemPrintln"/> 32 <exclude name="UnusedAssignment" reason="Introduced in 6.26, some number of positives in source code at this time"/> 32 33 <exclude name="UnusedFormalParameter"/> 34 <exclude name="UnusedPrivateMethod" reason="Broken since PMD 6.33, see https://github.com/pmd/pmd/issues/3468"/> 33 35 <exclude name="UseVarargs"/> 34 36 </rule> … … 40 42 <rule ref="category/java/bestpractices.xml/UnusedFormalParameter"> 41 43 <properties> 42 <property name="violationSuppressXPath" value="//Annotation[MarkerAnnotation/Name/@ Image='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]"/>44 <property name="violationSuppressXPath" value="//Annotation[MarkerAnnotation/Name/@SimpleName='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]"/> 43 45 </properties> 44 46 </rule> … … 73 75 <exclude name="ShortVariable"/> 74 76 <exclude name="TooManyStaticImports"/> 77 <exclude name="UnnecessaryCast" reason="Introduced in 6.24, some positives in source code at this time"/> 75 78 <exclude name="UnnecessaryConstructor"/> 79 <exclude name="UseUnderscoresInNumericLiterals"/> 76 80 <exclude name="UselessParentheses"/> 77 <exclude name="UseUnderscoresInNumericLiterals"/>78 81 <exclude name="VariableNamingConventions"/> 79 82 <exclude name="WhileLoopsMustUseBraces"/> … … 81 84 <rule ref="category/java/codestyle.xml/ShortMethodName"> 82 85 <properties> 83 <property name="violationSuppressXPath" value="//MethodDeclarat or[@Image='at' or @Image='ht' or @Image='of' or @Image='ok' or @Image='tr']84 | //MethodDeclarat or/../../Annotation/MarkerAnnotation/Name[@Image='Deprecated']85 | //MethodDeclarat or/../../../..[@Image='LambertConformalConic']"/>86 <property name="violationSuppressXPath" value="//MethodDeclaration[@Name='at' or @Name='ht' or @Name='of' or @Name='ok' or @Name='tr'] 87 | //MethodDeclaration/../../Annotation/MarkerAnnotation/Name[@Image='Deprecated'] 88 | //MethodDeclaration/../../../..[@Image='LambertConformalConic']"/> 86 89 </properties> 87 90 </rule> 88 91 <rule ref="category/java/codestyle.xml/MethodNamingConventions"> 89 92 <properties> 90 <property name="violationSuppressXPath" value="//MethodDeclarat or/../../../..[@Image='Functions' or @Image='PseudoClasses' or @Image='Role' or @Image='TaggingPreset']"/>93 <property name="violationSuppressXPath" value="//MethodDeclaration/../../..[@SimpleName='Functions' or @SimpleName='PseudoClasses' or @SimpleName='Role' or @SimpleName='TaggingPreset']"/> 91 94 </properties> 92 95 </rule> … … 96 99 <property name="violationSuppressXPath" value="//FieldDeclaration[@Public='true'] 97 100 | //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 101 | //FieldDeclaration/Type/ReferenceType/ClassOrInterfaceType[@Image!='Boolean' and 102 @Image!='Byte' and 103 @Image!='Character' and 104 @Image!='Class' and 105 @Image!='Double' and 106 @Image!='Enum' and 107 @Image!='Float' and 105 108 @Image!='Integer' and 106 109 @Image!='Long' and 107 110 @Image!='Number' and 108 @Image!='Short' and 111 @Image!='Short' and 109 112 @Image!='String' ]"/> 110 113 </properties> … … 119 122 <exclude name="AvoidDeeplyNestedIfStmts"/> 120 123 <exclude name="AvoidRethrowingException"/> 124 <exclude name="CognitiveComplexity" reason="Introduced in 6.35, some number of positives in source code at this time"/> 121 125 <exclude name="CollapsibleIfStatements"/> 122 126 <exclude name="CouplingBetweenObjects"/> … … 133 137 <exclude name="LawOfDemeter"/> 134 138 <exclude name="LoosePackageCoupling"/> 139 <exclude name="MutableStaticState" reason="Introduced in 6.35, some number of positives in source code at this time"/> 135 140 <exclude name="NcssCount"/> 136 141 <exclude name="NPathComplexity"/> … … 168 173 <exclude name="ConstructorCallsOverridableMethod"/> 169 174 <exclude name="DataflowAnomalyAnalysis"/> 170 <exclude name="DoNot CallSystemExit"/>175 <exclude name="DoNotTerminateVM"/> 171 176 <exclude name="DontImportSun"/> 172 177 <exclude name="EmptyIfStmt"/> 173 178 <exclude name="EmptyWhileStmt"/> 174 <exclude name=" MissingBreakInSwitch"/>179 <exclude name="ImplicitSwitchFallThrough"/> 175 180 <exclude name="MissingSerialVersionUID"/> 176 181 <exclude name="MissingStaticMethodInNonInstantiatableClass"/> … … 178 183 <exclude name="NullAssignment"/> 179 184 <exclude name="ReturnEmptyArrayRatherThanNull"/> 185 <exclude name="ReturnEmptyCollectionRatherThanNull" reason="Introduced in 6.37, there are positives in source code at this time"/> 180 186 <exclude name="SimpleDateFormatNeedsLocale"/> 181 187 <exclude name="SingleMethodSingleton"/> … … 183 189 <exclude name="TestClassWithoutTestCases"/> 184 190 <exclude name="UseProperClassLoader"/> 191 </rule> 192 <rule ref="category/java/errorprone.xml/AvoidAccessibilityAlteration"> 193 <properties> 194 <property name="violationSuppressXPath" value="//MethodDeclaration/../../..[@SimpleName='ReflectionUtils']"/> 195 </properties> 185 196 </rule> 186 197 <rule ref="category/java/performance.xml"> … … 190 201 <exclude name="InefficientEmptyStringCheck"/> 191 202 <exclude name="SimplifyStartsWith"/> 203 <exclude name="InsufficientStringBufferDeclaration" reason="PMD 6.40 has a bug where it doesn't properly count appended strings in if statements."/> 192 204 <exclude name="TooFewBranchesForASwitchStatement"/> 193 205 <exclude name="UseArrayListInsteadOfVector"/>
Note:
See TracChangeset
for help on using the changeset viewer.