You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ruleset.xml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?xml version="1.0"?>
  2. <ruleset name="DMDirc PMD checks"
  3. xmlns="http://pmd.sf.net/ruleset/1.0.0"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
  6. xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
  7. <description>DMDirc minimal PMD checks.</description>
  8. <rule ref="rulesets/java/empty.xml/EmptyIfStmt"><priority>1</priority></rule>
  9. <rule ref="rulesets/java/empty.xml/EmptyWhileStmt"><priority>1</priority></rule>
  10. <rule ref="rulesets/java/empty.xml/EmptyTryBlock"><priority>1</priority></rule>
  11. <rule ref="rulesets/java/empty.xml/EmptyFinallyBlock"><priority>1</priority></rule>
  12. <rule ref="rulesets/java/empty.xml/EmptySwitchStatements"><priority>1</priority></rule>
  13. <rule ref="rulesets/java/basic.xml/JumbledIncrementer"><priority>1</priority></rule>
  14. <rule ref="rulesets/java/basic.xml/ForLoopShouldBeWhileLoop"><priority>1</priority></rule>
  15. <rule ref="rulesets/java/unnecessary.xml/UnnecessaryConversionTemporary"><priority>1</priority></rule>
  16. <rule ref="rulesets/java/basic.xml/OverrideBothEqualsAndHashcode"><priority>1</priority></rule>
  17. <rule ref="rulesets/java/basic.xml/DoubleCheckedLocking"><priority>1</priority></rule>
  18. <rule ref="rulesets/java/basic.xml/ReturnFromFinallyBlock"><priority>1</priority></rule>
  19. <rule ref="rulesets/java/empty.xml/EmptySynchronizedBlock"><priority>1</priority></rule>
  20. <rule ref="rulesets/java/empty.xml/EmptyStaticInitializer"><priority>1</priority></rule>
  21. <rule ref="rulesets/java/basic.xml/UnconditionalIfStatement"><priority>1</priority></rule>
  22. <rule ref="rulesets/java/empty.xml/EmptyStatementNotInLoop"><priority>1</priority></rule>
  23. <rule ref="rulesets/java/basic.xml/BooleanInstantiation"><priority>1</priority></rule>
  24. <rule ref="rulesets/java/unnecessary.xml/UnnecessaryFinalModifier"><priority>1</priority></rule>
  25. <rule ref="rulesets/java/basic.xml/CollapsibleIfStatements"><priority>1</priority></rule>
  26. <rule ref="rulesets/java/unnecessary.xml/UselessOverridingMethod"><priority>1</priority></rule>
  27. <rule ref="rulesets/java/basic.xml/ClassCastExceptionWithToArray"><priority>1</priority></rule>
  28. <rule ref="rulesets/java/basic.xml/AvoidDecimalLiteralsInBigDecimalConstructor"><priority>1</priority></rule>
  29. <rule ref="rulesets/java/unnecessary.xml/UselessOperationOnImmutable"><priority>1</priority></rule>
  30. <rule ref="rulesets/java/basic.xml/MisplacedNullCheck"><priority>1</priority></rule>
  31. <rule ref="rulesets/java/unnecessary.xml/UnusedNullCheckInEquals"><priority>1</priority></rule>
  32. <rule ref="rulesets/java/basic.xml/BrokenNullCheck"><priority>1</priority></rule>
  33. <rule ref="rulesets/java/basic.xml/BigIntegerInstantiation"><priority>1</priority></rule>
  34. <rule ref="rulesets/java/basic.xml/AvoidMultipleUnaryOperators"><priority>1</priority></rule>
  35. <rule ref="rulesets/java/empty.xml/EmptyInitializer"><priority>1</priority></rule>
  36. <rule ref="rulesets/java/braces.xml/IfStmtsMustUseBraces"><priority>1</priority></rule>
  37. <rule ref="rulesets/java/braces.xml/WhileLoopsMustUseBraces"><priority>1</priority></rule>
  38. <rule ref="rulesets/java/braces.xml/IfElseStmtsMustUseBraces"><priority>1</priority></rule>
  39. <rule ref="rulesets/java/braces.xml/ForLoopsMustUseBraces"><priority>1</priority></rule>
  40. <rule ref="rulesets/java/unusedcode.xml/UnusedModifier"><priority>1</priority></rule>
  41. <rule ref="rulesets/java/controversial.xml/DontImportSun"><priority>1</priority></rule>
  42. <rule ref="rulesets/java/design.xml/SimplifyBooleanReturns"><priority>1</priority></rule>
  43. <rule ref="rulesets/java/design.xml/SimplifyBooleanExpressions"><priority>1</priority></rule>
  44. <rule ref="rulesets/java/design.xml/AvoidReassigningParameters"><priority>1</priority></rule>
  45. <rule ref="rulesets/java/design.xml/FinalFieldCouldBeStatic"><priority>1</priority></rule>
  46. <rule ref="rulesets/java/design.xml/NonStaticInitializer"><priority>1</priority></rule>
  47. <rule ref="rulesets/java/design.xml/OptimizableToArrayCall"><priority>1</priority></rule>
  48. <rule ref="rulesets/java/design.xml/BadComparison"><priority>1</priority></rule>
  49. <rule ref="rulesets/java/design.xml/EqualsNull"><priority>1</priority></rule>
  50. <rule ref="rulesets/java/design.xml/InstantiationToGetClass"><priority>1</priority></rule>
  51. <rule ref="rulesets/java/design.xml/IdempotentOperations"><priority>1</priority></rule>
  52. <rule ref="rulesets/java/design.xml/AssignmentToNonFinalStatic"><priority>1</priority></rule>
  53. <rule ref="rulesets/java/design.xml/MissingStaticMethodInNonInstantiatableClass"><priority>1</priority></rule>
  54. <rule ref="rulesets/java/design.xml/UseNotifyAllInsteadOfNotify"><priority>1</priority></rule>
  55. <rule ref="rulesets/java/design.xml/AvoidInstanceofChecksInCatchClause"><priority>1</priority></rule>
  56. <rule ref="rulesets/java/design.xml/SimplifyConditional"><priority>1</priority></rule>
  57. <rule ref="rulesets/java/design.xml/UnnecessaryLocalBeforeReturn"><priority>1</priority></rule>
  58. <rule ref="rulesets/java/design.xml/NonThreadSafeSingleton"><priority>1</priority></rule>
  59. <rule ref="rulesets/java/design.xml/AvoidConstantsInterface"><priority>1</priority></rule>
  60. <rule ref="rulesets/java/design.xml/UnsynchronizedStaticDateFormatter"><priority>1</priority></rule>
  61. <rule ref="rulesets/java/design.xml/PreserveStackTrace"><priority>1</priority></rule>
  62. <rule ref="rulesets/java/design.xml/UseCollectionIsEmpty"><priority>1</priority></rule>
  63. <rule ref="rulesets/java/finalizers.xml/EmptyFinalizer"><priority>1</priority></rule>
  64. <rule ref="rulesets/java/finalizers.xml/FinalizeOnlyCallsSuperFinalize"><priority>1</priority></rule>
  65. <rule ref="rulesets/java/finalizers.xml/FinalizeOverloaded"><priority>1</priority></rule>
  66. <rule ref="rulesets/java/finalizers.xml/FinalizeDoesNotCallSuperFinalize"><priority>1</priority></rule>
  67. <rule ref="rulesets/java/finalizers.xml/FinalizeShouldBeProtected"><priority>1</priority></rule>
  68. <rule ref="rulesets/java/finalizers.xml/AvoidCallingFinalize"><priority>1</priority></rule>
  69. <rule ref="rulesets/java/imports.xml/DuplicateImports"><priority>1</priority></rule>
  70. <rule ref="rulesets/java/imports.xml/DontImportJavaLang"><priority>1</priority></rule>
  71. <rule ref="rulesets/java/imports.xml/UnusedImports"><priority>1</priority></rule>
  72. <rule ref="rulesets/java/imports.xml/ImportFromSamePackage"><priority>1</priority></rule>
  73. <rule ref="rulesets/java/logging-java.xml/MoreThanOneLogger"><priority>1</priority></rule>
  74. <rule ref="rulesets/java/logging-java.xml/LoggerIsNotStaticFinal"><priority>1</priority></rule>
  75. <rule ref="rulesets/java/migrating.xml/ReplaceVectorWithList"><priority>1</priority></rule>
  76. <rule ref="rulesets/java/migrating.xml/ReplaceHashtableWithMap"><priority>1</priority></rule>
  77. <rule ref="rulesets/java/migrating.xml/ReplaceEnumerationWithIterator"><priority>1</priority></rule>
  78. <rule ref="rulesets/java/migrating.xml/AvoidEnumAsIdentifier"><priority>1</priority></rule>
  79. <rule ref="rulesets/java/migrating.xml/AvoidAssertAsIdentifier"><priority>1</priority></rule>
  80. <rule ref="rulesets/java/migrating.xml/IntegerInstantiation"><priority>1</priority></rule>
  81. <rule ref="rulesets/java/migrating.xml/ByteInstantiation"><priority>1</priority></rule>
  82. <rule ref="rulesets/java/migrating.xml/ShortInstantiation"><priority>1</priority></rule>
  83. <rule ref="rulesets/java/migrating.xml/LongInstantiation"><priority>1</priority></rule>
  84. <rule ref="rulesets/java/naming.xml/VariableNamingConventions"><priority>1</priority></rule>
  85. <rule ref="rulesets/java/naming.xml/MethodNamingConventions"><priority>1</priority></rule>
  86. <rule ref="rulesets/java/naming.xml/ClassNamingConventions"><priority>1</priority></rule>
  87. <rule ref="rulesets/java/naming.xml/AvoidDollarSigns"><priority>1</priority></rule>
  88. <rule ref="rulesets/java/naming.xml/MethodWithSameNameAsEnclosingClass"><priority>1</priority></rule>
  89. <rule ref="rulesets/java/naming.xml/SuspiciousHashcodeMethodName"><priority>1</priority></rule>
  90. <rule ref="rulesets/java/naming.xml/SuspiciousConstantFieldName"><priority>1</priority></rule>
  91. <rule ref="rulesets/java/naming.xml/SuspiciousEqualsMethodName"><priority>1</priority></rule>
  92. <rule ref="rulesets/java/naming.xml/NoPackage"><priority>1</priority></rule>
  93. <rule ref="rulesets/java/naming.xml/PackageCase"><priority>1</priority></rule>
  94. <rule ref="rulesets/java/optimizations.xml/LocalVariableCouldBeFinal"><priority>1</priority><properties><property name="violationSuppressXPath" value="//ForInit|//ForStatement/LocalVariableDeclaration"/></properties></rule>
  95. <rule ref="rulesets/java/optimizations.xml/MethodArgumentCouldBeFinal"><priority>1</priority></rule>
  96. <rule ref="rulesets/java/optimizations.xml/UseArrayListInsteadOfVector"><priority>1</priority></rule>
  97. <rule ref="rulesets/java/optimizations.xml/SimplifyStartsWith"><priority>1</priority></rule>
  98. <rule ref="rulesets/java/optimizations.xml/UseArraysAsList"><priority>1</priority></rule>
  99. <rule ref="rulesets/java/optimizations.xml/AvoidArrayLoops"><priority>1</priority></rule>
  100. <rule ref="rulesets/java/optimizations.xml/UnnecessaryWrapperObjectCreation"><priority>1</priority></rule>
  101. <rule ref="rulesets/java/optimizations.xml/AddEmptyString"><priority>1</priority></rule>
  102. <rule ref="rulesets/java/strictexception.xml/AvoidCatchingThrowable"><priority>1</priority></rule>
  103. <rule ref="rulesets/java/strictexception.xml/SignatureDeclareThrowsException"><priority>1</priority></rule>
  104. <rule ref="rulesets/java/strictexception.xml/ExceptionAsFlowControl"><priority>1</priority></rule>
  105. <rule ref="rulesets/java/strictexception.xml/AvoidCatchingNPE"><priority>1</priority></rule>
  106. <rule ref="rulesets/java/strictexception.xml/AvoidThrowingRawExceptionTypes"><priority>1</priority></rule>
  107. <rule ref="rulesets/java/strictexception.xml/DoNotExtendJavaLangError"><priority>1</priority></rule>
  108. <rule ref="rulesets/java/strictexception.xml/DoNotThrowExceptionInFinally"><priority>1</priority></rule>
  109. <rule ref="rulesets/java/strictexception.xml/AvoidThrowingNewInstanceOfSameException"><priority>1</priority></rule>
  110. <rule ref="rulesets/java/strings.xml/StringInstantiation"><priority>1</priority></rule>
  111. <rule ref="rulesets/java/strings.xml/StringToString"><priority>1</priority></rule>
  112. <rule ref="rulesets/java/strings.xml/InefficientStringBuffering"><priority>1</priority></rule>
  113. <rule ref="rulesets/java/strings.xml/UnnecessaryCaseChange"><priority>1</priority></rule>
  114. <rule ref="rulesets/java/strings.xml/UseStringBufferLength"><priority>1</priority></rule>
  115. <rule ref="rulesets/java/strings.xml/AppendCharacterWithChar"><priority>1</priority></rule>
  116. <rule ref="rulesets/java/strings.xml/UseIndexOfChar"><priority>1</priority></rule>
  117. <rule ref="rulesets/java/strings.xml/InefficientEmptyStringCheck"><priority>1</priority></rule>
  118. <rule ref="rulesets/java/strings.xml/UselessStringValueOf"><priority>1</priority></rule>
  119. <rule ref="rulesets/java/strings.xml/StringBufferInstantiationWithChar"><priority>1</priority></rule>
  120. <rule ref="rulesets/java/strings.xml/UseEqualsToCompareStrings"><priority>1</priority></rule>
  121. <rule ref="rulesets/java/typeresolution.xml/UnusedImports"><priority>1</priority><properties><property name="violationSuppressXPath" value="//ImportDeclaration[@ImportOnDemand='true']"/></properties></rule>
  122. <rule ref="rulesets/java/typeresolution.xml/SignatureDeclareThrowsException"><priority>1</priority></rule>
  123. <rule ref="rulesets/java/unusedcode.xml/UnusedPrivateField"><priority>1</priority></rule>
  124. <rule ref="rulesets/java/unusedcode.xml/UnusedLocalVariable"><priority>1</priority></rule>
  125. <rule ref="rulesets/java/unusedcode.xml/UnusedPrivateMethod"><priority>1</priority></rule>
  126. <rule ref="rulesets/java/unusedcode.xml/UnusedFormalParameter"><priority>1</priority></rule>
  127. </ruleset>