123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <?xml version="1.0"?>
- <ruleset name="DMDirc PMD checks"
- xmlns="http://pmd.sf.net/ruleset/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
- xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
- <description>DMDirc minimal PMD checks.</description>
-
- <rule ref="rulesets/basic.xml/EmptyCatchBlock"><priority>3</priority></rule>
- <rule ref="rulesets/basic.xml/EmptyIfStmt"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/EmptyWhileStmt"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/EmptyTryBlock"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/EmptyFinallyBlock"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/EmptySwitchStatements"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/JumbledIncrementer"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/DoubleCheckedLocking"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/EmptySynchronizedBlock"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/UnnecessaryReturn"><priority>2</priority></rule>
- <rule ref="rulesets/basic.xml/EmptyStaticInitializer"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/UnconditionalIfStatement"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/BooleanInstantiation"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/CollapsibleIfStatements"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/UselessOverridingMethod"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/ClassCastExceptionWithToArray"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/AvoidDecimalLiteralsInBigDecimalConstructor"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/UselessOperationOnImmutable"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/MisplacedNullCheck"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/UnusedNullCheckInEquals"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/AvoidThreadGroup"><priority>2</priority></rule>
- <rule ref="rulesets/basic.xml/BrokenNullCheck"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/BigIntegerInstantiation"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/AvoidUsingOctalValues"><priority>2</priority></rule>
- <rule ref="rulesets/basic.xml/AvoidUsingHardCodedIP"><priority>4</priority></rule>
- <rule ref="rulesets/basic.xml/AvoidMultipleUnaryOperators"><priority>1</priority></rule>
- <rule ref="rulesets/basic.xml/EmptyInitializer"><priority>1</priority></rule>
-
- <rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"><priority>1</priority></rule>
- <rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"><priority>1</priority></rule>
- <rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"><priority>1</priority></rule>
- <rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"><priority>1</priority></rule>
-
- <rule ref="rulesets/clone.xml/ProperCloneImplementation"><priority>2</priority></rule>
- <rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"><priority>2</priority></rule>
- <rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"><priority>2</priority></rule>
-
- <rule ref="rulesets/codesize.xml/NPathComplexity"><priority>2</priority></rule>
- <rule ref="rulesets/codesize.xml/ExcessiveMethodLength"><priority>2</priority></rule>
- <rule ref="rulesets/codesize.xml/ExcessiveParameterList"><priority>2</priority></rule>
- <rule ref="rulesets/codesize.xml/ExcessiveClassLength"><priority>2</priority></rule>
- <rule ref="rulesets/codesize.xml/CyclomaticComplexity"><priority>2</priority></rule>
- <rule ref="rulesets/codesize.xml/ExcessivePublicCount"><priority>5</priority></rule>
- <rule ref="rulesets/codesize.xml/TooManyFields"><priority>5</priority></rule>
- <rule ref="rulesets/codesize.xml/NcssMethodCount"><priority>4</priority></rule>
- <rule ref="rulesets/codesize.xml/NcssTypeCount"><priority>4</priority></rule>
- <rule ref="rulesets/codesize.xml/NcssConstructorCount"><priority>4</priority></rule>
- <rule ref="rulesets/codesize.xml/TooManyMethods"><priority>3</priority></rule>
-
- <rule ref="rulesets/controversial.xml/UnnecessaryConstructor"><priority>1</priority></rule>
- <rule ref="rulesets/controversial.xml/NullAssignment"><priority>3</priority></rule>
- <rule ref="rulesets/controversial.xml/UnusedModifier"><priority>1</priority></rule>
- <rule ref="rulesets/controversial.xml/AssignmentInOperand"><priority>2</priority></rule>
- <rule ref="rulesets/controversial.xml/DontImportSun"><priority>1</priority></rule>
- <rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"><priority>3</priority></rule>
- <rule ref="rulesets/controversial.xml/CallSuperInConstructor"><priority>2</priority></rule>
- <rule ref="rulesets/controversial.xml/UnnecessaryParentheses"><priority>1</priority></rule>
- <rule ref="rulesets/controversial.xml/DefaultPackage"><priority>2</priority></rule>
- <rule ref="rulesets/controversial.xml/BooleanInversion"><priority>3</priority></rule>
- <rule ref="rulesets/controversial.xml/AvoidUsingShortType"><priority>3</priority></rule>
- <rule ref="rulesets/controversial.xml/AvoidUsingVolatile"><priority>3</priority></rule>
- <rule ref="rulesets/controversial.xml/AvoidAccessibilityAlteration"><priority>2</priority></rule>
- <rule ref="rulesets/controversial.xml/DoNotCallGarbageCollectionExplicitly"><priority>3</priority></rule>
-
- <rule ref="rulesets/coupling.xml/CouplingBetweenObjects"><priority>3</priority></rule>
- <rule ref="rulesets/coupling.xml/ExcessiveImports"><priority>3</priority></rule>
- <rule ref="rulesets/coupling.xml/LooseCoupling"><priority>2</priority></rule>
-
- <rule ref="rulesets/design.xml/UseSingleton"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/SimplifyBooleanReturns"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/SimplifyBooleanExpressions"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"><priority>4</priority></rule>
- <rule ref="rulesets/design.xml/AvoidReassigningParameters"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/SwitchDensity"><priority>3</priority></rule>
- <rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"><priority>4</priority></rule>
- <rule ref="rulesets/design.xml/AccessorClassGeneration"><priority>3</priority></rule>
- <rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/CloseResource"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/NonStaticInitializer"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"><priority>4</priority></rule>
- <rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"><priority>4</priority></rule>
- <rule ref="rulesets/design.xml/OptimizableToArrayCall"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/BadComparison"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/EqualsNull"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/ConfusingTernary"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/InstantiationToGetClass"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/IdempotentOperations"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/SimpleDateFormatNeedsLocale"><priority>5</priority></rule>
- <rule ref="rulesets/design.xml/ImmutableField"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"><priority>5</priority></rule>
- <rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"><priority>4</priority></rule>
- <rule ref="rulesets/design.xml/MissingBreakInSwitch"><priority>4</priority></rule>
- <rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"><priority>5</priority></rule>
- <rule ref="rulesets/design.xml/SimplifyConditional"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/CompareObjectsWithEquals"><priority>3</priority></rule>
- <rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"><priority>3</priority></rule>
- <rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/NonThreadSafeSingleton"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/UncommentedEmptyMethod"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/UncommentedEmptyConstructor"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/AvoidConstantsInterface"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/UnsynchronizedStaticDateFormatter"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/PreserveStackTrace"><priority>1</priority></rule>
- <rule ref="rulesets/design.xml/UseCollectionIsEmpty"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/EmptyMethodInAbstractClassShouldBeAbstract"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/SingularField"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/ReturnEmptyArrayRatherThanNull"><priority>2</priority></rule>
- <rule ref="rulesets/design.xml/AbstractClassWithoutAnyMethod"><priority>2</priority></rule>
-
- <rule ref="rulesets/finalizers.xml/EmptyFinalizer"><priority>1</priority></rule>
- <rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"><priority>1</priority></rule>
- <rule ref="rulesets/finalizers.xml/FinalizeOverloaded"><priority>1</priority></rule>
- <rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"><priority>1</priority></rule>
- <rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"><priority>1</priority></rule>
- <rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"><priority>1</priority></rule>
-
- <rule ref="rulesets/imports.xml/DuplicateImports"><priority>1</priority></rule>
- <rule ref="rulesets/imports.xml/DontImportJavaLang"><priority>1</priority></rule>
- <rule ref="rulesets/imports.xml/UnusedImports"><priority>1</priority></rule>
- <rule ref="rulesets/imports.xml/ImportFromSamePackage"><priority>1</priority></rule>
- <rule ref="rulesets/imports.xml/TooManyStaticImports"><priority>4</priority></rule>
-
- <rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"><priority>5</priority></rule>
- <rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"><priority>5</priority></rule>
-
- <rule ref="rulesets/logging-java.xml/MoreThanOneLogger"><priority>1</priority></rule>
- <rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"><priority>1</priority></rule>
- <rule ref="rulesets/logging-java.xml/SystemPrintln"><priority>2</priority></rule>
- <rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"><priority>2</priority></rule>
-
- <rule ref="rulesets/migrating.xml/ReplaceVectorWithList"><priority>1</priority></rule>
- <rule ref="rulesets/migrating.xml/ReplaceHashtableWithMap"><priority>1</priority></rule>
- <rule ref="rulesets/migrating.xml/ReplaceEnumerationWithIterator"><priority>1</priority></rule>
- <rule ref="rulesets/migrating.xml/AvoidEnumAsIdentifier"><priority>1</priority></rule>
- <rule ref="rulesets/migrating.xml/AvoidAssertAsIdentifier"><priority>1</priority></rule>
- <rule ref="rulesets/migrating.xml/IntegerInstantiation"><priority>1</priority></rule>
- <rule ref="rulesets/migrating.xml/ByteInstantiation"><priority>1</priority></rule>
- <rule ref="rulesets/migrating.xml/ShortInstantiation"><priority>1</priority></rule>
- <rule ref="rulesets/migrating.xml/LongInstantiation"><priority>1</priority></rule>
-
- <rule ref="rulesets/naming.xml/ShortVariable"><priority>3</priority></rule>
- <rule ref="rulesets/naming.xml/LongVariable"><priority>2</priority></rule>
- <rule ref="rulesets/naming.xml/ShortMethodName"><priority>2</priority></rule>
- <rule ref="rulesets/naming.xml/VariableNamingConventions"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/MethodNamingConventions"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/ClassNamingConventions"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/AvoidDollarSigns"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/SuspiciousEqualsMethodName"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"><priority>2</priority></rule>
- <rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"><priority>2</priority></rule>
- <rule ref="rulesets/naming.xml/NoPackage"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/PackageCase"><priority>1</priority></rule>
- <rule ref="rulesets/naming.xml/BooleanGetMethodName"><priority>2</priority></rule>
-
- <rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"><priority>2</priority></rule>
- <rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"><priority>1</priority></rule>
- <rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"><priority>3</priority></rule>
- <rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"><priority>1</priority></rule>
- <rule ref="rulesets/optimizations.xml/SimplifyStartsWith"><priority>1</priority></rule>
- <rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"><priority>3</priority></rule>
- <rule ref="rulesets/optimizations.xml/UseArraysAsList"><priority>1</priority></rule>
- <rule ref="rulesets/optimizations.xml/AvoidArrayLoops"><priority>1</priority></rule>
- <rule ref="rulesets/optimizations.xml/UnnecessaryWrapperObjectCreation"><priority>1</priority></rule>
- <rule ref="rulesets/optimizations.xml/AddEmptyString"><priority>1</priority></rule>
-
- <rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"><priority>1</priority></rule>
- <rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"><priority>1</priority></rule>
- <rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"><priority>1</priority></rule>
- <rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"><priority>1</priority></rule>
- <rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"><priority>1</priority></rule>
- <rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"><priority>3</priority></rule>
- <rule ref="rulesets/strictexception.xml/AvoidRethrowingException"><priority>2</priority></rule>
- <rule ref="rulesets/strictexception.xml/DoNotExtendJavaLangError"><priority>1</priority></rule>
- <rule ref="rulesets/strictexception.xml/DoNotThrowExceptionInFinally"><priority>1</priority></rule>
- <rule ref="rulesets/strictexception.xml/AvoidThrowingNewInstanceOfSameException"><priority>1</priority></rule>
-
- <rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"><priority>3</priority></rule>
- <rule ref="rulesets/strings.xml/StringInstantiation"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/StringToString"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/InefficientStringBuffering"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/UnnecessaryCaseChange"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/UseStringBufferLength"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/AppendCharacterWithChar"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/UseIndexOfChar"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/InefficientEmptyStringCheck"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/InsufficientStringBufferDeclaration"><priority>3</priority></rule>
- <rule ref="rulesets/strings.xml/UselessStringValueOf"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/StringBufferInstantiationWithChar"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/UseEqualsToCompareStrings"><priority>1</priority></rule>
- <rule ref="rulesets/strings.xml/AvoidStringBufferField"><priority>2</priority></rule>
-
- <rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"><priority>3</priority></rule>
- <rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"><priority>3</priority></rule>
-
- <rule ref="rulesets/typeresolution.xml/LooseCoupling"><priority>2</priority></rule>
- <rule ref="rulesets/typeresolution.xml/CloneMethodMustImplementCloneable"><priority>3</priority></rule>
- <rule ref="rulesets/typeresolution.xml/UnusedImports"><priority>1</priority></rule>
- <rule ref="rulesets/typeresolution.xml/SignatureDeclareThrowsException"><priority>1</priority></rule>
-
- <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"><priority>1</priority></rule>
- <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"><priority>1</priority></rule>
- <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"><priority>1</priority></rule>
- <rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"><priority>1</priority></rule>
-
- </ruleset>
|