vishesh92 commented on code in PR #13168: URL: https://github.com/apache/cloudstack/pull/13168#discussion_r3266052961
########## tools/checkstyle/src/main/resources/cloud-pmd.xml: ########## @@ -23,59 +23,88 @@ xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"> <description> - Ruleset that brings all the rulesets we want from the pmd jar, because - the maven-pmd-plugin doesn't find them otherwise. This is also the place - to add our own future rulesets, if any. + CloudStack PMD ruleset. Enables all PMD 7 categories with + project-specific exclusions for rules that are too noisy + or incompatible with CloudStack conventions. </description> - <rule ref="category/java/basic.xml"/> - <rule ref="category/java/braces.xml"/> - <rule ref="category/java/clone.xml"/> - <rule ref="category/java/codesize.xml"/> - <rule ref="category/java/comments.xml"> - <!-- We shouldn't limit the number of lines in the header of a class --> - <exclude name="CommentSize"/> - <exclude name="CommentRequired" /> + <rule ref="category/java/bestpractices.xml"> + <exclude name="AbstractClassWithoutAbstractMethod" /> + <exclude name="GuardLogStatement" /> + <!-- <exclude name="LiteralsFirstInComparisons" /> --> + <!-- <exclude name="PreserveStackTrace" /> --> + <!-- <exclude name="AvoidReassigningParameters" /> --> + <!-- <exclude name="LooseCoupling" /> --> + <!-- <exclude name="UseCollectionIsEmpty" /> --> + <!-- <exclude name="MissingOverride" /> --> + <!-- <exclude name="UnusedAssignment" /> --> </rule> - <rule ref="category/java/controversial.xml"> - <!-- The rule is good, but is not properly applied. It forces you to statically declare it as ConcurrentHashMap --> - <exclude name="UseConcurrentHashMap"/> - <exclude name="CallSuperInConstructor"/> - <exclude name="AtLeastOneConstructor"/> - <exclude name="AssignmentInOperand"/> - <exclude name="NullAssignment"/> - <exclude name="DataflowAnomalyAnalysis" /> - <exclude name="UseObjectForClearerAPI" /> + + <rule ref="category/java/codestyle.xml"> + <exclude name="ShortVariable" /> + <exclude name="AtLeastOneConstructor" /> + <exclude name="CallSuperInConstructor" /> + <!-- <exclude name="LocalVariableCouldBeFinal" /> + <exclude name="MethodArgumentCouldBeFinal" /> --> + <!-- <exclude name="OnlyOneReturn" /> --> + <!-- <exclude name="CommentDefaultAccessModifier" /> --> + <!-- <exclude name="FieldNamingConventions" /> --> + <!-- <exclude name="UseDiamondOperator" /> --> + <!-- <exclude name="UselessParentheses" /> --> + <!-- <exclude name="PrematureDeclaration" /> --> + <!-- <exclude name="UnnecessaryBoxing" /> --> + <!-- <exclude name="ControlStatementBraces" /> --> + <!-- <exclude name="FieldDeclarationsShouldBeAtStartOfClass" /> --> + <!-- <exclude name="ConfusingTernary" /> --> + <!-- <exclude name="UnnecessaryFullyQualifiedName" /> --> + <!-- <exclude name="LocalVariableNamingConventions" /> --> + <!-- <exclude name="UnnecessaryModifier" /> --> + <exclude name="LongVariable" /> </rule> - <rule ref="category/java/coupling.xml"> + + <rule ref="category/java/design.xml"> <exclude name="ExcessiveImports" /> <exclude name="LawOfDemeter"/> + <!-- <exclude name="CyclomaticComplexity" /> --> + <!-- <exclude name="CognitiveComplexity" /> --> + <!-- <exclude name="NPathComplexity" /> --> + <!-- <exclude name="AvoidCatchingGenericException" /> --> + <!-- <exclude name="AvoidUncheckedExceptionsInSignatures" /> --> + <!-- <exclude name="ImmutableField" /> --> + <!-- <exclude name="NcssCount" /> --> + <!-- <exclude name="CollapsibleIfStatements" /> --> + <!-- <exclude name="MutableStaticState" /> + <exclude name="CouplingBetweenObjects" /> + <exclude name="TooManyMethods" /> + <exclude name="GodClass" /> --> </rule> - <rule ref="category/java/design.xml"> + + <rule ref="category/java/documentation.xml"> + <exclude name="CommentSize" /> + <exclude name="CommentRequired" /> + </rule> + + <rule ref="category/java/errorprone.xml"> Review Comment: pmd checks are manual as of now, so it shouldn't break anything. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
