Package net.sourceforge.pmd.lang.java.rule.codestyle
-
Class Summary Class Description AtLeastOneConstructorRule This rule detects non-static classes with no constructors; requiring even the default constructor to be explicit.AvoidDollarSignsRule ClassNamingConventionsRule Configurable naming conventions for type declarations.CommentDefaultAccessModifierRule Check for Methods, Fields and Nested Classes that have a default access modifierConfusingTernaryRule if (x != y) { diff(); } else { same(); }
and
(!x ? diff() : same());
DontImportJavaLangRule DuplicateImportsRule FieldDeclarationsShouldBeAtStartOfClassRule Detects fields that are declared after methods, constructors, etc.IdenticalCatchBranchesRule Flags identical catch branches, which can be collapsed into a multi-catch.LocalVariableCouldBeFinalRule MethodArgumentCouldBeFinalRule MethodNamingConventionsRule OnlyOneReturnRule PrematureDeclarationRule Checks for variables in methods that are defined before they are really needed.UnnecessaryAnnotationValueElementRule UnnecessaryConstructorRule This rule detects when a constructor is not necessary; i.e., when there is only one constructor, it’s public, has an empty body, and takes no arguments.UnnecessaryFullyQualifiedNameRule UnnecessaryLocalBeforeReturnRule UnnecessaryModifierRule UnnecessaryReturnRule VariableNamingConventionsRule