Skip to content
Permalink
Browse files
Starting to update PMD ruleset
  • Loading branch information
coheigea committed Mar 27, 2019
1 parent 1b688ec commit 3e94769d52b3fbc8f0db9ccd5a97dc439ee2a1fc
Showing 2 changed files with 128 additions and 36 deletions.
@@ -75,7 +75,7 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>6.10.0</version>
<version>6.11.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
@@ -32,7 +32,133 @@
<exclude-pattern>.*.txt</exclude-pattern>
<exclude-pattern>.*NOTICE</exclude-pattern>

<rule ref="rulesets/java/basic.xml/BooleanInstantiation"/>
<rule ref="category/java/bestpractices.xml">
<exclude name="AbstractClassWithoutAbstractMethod" />
<exclude name="AccessorMethodGeneration" />
<exclude name="ArrayIsStoredDirectly" />
<exclude name="AvoidPrintStackTrace" />
<exclude name="AvoidReassigningParameters" />
<exclude name="AvoidStringBufferField" />
<exclude name="AvoidUsingHardCodedIP" />
<exclude name="ConstantsInInterface" />
<exclude name="GuardLogStatement" />
<exclude name="JUnitAssertionsShouldIncludeMessage" />
<exclude name="JUnitTestContainsTooManyAsserts" />
<exclude name="JUnitTestsShouldIncludeAssert" />
<exclude name="JUnitUseExpected"/>
<exclude name="MethodReturnsInternalArray" />
<exclude name="OneDeclarationPerLine" />
<exclude name="PreserveStackTrace" />
<exclude name="ReplaceEnumerationWithIterator" />
<exclude name="SwitchStmtsShouldHaveDefault" />
<exclude name="SystemPrintln" />
<exclude name="UseAssertSameInsteadOfAssertTrue" />
<exclude name="UseVarargs" />
</rule>

<rule ref="category/java/errorprone.xml">
<exclude name="AssignmentInOperand" />
<exclude name="AssignmentToNonFinalStatic" />
<exclude name="AvoidBranchingStatementAsLastInLoop" />
<exclude name="AvoidCatchingNPE" />
<exclude name="AvoidCatchingThrowable" />
<exclude name="AvoidDuplicateLiterals" />
<exclude name="AvoidFieldNameMatchingMethodName" />
<exclude name="AvoidLiteralsInIfCondition" />
<exclude name="BeanMembersShouldSerialize" />
<exclude name="CompareObjectsWithEquals" />
<exclude name="ConstructorCallsOverridableMethod" />
<exclude name="DataflowAnomalyAnalysis" />
<exclude name="DoNotCallSystemExit" />
<exclude name="EmptyCatchBlock" />
<exclude name="EmptyIfStmt" />
<exclude name="EmptySynchronizedBlock" />
<exclude name="MissingBreakInSwitch" />
<exclude name="MissingSerialVersionUID" />
<exclude name="MoreThanOneLogger" />
<exclude name="NullAssignment" />
<exclude name="ReturnEmptyArrayRatherThanNull" />
<exclude name="TestClassWithoutTestCases" />
<exclude name="UseLocaleWithCaseConversions" />
<exclude name="UseProperClassLoader" />
</rule>
<rule ref="category/java/multithreading.xml">
<exclude name="AvoidUsingVolatile" />
<exclude name="AvoidSynchronizedAtMethodLevel" />
<exclude name="AvoidThreadGroup" />
<exclude name="DoNotUseThreads" />
<exclude name="DontCallThreadRun" />
<exclude name="UseConcurrentHashMap" />
<exclude name="UseNotifyAllInsteadOfNotify" />
</rule>
<rule ref="category/java/performance.xml">
<exclude name="AvoidInstantiatingObjectsInLoops" />
<exclude name="AvoidFileStream" />
<exclude name="ConsecutiveLiteralAppends" />
</rule>
<rule ref="category/java/security.xml" />
<rule ref="category/java/design.xml" >
<exclude name="AvoidCatchingGenericException" />
<exclude name="AvoidDeeplyNestedIfStmts" />
<exclude name="AvoidThrowingNullPointerException" />
<exclude name="AvoidThrowingRawExceptionTypes" />
<exclude name="CouplingBetweenObjects" />
<exclude name="CyclomaticComplexity" />
<exclude name="DataClass" />
<exclude name="ExcessiveClassLength" />
<exclude name="ExcessiveImports" />
<exclude name="ExcessiveMethodLength" />
<exclude name="ExcessivePublicCount" />
<exclude name="GodClass" />
<exclude name="ImmutableField" />
<exclude name="LawOfDemeter" />
<exclude name="NcssCount" />
<exclude name="NPathComplexity" />
<exclude name="SignatureDeclareThrowsException" />
<exclude name="SingularField" />
<exclude name="SwitchDensity" />
<exclude name="TooManyFields" />
<exclude name="TooManyMethods" />
<exclude name="UseObjectForClearerAPI" />
<exclude name="UseUtilityClass" />
</rule>

<!-- Cleanup below -->

<!--<rule ref="rulesets/java/design.xml/AbstractClassWithoutAbstractMethod"/>-->
<!--<rule ref="rulesets/java/design.xml/AccessorClassGeneration"/>-->
<!--<rule ref="rulesets/java/design.xml/AssignmentToNonFinalStatic"/>-->
<!--<rule ref="rulesets/java/design.xml/AvoidDeeplyNestedIfStmts"/>-->
<!--<rule ref="rulesets/java/design.xml/AvoidInstanceofChecksInCatchClause"/>-->
<rule ref="rulesets/java/design.xml/AvoidProtectedFieldInFinalClass"/>
<!--<rule ref="rulesets/java/design.xml/AvoidReassigningParameters"/>-->
<!--<rule ref="rulesets/java/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
<!--<rule ref="rulesets/java/design.xml/BadComparison"/>-->
<!--<rule ref="rulesets/java/design.xml/CloseConnection"/>-->
<!--<rule ref="rulesets/java/design.xml/CompareObjectsWithEquals"/>-->
<!--<rule ref="rulesets/java/design.xml/ConfusingTernary"/>-->
<rule ref="rulesets/java/design.xml/ConstructorCallsOverridableMethod"/>
<!--<rule ref="rulesets/java/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
<!--<rule ref="rulesets/java/design.xml/FinalFieldCouldBeStatic"/>-->
<rule ref="rulesets/java/design.xml/IdempotentOperations"/>
<!--<rule ref="rulesets/java/design.xml/ImmutableField"/>-->
<!--<rule ref="rulesets/java/design.xml/InstantiationToGetClass"/>-->
<!--<rule ref="rulesets/java/design.xml/MissingBreakInSwitch"/>-->
<!--<rule ref="rulesets/java/design.xml/MissingStaticMethodInNonInstantiatableClass"/>-->
<!--<rule ref="rulesets/java/design.xml/NonCaseLabelInSwitchStatement"/>-->
<!--<rule ref="rulesets/java/design.xml/NonStaticInitializer"/>-->
<rule ref="rulesets/java/design.xml/PositionLiteralsFirstInComparisons"/>
<rule ref="rulesets/java/design.xml/SimplifyBooleanExpressions"/>
<rule ref="rulesets/java/design.xml/SimplifyBooleanReturns"/>
<rule ref="rulesets/java/design.xml/SimplifyConditional"/>
<!--<rule ref="rulesets/java/design.xml/SwitchDensity"/>-->
<!--<rule ref="rulesets/java/design.xml/SwitchStmtsShouldHaveDefault"/>-->
<rule ref="rulesets/java/design.xml/UnnecessaryLocalBeforeReturn"/>
<!--<rule ref="rulesets/java/design.xml/UseLocaleWithCaseConversions"/>-->
<!--<rule ref="rulesets/java/design.xml/UseNotifyAllInsteadOfNotify"/>-->
<!--<rule ref="rulesets/java/design.xml/UseUtilityClass"/>-->


<rule ref="rulesets/java/basic.xml/CollapsibleIfStatements"/>
<rule ref="rulesets/java/basic.xml/DoubleCheckedLocking"/>
<!--<rule ref="rulesets/java/empty.xml/EmptyCatchBlock"/>-->
@@ -86,40 +212,6 @@
<!--<rule ref="rulesets/java/coupling.xml/ExcessiveImports"/>-->
<!--<rule ref="rulesets/java/coupling.xml/LooseCoupling"/>-->

<!--<rule ref="rulesets/java/design.xml/AbstractClassWithoutAbstractMethod"/>-->
<!--<rule ref="rulesets/java/design.xml/AccessorClassGeneration"/>-->
<!--<rule ref="rulesets/java/design.xml/AssignmentToNonFinalStatic"/>-->
<!--<rule ref="rulesets/java/design.xml/AvoidDeeplyNestedIfStmts"/>-->
<!--<rule ref="rulesets/java/design.xml/AvoidInstanceofChecksInCatchClause"/>-->
<rule ref="rulesets/java/design.xml/AvoidProtectedFieldInFinalClass"/>
<!--<rule ref="rulesets/java/design.xml/AvoidReassigningParameters"/>-->
<!--<rule ref="rulesets/java/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
<!--<rule ref="rulesets/java/design.xml/BadComparison"/>-->
<!--<rule ref="rulesets/java/design.xml/CloseConnection"/>-->
<!--<rule ref="rulesets/java/design.xml/CompareObjectsWithEquals"/>-->
<!--<rule ref="rulesets/java/design.xml/ConfusingTernary"/>-->
<rule ref="rulesets/java/design.xml/ConstructorCallsOverridableMethod"/>
<!--<rule ref="rulesets/java/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
<!--<rule ref="rulesets/java/design.xml/FinalFieldCouldBeStatic"/>-->
<rule ref="rulesets/java/design.xml/IdempotentOperations"/>
<!--<rule ref="rulesets/java/design.xml/ImmutableField"/>-->
<!--<rule ref="rulesets/java/design.xml/InstantiationToGetClass"/>-->
<!--<rule ref="rulesets/java/design.xml/MissingBreakInSwitch"/>-->
<!--<rule ref="rulesets/java/design.xml/MissingStaticMethodInNonInstantiatableClass"/>-->
<!--<rule ref="rulesets/java/design.xml/NonCaseLabelInSwitchStatement"/>-->
<!--<rule ref="rulesets/java/design.xml/NonStaticInitializer"/>-->
<rule ref="rulesets/java/design.xml/OptimizableToArrayCall"/>
<rule ref="rulesets/java/design.xml/PositionLiteralsFirstInComparisons"/>
<rule ref="rulesets/java/design.xml/SimplifyBooleanExpressions"/>
<rule ref="rulesets/java/design.xml/SimplifyBooleanReturns"/>
<rule ref="rulesets/java/design.xml/SimplifyConditional"/>
<!--<rule ref="rulesets/java/design.xml/SwitchDensity"/>-->
<!--<rule ref="rulesets/java/design.xml/SwitchStmtsShouldHaveDefault"/>-->
<rule ref="rulesets/java/design.xml/UnnecessaryLocalBeforeReturn"/>
<!--<rule ref="rulesets/java/design.xml/UseLocaleWithCaseConversions"/>-->
<!--<rule ref="rulesets/java/design.xml/UseNotifyAllInsteadOfNotify"/>-->
<!--<rule ref="rulesets/java/design.xml/UseUtilityClass"/>-->

<!--<rule ref="rulesets/java/finalizers.xml/EmptyFinalizer"/>-->
<!--<rule ref="rulesets/java/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>-->
<!--<rule ref="rulesets/java/finalizers.xml/FinalizeOverloaded"/>-->

0 comments on commit 3e94769

Please sign in to comment.