Rule Description KPI url
ExtendsObject No need to explicitly extend Object. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
DontCallThreadRun Explicitly calling Thread.run() method will execute in the caller’s thread of control. Instead, call Thread.start() for the intended behavior. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
CommentRequired Denotes whether comments are required (or unwanted) for specific language elements. Maintainability https://pmd.github.io/pmd/pmd_rules_java.html
CommentSize Determines whether the dimensions of non-header comments found are within the specified limits. Maintainability https://pmd.github.io/pmd/pmd_rules_java.html
CommentContent A rule for the politically correct… we don’t want to offend anyone. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
DontImportSun Avoid importing anything from the ‘sun.*’ packages. These packages are not portable and are likely to change. Portability https://pmd.github.io/pmd/pmd_rules_java.html
UnnecessaryParentheses Sometimes expressions are wrapped in unnecessary parentheses, making them look like function calls. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
DataflowAnomalyAnalysis The dataflow analysis tracks local definitions, undefinitions and references to variables on different paths on the data flow. From those informations there can be found various problems. (1.) UR – Anomaly: There is a reference to a variable that was not defined before. This is a bug and leads to an error. (2.) DU – Anomaly: A recently defined variable is undefined. These anomalies may appear in normal source text. (3.) DD – Anomaly: A recently defined variable is redefined. This is ominous but don’t have to be a bug. Maintainability https://pmd.github.io/pmd/pmd_rules_java.html
OneDeclarationPerLine Java allows the use of several variables declaration of the same type on one line. However, it can lead to quite messy code. This rule looks for several declarations on the same line. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
AvoidPrefixingMethodParameters Prefixing parameters by ‘in’ or ‘out’ pollutes the name of the parameters and reduces code readability. To indicate whether or not a parameter will be modify in a method, its better to document method behavior with Javadoc. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
ConfusingTernary Avoid negation within an “if” expression with an “else” clause. For example, rephrase: if (x != y) diff(); else same(); as: if (x == y) same(); else diff(); Most “if (x != y)” cases without an “else” are often return cases, so consistent use of this rule makes the code easier to read. Also, this resolves trivial ordering problems, such as “does the error case go first?” or “does the common case go first?”. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
InstantiationToGetClass Avoid instantiating an object just to call getClass() on it; use the .class public member instead. Resource Utilization https://pmd.github.io/pmd/pmd_rules_java.html
UnnecessaryLocalBeforeReturn Avoid the creation of unnecessary local variables Understandability https://pmd.github.io/pmd/pmd_rules_java.html
UseVarargs Java 5 introduced the varargs parameter declaration for methods and constructors. This syntactic sugar provides flexibility for users of these methods and constructors, allowing them to avoid having to deal with the creation of an array. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
DuplicateImports Duplicate or overlapping import statements should be avoided. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
DontImportJavaLang Avoid importing anything from the package ‘java.lang’. These classes are automatically imported (JLS 7.5.3). Understandability https://pmd.github.io/pmd/pmd_rules_java.html
UnusedImports Avoid the use of unused import statements to prevent unwanted dependencies. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
UnnecessaryFullyQualifiedName Import statements allow the use of non-fully qualified names. The use of a fully qualified name which is covered by an import statement is redundant. Consider using the non-fully qualified name. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
MDBAndSessionBeanNamingConvention The EJB Specification states that any MessageDrivenBean or SessionBean should be suffixed by ‘Bean’. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
RemoteSessionInterfaceNamingConvention A Remote Home interface type of a Session EJB should be suffixed by ‘Home’. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
LocalInterfaceSessionNamingConvention The Local Interface of a Session EJB should be suffixed by ‘Local’. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
LocalHomeNamingConvention The Local Home interface of a Session EJB should be suffixed by ‘LocalHome’. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
RemoteInterfaceNamingConvention Remote Interface of a Session EJB should not have a suffix. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
InvalidSlf4jMessageFormat Check for invalid message format in slf4j loggers. Analyzability https://pmd.github.io/pmd/pmd_rules_java.html
BooleanGetMethodName Methods that return boolean results should be named as predicate statements to denote this. I.e, ‘isReady()’, ‘hasValues()’, ‘canCommit()’, ‘willFail()’, etc. Avoid the use of the ‘get’ prefix for these methods. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
ShortClassName Short Classnames with fewer than e.g. five characters are not recommended. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
GenericsNaming Names for references to generic values should be limited to a single uppercase letter. Understandability https://pmd.github.io/pmd/pmd_rules_java.html
StringBufferInstantiationWithChar Individual character values provided as initialization arguments will be converted into integers. This can lead to internal buffer sizes that are larger than expected. Efficiency https://pmd.github.io/pmd/pmd_rules_java.html
UselessParentheses Useless parentheses should be removed. Understandability https://pmd.github.io/pmd/pmd_rules_java.html