Basic Java practices - provided by CheckStyle
AvoidStarImport
Check that finds import statements that use the * notation.
AvoidStaticImport
Check that finds static imports.
EqualsHashCode
Checks that classes that override equals() also override hashCode().
DefaultComesLast
Check that the default is after all the cases in a switch statement.
EqualsAvoidNull
Checks that any combination of String literals with optional assignment is on the left side of an equals() comparison.
UnusedImports
Checks for unused import statements.
FinalClass
Checks that class which has only private ctors is declared as final.
FinalLocalVariable
Ensures that local variables that never get their values changed, must be declared final.
AvoidNestedBlocks
Finds nested blocks.
MultipleVariableDeclarations
Checks that each variable declaration is in its own statement and on its own line.
ImportControl
Check that controls what packages can be imported in each package.
ImportOrder
Ensures that groups of imports come in a specific order.
ModifierOrder
Checks that the order of modifiers conforms to the suggestions in the Java Language specification
MissingSwitchDefault
Checks that switch statement has "default" clause.
DesignForExtension
Checks that classes are designed for inheritance.
VisibilityModifier
Checks visibility of class members.
PackageDeclaration
Ensures there is a package declaration and (optionally) in the correct directory.
RedundantImport
Checks for imports that are redundant.
StringLiteralEquality
Checks that string literals are not used with == or !=.
CovariantEquals
Checks that classes that define a covariant equals() method also override method equals(java.lang.Object)
ExplicitInitialization
Checks
if any class or object member explicitly initialized to default for its
type value (null for object references, zero for numeric types and char
and false for boolean.
FallThrough
Checks
for fall through in switch statements Finds locations where a case
contains Java code - but lacks a break, return, throw or continue
statement.
HiddenField
Checks that a local variable or a parameter does not shadow a field that is defined in the same class.
MissingCtor
Checks that classes (except abstract one) define a constructor and don't rely on the default one.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.