2019-09-14 14:25:04 +00:00
<?xml version="1.0"?>
2019-10-15 15:36:57 +00:00
<ruleset name= "Ruleset for josm-mapwithai-plugin"
2019-09-14 14:25:04 +00:00
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description >
2020-01-09 17:49:11 +00:00
This ruleset checks some rules that you should normally follow for the JOSM-mapwithai plugin.
2019-11-06 18:23:08 +00:00
Copied from josm tools/pmd/josm-ruleset.xml
2019-09-14 14:25:04 +00:00
</description>
2019-11-06 18:23:08 +00:00
<rule ref= "category/java/bestpractices.xml" >
<exclude name= "AccessorClassGeneration" />
<exclude name= "AccessorMethodGeneration" />
<exclude name= "ArrayIsStoredDirectly" />
<exclude name= "AvoidPrintStackTrace" />
<exclude name= "AvoidReassigningParameters" />
<exclude name= "AvoidStringBufferField" />
<exclude name= "AvoidUsingHardCodedIP" />
<exclude name= "ConstantsInInterface" />
<exclude name= "ForLoopCanBeForeach" />
<exclude name= "GuardLogStatement" />
<exclude name= "JUnit4TestShouldUseAfterAnnotation" />
<exclude name= "JUnit4TestShouldUseTestAnnotation" />
<exclude name= "LooseCoupling" />
<exclude name= "MethodReturnsInternalArray" />
<exclude name= "OneDeclarationPerLine" />
<exclude name= "PositionLiteralsFirstInComparisons" />
<exclude name= "PreserveStackTrace" />
<exclude name= "ReplaceHashtableWithMap" />
<exclude name= "SwitchStmtsShouldHaveDefault" />
<exclude name= "SystemPrintln" />
<exclude name= "UnusedFormalParameter" />
<exclude name= "UseVarargs" />
</rule>
<rule ref= "category/java/bestpractices.xml/PreserveStackTrace" >
<properties >
<property name= "violationSuppressXPath" value= "//PrimaryExpression/PrimaryPrefix/Name[@Image='BugReport.intercept']" />
</properties>
</rule>
<rule ref= "category/java/bestpractices.xml/UnusedFormalParameter" >
<properties >
<property name= "violationSuppressXPath" value= "//Annotation[MarkerAnnotation/Name/@Image='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]" />
</properties>
</rule>
2019-09-14 14:25:04 +00:00
<rule ref= "category/java/codestyle.xml" >
<exclude name= "AbstractNaming" />
2019-11-06 18:23:08 +00:00
<exclude name= "AtLeastOneConstructor" />
2019-09-14 14:25:04 +00:00
<exclude name= "AvoidFinalLocalVariable" />
2019-11-06 18:23:08 +00:00
<exclude name= "AvoidPrefixingMethodParameters" />
<exclude name= "BooleanGetMethodName" />
<exclude name= "CallSuperInConstructor" />
<exclude name= "ClassNamingConventions" />
2019-09-14 14:25:04 +00:00
<exclude name= "CommentDefaultAccessModifier" />
2019-11-06 18:23:08 +00:00
<exclude name= "ConfusingTernary" />
<exclude name= "ControlStatementBraces" />
2019-09-14 14:25:04 +00:00
<exclude name= "DefaultPackage" />
2019-11-06 18:23:08 +00:00
<exclude name= "EmptyMethodInAbstractClassShouldBeAbstract" />
<exclude name= "FieldDeclarationsShouldBeAtStartOfClass" />
<exclude name= "FieldNamingConventions" />
<exclude name= "ForLoopsMustUseBraces" />
<exclude name= "IfElseStmtsMustUseBraces" />
<exclude name= "IfStmtsMustUseBraces" />
<exclude name= "LinguisticNaming" />
<exclude name= "LocalVariableCouldBeFinal" />
2019-09-14 14:25:04 +00:00
<exclude name= "LongVariable" />
2019-11-06 18:23:08 +00:00
<exclude name= "MethodArgumentCouldBeFinal" />
<exclude name= "MethodNamingConventions" />
<exclude name= "NoPackage" />
<exclude name= "OnlyOneReturn" />
<exclude name= "PrematureDeclaration" />
<exclude name= "ShortClassName" />
<exclude name= "ShortMethodName" />
2019-09-14 14:25:04 +00:00
<exclude name= "ShortVariable" />
2019-11-06 18:23:08 +00:00
<exclude name= "TooManyStaticImports" />
<exclude name= "UnnecessaryConstructor" />
<exclude name= "UselessParentheses" />
<exclude name= "UseUnderscoresInNumericLiterals" />
<exclude name= "VariableNamingConventions" />
<exclude name= "WhileLoopsMustUseBraces" />
</rule>
<rule ref= "category/java/codestyle.xml/ShortMethodName" >
<properties >
<property name= "violationSuppressXPath" value= "//MethodDeclarator[@Image='at' o r @ Image= 'ht' o r @ Image= 'of' o r @ Image= 'ok' o r @ Image= 'tr' ]
| //MethodDeclarator/../../Annotation/MarkerAnnotation/Name[@Image='Deprecated']
| //MethodDeclarator/../../../..[@Image='LambertConformalConic']"/>
</properties>
</rule>
<rule ref= "category/java/codestyle.xml/MethodNamingConventions" >
<properties >
<property name= "violationSuppressXPath" value= "//MethodDeclarator/../../../..[@Image='Functions' or @Image='PseudoClasses' or @Image='Role' or @Image='TaggingPreset']" />
</properties>
</rule>
<rule ref= "category/java/codestyle.xml/FieldNamingConventions" >
<properties >
<property name= "enumConstantPattern" value= "[A-Za-z][A-Za-z_0-9]*" />
<property name= "violationSuppressXPath" value= "//FieldDeclaration[@Public='true']
| //FieldDeclaration/../Annotation/MarkerAnnotation/Name[@Image='pref']
| //FieldDeclaration/Type/ReferenceType/ClassOrInterfaceType[@Image!='Boolean' and
@Image!='Byte' and
@Image!='Character' and
@Image!='Class' and
@Image!='Double' and
@Image!='Enum' and
@Image!='Float' and
@Image!='Integer' and
@Image!='Long' and
@Image!='Number' and
@Image!='Short' and
@Image!='String' ]"/>
</properties>
</rule>
<rule ref= "category/java/codestyle.xml/LongVariable" >
<properties >
<property name= "minimum" value= "44" />
</properties>
2019-09-14 14:25:04 +00:00
</rule>
<rule ref= "category/java/design.xml" >
2019-11-06 18:23:08 +00:00
<exclude name= "AvoidCatchingGenericException" />
<exclude name= "AvoidDeeplyNestedIfStmts" />
<exclude name= "AvoidRethrowingException" />
<exclude name= "CollapsibleIfStatements" />
<exclude name= "CouplingBetweenObjects" />
<exclude name= "CyclomaticComplexity" />
<exclude name= "DataClass" />
<exclude name= "ExceptionAsFlowControl" />
<exclude name= "ExcessiveClassLength" />
<exclude name= "ExcessiveImports" />
<exclude name= "ExcessiveMethodLength" />
<exclude name= "ExcessiveParameterList" />
<exclude name= "ExcessivePublicCount" />
<exclude name= "GodClass" />
<exclude name= "ImmutableField" />
2019-09-14 14:25:04 +00:00
<exclude name= "LawOfDemeter" />
<exclude name= "LoosePackageCoupling" />
2019-11-06 18:23:08 +00:00
<exclude name= "NcssCount" />
<exclude name= "NPathComplexity" />
<exclude name= "SignatureDeclareThrowsException" />
<exclude name= "SimplifiedTernary" />
<exclude name= "SimplifyConditional" />
<exclude name= "SingularField" />
<exclude name= "SwitchDensity" />
<exclude name= "TooManyFields" />
<exclude name= "TooManyMethods" />
<exclude name= "UseObjectForClearerAPI" />
<exclude name= "UselessOverridingMethod" />
<exclude name= "UseUtilityClass" />
</rule>
<rule ref= "category/java/design.xml/SignatureDeclareThrowsException" >
<properties >
<property name= "violationSuppressXPath" value= "//MethodDeclaration/../Annotation/MarkerAnnotation/Name[@Image='Override']" />
<property name= "IgnoreJUnitCompletely" value= "true" />
</properties>
</rule>
<rule ref= "category/java/errorprone.xml" >
<exclude name= "AssignmentInOperand" />
<exclude name= "AssignmentToNonFinalStatic" />
<exclude name= "AvoidBranchingStatementAsLastInLoop" />
<exclude name= "AvoidCatchingNPE" />
<exclude name= "AvoidDuplicateLiterals" />
<exclude name= "AvoidFieldNameMatchingMethodName" />
<exclude name= "AvoidFieldNameMatchingTypeName" />
<exclude name= "AvoidInstanceofChecksInCatchClause" />
<exclude name= "AvoidLiteralsInIfCondition" />
<exclude name= "BeanMembersShouldSerialize" />
<exclude name= "CloneThrowsCloneNotSupportedException" />
<exclude name= "CompareObjectsWithEquals" />
<exclude name= "ConstructorCallsOverridableMethod" />
<exclude name= "DataflowAnomalyAnalysis" />
<exclude name= "DoNotCallSystemExit" />
<exclude name= "DontImportSun" />
<exclude name= "EmptyIfStmt" />
<exclude name= "EmptyWhileStmt" />
<exclude name= "MissingBreakInSwitch" />
<exclude name= "MissingSerialVersionUID" />
<exclude name= "MissingStaticMethodInNonInstantiatableClass" />
<exclude name= "NonStaticInitializer" />
<exclude name= "NullAssignment" />
<exclude name= "ReturnEmptyArrayRatherThanNull" />
<exclude name= "SimpleDateFormatNeedsLocale" />
<exclude name= "SingleMethodSingleton" />
<exclude name= "SingletonClassReturningNewInstance" />
<exclude name= "TestClassWithoutTestCases" />
<exclude name= "UseProperClassLoader" />
</rule>
<rule ref= "category/java/performance.xml" >
<exclude name= "AvoidInstantiatingObjectsInLoops" />
<exclude name= "AvoidUsingShortType" />
<exclude name= "ConsecutiveLiteralAppends" />
<exclude name= "InefficientEmptyStringCheck" />
<exclude name= "SimplifyStartsWith" />
<exclude name= "TooFewBranchesForASwitchStatement" />
<exclude name= "UseArrayListInsteadOfVector" />
<exclude name= "UselessStringValueOf" />
<exclude name= "UseStringBufferForStringAppends" />
2019-09-14 14:25:04 +00:00
</rule>
2019-11-06 18:23:08 +00:00
2019-09-14 14:25:04 +00:00
</ruleset>