Class |
Description |
CompileStaticRule
|
Enforces classes are annotated either with one of the CompileStatic, GrailsCompileStatic or CompileDynamic
annotations |
ConfusingTernaryRule
|
In an "if" expression with an "else" clause, avoid negation in the test. |
CouldBeElvisRule
|
Catch an if block that could be written as an elvis expression. |
CouldBeSwitchStatementRule
|
Checks for multiple if statements that could be converted to a switch |
FieldTypeRequiredRule
|
Checks that field types are explicitly specified (and not using def) |
HashtableIsObsoleteRule
|
Check for direct use of Vector or java.util.Hashtable. |
IfStatementCouldBeTernaryRule
|
Checks for: |
ImplicitClosureParameterRule
|
Checks that the implicit it closure parameter is not used and that parameters are declared explicitly instead |
ImplicitReturnStatementRule
|
Checks for methods that are missing an explicit return statement.
|
InvertedConditionRule
|
An inverted condition is one where a constant expression is used on the left hand side of the equals comparision.
|
InvertedIfElseRule
|
An inverted if-else statement is one in which there is a single if statement with a single else branch and the
boolean test of the if is negated. |
LongLiteralWithLowerCaseLRule
|
In Java and Groovy, you can specify long literals with the L or l character, for instance 55L or
24l. |
MethodParameterTypeRequired
|
Checks that method parameters are not dynamically typed, that is they are explicitly stated and different than def.
|
MethodReturnTypeRequiredRule
|
Checks that method return types are not dynamic, that they are explicitly stated and different than def.
|
NoDefRule
|
Def keyword is overused and should be replaced with specific type.
|
NoDoubleRule
|
Checks for use of the double or Double types, in fields, variables, method parameters and method return types. |
NoFloatRule
|
Checks for use of the float or Float types, in fields, variables, method parameters and method return types. |
NoJavaUtilDateRule
|
Do not use java.util.Date. |
NoTabCharacterRule
|
Checks that all source files do not contain the tab character |
ParameterReassignmentRule
|
Checks for a method or closure parameter being reassigned to a new value within the body of the
method/closure, which is a confusing, questionable practice. |
PublicMethodsBeforeNonPublicMethodsRule
|
Enforce that all public methods are above protected and private methods. |
StaticFieldsBeforeInstanceFieldsRule
|
Enforce that all static fields are above all instance fields within a class |
StaticMethodsBeforeInstanceMethodsRule
|
Enforce that all static methods within each visibility level (public, protected, private) are above
all instance methods within that same visibility level. |
TernaryCouldBeElvisRule
|
Rule that checks for ternary expressions where the boolean and true expressions are the same.
|
TrailingCommaRule
|
Check whether list and map literals contain optional trailing comma. |
VariableTypeRequiredRule
|
Checks that variable types are explicitly specified in declarations (and not using def) |
VectorIsObsoleteRule
|
Check for direct use of Vector or java.util.Vector. |