List of Java inspections
Last modified: 02 August 2022Arquillian
Inspection name | Default state | Default severity |
---|---|---|
Arquillian test class should be properly prepared |
|
|
Arquillian test class should have method with |
|
|
Arquillian test class should have only one method with |
|
|
Wrong return type of |
|
|
Wrong signature of |
|
|
Abstraction issues
Inspection name | Default state | Default severity |
---|---|---|
Cast to a concrete class |
|
|
Chain of |
|
|
Class references one of its subclasses |
|
|
Feature envy |
|
|
|
|
|
|
|
|
Interface method clashes with method in |
|
|
Local variable of concrete class |
|
|
Magic number |
|
|
Method parameter to concrete class |
|
|
Method return of concrete class |
|
|
|
|
|
Overly strong type cast |
|
|
Private method only used from inner class |
|
|
|
|
|
|
|
|
Static field of concrete class |
|
|
Static member used only from one other class |
|
|
Type may be weakened |
|
|
Type of instance field is concrete class |
|
|
Assignment issues
Inspection name | Default state | Default severity |
---|---|---|
Assignment replaceable with operator assignment |
|
|
Assignment to |
|
|
Assignment to catch block parameter |
|
|
Assignment to lambda parameter |
|
|
Assignment to method parameter |
|
|
Assignment to static field from instance context |
|
|
Assignment used as condition |
|
|
Constructor assigns value to field defined in superclass |
|
|
|
|
|
Results of assignment used |
|
|
Value of ++ or -- used |
|
|
Bitwise operation issues
Inspection name | Default state | Default severity |
---|---|---|
Incompatible bitwise mask operation |
|
|
Pointless bitwise expression |
|
|
Shift operation by inappropriate constant |
|
|
Class metrics
Inspection name | Default state | Default severity |
---|---|---|
Anonymous inner class with too many methods |
|
|
Class too deep in inheritance tree |
|
|
Class with too many constructors |
|
|
Class with too many fields |
|
|
Class with too many methods |
|
|
Inner class too deeply nested |
|
|
Overly complex anonymous class |
|
|
Overly complex class |
|
|
Overly coupled class |
|
|
Class structure
Inspection name | Default state | Default severity |
---|---|---|
Abstract class may be interface |
|
|
Anonymous inner class |
|
|
Class may extend adapter instead of implementing listener |
|
|
Class name differs from file name |
|
|
Class with only |
|
|
Constant declared in abstract class |
|
|
Constant declared in interface |
|
|
Empty class |
|
|
Field can be local |
|
|
|
|
|
|
|
|
|
|
|
Inner class of interface |
|
|
Interface may be annotated |
|
|
Limited-scope inner class |
|
|
Marker interface |
|
|
Method returns per-class constant |
|
|
Multiple top level classes in single file |
|
|
Non-op method in abstract class |
|
|
Non- |
|
|
Non- |
|
|
Parameter can be local |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Singleton |
|
|
|
|
|
|
|
|
Utility class |
|
|
Utility class can be |
|
|
Utility class is not |
|
|
Utility class with |
|
|
Utility class without |
|
|
Inspections labeled with are not available in the editor and can be launched via Code | Inspect Code… or Code | Analyze Code | Run Inspection By Name....
Cloning issues
Inspection name | Default state | Default severity |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cloneable class without |
|
|
Use of |
|
|
Code maturity
Inspection name | Default state | Default severity |
---|---|---|
Call to |
|
|
Call to |
|
|
Deprecated API usage |
|
|
Deprecated method is still used |
|
|
Inspection suppression annotation |
|
|
|
|
|
Usage of API marked for removal |
|
|
Use of obsolete collection type |
|
|
Use of obsolete date-time API |
|
|
Use of System.out or System.err |
|
|
Code style issues
Inspection name | Default state | Default severity |
---|---|---|
Array can be replaced with enum values |
|
|
Array creation without |
|
|
|
|
|
Assignment can be joined with declaration |
|
|
Block marker comment |
|
|
C-style array declaration |
|
|
Call to |
|
|
Can use bounded wildcard |
|
|
Chained equality comparisons |
|
|
Chained method calls |
|
|
Class explicitly extends |
|
|
Code block contains single statement |
|
|
Conditional can be replaced with Optional |
|
|
Confusing octal escape sequence |
|
|
Constant expression can be evaluated |
|
|
Constant on the wrong side of comparison |
|
|
Control flow statement without braces |
|
|
Diamond can be replaced with explicit type arguments |
|
|
|
|
|
|
|
|
Field assignment can be moved to initializer |
|
|
Field can be |
|
|
If statement can be replaced with ?:, && or || expression |
|
|
Implicit call to |
|
|
Instance field access not qualified with |
|
|
Instance field access not qualified with |
|
|
Labeled switch rule can have code block |
|
|
Labeled switch rule has redundant code block |
|
|
Lambda body can be code block |
|
|
Lambda can be replaced with anonymous class |
|
|
Lambda parameter type can be specified |
|
|
|
|
|
Local variable or parameter can be final |
|
|
Method reference can be replaced with lambda |
|
|
Missorted modifiers |
|
|
Multi-catch can be split into separate catch blocks |
|
|
Multiple variables in one declaration |
|
|
Nested method call |
|
|
Null value for Optional type |
|
|
Objects.equals() can be replaced with equals() |
|
|
Optional can be replaced with sequence of if statements |
|
|
|
|
|
Optional.isPresent() can be replaced with functional-style expression |
|
|
Raw type can be generic |
|
|
Redundant |
|
|
Redundant field initialization |
|
|
Redundant interface declaration |
|
|
Redundant no-arg constructor |
|
|
|
|
|
Return of |
|
|
Simplifiable annotation |
|
|
Single-element annotation |
|
|
|
|
|
Standard Charset object can be used |
|
|
Stream API call chain can be replaced with loop |
|
|
Subsequent steps can be fused into Stream API chain |
|
|
|
|
|
Type parameter explicitly extends |
|
|
Unclear expression |
|
|
Unnecessarily qualified inner class access |
|
|
Unnecessarily qualified static access |
|
|
Unnecessarily qualified statically imported element |
|
|
Unnecessary |
|
|
Unnecessary |
|
|
Unnecessary |
|
|
Unnecessary |
|
|
Unnecessary call to |
|
|
Unnecessary call to |
|
|
Unnecessary code block |
|
|
Unnecessary conversion to String |
|
|
Unnecessary enum modifier |
|
|
Unnecessary fully qualified name |
|
|
Unnecessary interface modifier |
|
|
Unnecessary parentheses |
|
|
Unnecessary qualifier for |
|
|
Unnecessary semicolon |
|
|
Unqualified inner class access |
|
|
Unqualified static access |
|
|
Compiler issues
Inspection name | Default state | Default severity |
---|---|---|
Javac quirks |
|
|
Unchecked warning |
|
|
Concurrency annotation issues
Inspection name | Default state | Default severity |
---|---|---|
Instance member guarded by static field |
|
|
Non-final @GuardedBy field |
|
|
Non-final field in @Immutable class |
|
|
Static member guarded by instance filed or this |
|
|
Unguarded field access |
|
|
Unknown @GuardedBy field |
|
|
Control flow issues
Inspection name | Default state | Default severity |
---|---|---|
Assertion can be replaced with if statement |
|
|
Boolean expression could be replaced with conditional expression |
|
|
|
|
|
|
|
|
Conditional break inside infinite loop |
|
|
Conditional can be pushed inside branch expression |
|
|
Conditional expression (?:) |
|
|
Conditional expression with identical branches |
|
|
Conditional expression with negated condition |
|
|
Constant conditional expression |
|
|
|
|
|
|
|
|
|
|
|
Double negation |
|
|
Duplicate condition in |
|
|
Duplicate condition on |
|
|
Enum |
|
|
Fallthrough in |
|
|
|
|
|
|
|
|
Idempotent loop body |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Infinite loop statement |
|
|
Labeled statement |
|
|
Local variable used and declared in different |
|
|
Loop statement that does not loop |
|
|
Loop variable not updated inside loop |
|
|
Loop with implicit termination condition |
|
|
Negated conditional expression |
|
|
Negated equality expression |
|
|
Nested |
|
|
Nested conditional expression |
|
|
Overly complex boolean expression |
|
|
Pointless |
|
|
Pointless boolean expression |
|
|
Redundant |
|
|
Redundant |
|
|
Redundant conditional expression |
|
|
Simplifiable boolean expression |
|
|
Simplifiable conditional expression |
|
|
Statement can be replaced with |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unnecessary |
|
|
Data flow
Inspection name | Default state | Default severity |
---|---|---|
Boolean method is always inverted |
|
|
Boolean variable is always inverted |
|
|
Method call violates Law of Demeter |
|
|
Negatively named boolean variable |
|
|
Redundant local variable |
|
|
Reuse of local variable |
|
|
Scope of variable is too broad |
|
|
Use of variable whose value is known to be constant |
|
|
Declaration redundancy
Inspection name | Default state | Default severity |
---|---|---|
Access static member via instance reference |
|
|
Actual method parameter is the same constant |
|
|
Collector can be simplified |
|
|
Declaration access can be weaker |
|
|
Declaration can have final modifier |
|
|
Default annotation parameter value |
|
|
Duplicate throws |
|
|
Empty method |
|
|
Functional expression can be folded |
|
|
Method can be void |
|
|
Method returns the same value |
|
|
Null-check method is called with obviously non-null argument |
|
|
Optional call chain can be simplified |
|
|
Redundant |
|
|
Redundant |
|
|
Redundant |
|
|
Redundant lambda parameter types |
|
|
Redundant operation on empty container |
|
|
Redundant step in Stream or Optional call chain |
|
|
Stream API call chain can be simplified |
|
|
Trivial usage of functional expression |
|
|
Unnecessary module dependency |
|
|
Unused declaration |
|
|
Unused label |
|
|
Variable is assigned to itself |
|
|
Wrapper type may be primitive |
|
|
Inspections labeled with are not available in the editor and can be launched via Code | Inspect Code… or Code | Analyze Code | Run Inspection By Name....
Dependency issues
Inspection name | Default state | Default severity |
---|---|---|
Class with too many dependencies |
|
|
Class with too many dependents |
|
|
Class with too many transitive dependencies |
|
|
Class with too many transitive dependents |
|
|
Cyclic class dependency |
|
|
Cyclic package dependency |
|
|
Illegal package dependencies |
|
|
Suspicious package-private access |
|
|
Inspections labeled with are not available in the editor and can be launched via Code | Inspect Code… or Code | Analyze Code | Run Inspection By Name....
Encapsulation
Inspection name | Default state | Default severity |
---|---|---|
Accessing a non-public field of another object |
|
|
Assignment or return of field with mutable type |
|
|
Package-visible field |
|
|
Package-visible nested class |
|
|
Protected field |
|
|
Protected nested class |
|
|
|
|
|
|
|
|
Error handling
Inspection name | Default state | Default severity |
---|---|---|
Catch block may ignore exception |
|
|
Caught exception is immediately rethrown |
|
|
Checked exception class |
|
|
Class directly extends |
|
|
|
|
|
Empty |
|
|
Empty |
|
|
Exception constructor called without arguments |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Nested |
|
|
Non-final field of exception class |
|
|
|
|
|
Overly broad |
|
|
Overly broad |
|
|
Prohibited exception caught |
|
|
Prohibited exception declared |
|
|
Prohibited exception thrown |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unchecked exception class |
|
|
Unchecked exception declared in |
|
|
Unnecessary call to |
|
|
Finalization
Inspection name | Default state | Default severity |
---|---|---|
|
|
|
|
|
|
|
|
|
General
Inspection name | Default state | Default severity |
---|---|---|
Test-only class or method call in production code |
|
|
Imports
Inspection name | Default state | Default severity |
---|---|---|
|
|
|
Import from same package |
|
|
|
|
|
Single class import |
|
|
Static import |
|
|
Unused import |
|
|
Inheritance issues
Inspection name | Default state | Default severity |
---|---|---|
Abstract class extends concrete class |
|
|
Abstract class which has no concrete subclass |
|
|
Abstract class without abstract methods |
|
|
Abstract method overrides abstract method |
|
|
Abstract method overrides concrete method |
|
|
Abstract method with missing implementations |
|
|
Class explicitly extends a Collection class |
|
|
Class extends annotation interface |
|
|
Class extends utility class |
|
|
Class may extend a commonly used base class |
|
|
Final declaration can't be overridden at runtime |
|
|
Interface which has no concrete subclass |
|
|
Method does not call super method |
|
|
Method is identical to its super method |
|
|
Missing @Override annotation |
|
|
Non-varargs method overrides varargs method |
|
|
Parameter type prevents overriding |
|
|
|
|
|
Static inheritance |
|
|
Type parameter extends final class |
|
|
Initialization
Inspection name | Default state | Default severity |
---|---|---|
Abstract method called during object construction |
|
|
Double brace initialization |
|
|
Instance field may not be initialized |
|
|
Instance field used before initialization |
|
|
Non-final static field is used during class initialization |
|
|
Overridable method called during object construction |
|
|
Overridden method called during object construction |
|
|
Static field may not be initialized |
|
|
Static field used before initialization |
|
|
|
|
|
Unsafe lazy initialization of |
|
|
Internationalization
Inspection name | Default state | Default severity |
---|---|---|
Absolute alignment used in AWT/Swing code |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to Numeric |
|
|
Call to suspicious String method |
|
|
Character comparison |
|
|
Duplicate string literal |
|
|
Hard coded strings |
|
|
Implicit usage of platformcodes default charset |
|
|
Incorrect string capitalization |
|
|
Instantiating a SimpleDateFormat without a Locale |
|
|
Magic character |
|
|
String concatenation |
|
|
Unnecessary unicode escape sequence |
|
|
Use of StringTokenizer |
|
|
J2ME issues
Inspection name | Default state | Default severity |
---|---|---|
Abstract class which has only one direct inheritor |
|
|
Array.length in loop condition |
|
|
Connection opened but not safely closed |
|
|
Interface which has only one direct inheritor |
|
|
Large array allocation with no OutOfMemoryError check |
|
|
Method call in loop condition |
|
|
Multiply or divide by power of two |
|
|
Overly large initializer for array of primitive type |
|
|
RecordStore opened but not safely closed |
|
|
Single character |
|
|
Synthetic accessor call |
|
|
Java language level
Inspection name | Default state | Default severity |
---|---|---|
Annotation |
|
|
Annotation class |
|
|
|
|
|
Auto-boxing |
|
|
Auto-unboxing |
|
|
Enumerated class |
|
|
Extended |
|
|
Use of |
|
|
Use of |
|
|
Varargs method |
|
|
Java language level migration aids
Inspection name | Default state | Default severity |
---|---|---|
|
|
|
Enumeration can be iteration |
|
|
|
|
|
Usages of API which isn't available at the configured language level |
|
|
|
|
|
Collections.EMPTY_* field access replaceable with |
|
|
|
|
|
|
|
|
Method can be varargs method |
|
|
Raw use of parameterized class |
|
|
|
|
|
Unnecessary boxing |
|
|
Unnecessary unboxing |
|
|
|
|
|
|
|
|
Explicit type can be replaced with <> |
|
|
Identical |
|
|
Possible heap pollution from parameterized vararg type |
|
|
|
|
|
Anonymous type can be replaced with lambda |
|
|
Anonymous type can be replaced with method reference |
|
|
Anonymous type has shorter lambda alternative |
|
|
Collections.sort() can be replaced with List.sort() |
|
|
Comparator combinator can be used |
|
|
Expression can be folded into Stream chain |
|
|
forEach call can be simplified |
|
|
Guava's functional primitives can be replaced by Java |
|
|
Lambda can be replaced with method call |
|
|
Lambda can be replaced with method reference |
|
|
Loop can be collapsed with Stream API |
|
|
Loop can be replaced with Collection.removeIf() |
|
|
Map.forEach can be used |
|
|
Pseudo functional expression using static class |
|
|
Single Map method can be used |
|
|
Statement lambda can be replaced with expression lambda |
|
|
JavaBeans issues
Inspection name | Default state | Default severity |
---|---|---|
Class without constructor |
|
|
Class without no-arg constructor |
|
|
Field has setter but no getter |
|
|
Property value set to itself |
|
|
Suspicious getter/setter |
|
|
JavaDoc
Inspection name | Default state | Default severity |
---|---|---|
<code>...</code> can be replaced with {@code ...} |
|
|
Dangling Javadoc comment |
|
|
Declaration has Javadoc problems |
|
|
Declaration has problems in Javadoc references |
|
|
HTML problems in Javadoc (DocLint) |
|
|
Missing |
|
|
Missing @Deprecated annotation |
|
|
|
|
|
|
|
|
Unnecessary Javadoc link |
|
|
Unnecessary {@inheritDoc} Javadoc comment |
|
|
JUnit
Inspection name | Default state | Default severity |
---|---|---|
|
|
|
|
|
|
|
|
|
Assertion expression can be replaced with |
|
|
Constant JUnit assert argument |
|
|
Expected exception never thrown in test method body |
|
|
Highlight problem line in test |
|
|
JUnit test annotated with |
|
|
JUnit test method in product source |
|
|
JUnit test method without any assertions |
|
|
JUnit TestCase in product source |
|
|
JUnit TestCase with non-trivial constructors |
|
|
JUnit 4 test can be JUnit 5 |
|
|
JUnit 4 test method in class extending JUnit 3 TestCase |
|
|
JUnit 5 malformed @Nested class |
|
|
JUnit 5 malformed parameterized test |
|
|
JUnit 5 malformed repeated test |
|
|
Malformed |
|
|
Malformed @Before or @After method |
|
|
Malformed @BeforeClass/@BeforeAll or @AfterClass/@AfterAll method |
|
|
Malformed @DataPoint field |
|
|
Malformed @Rule/@ClassRule field |
|
|
Malformed test method |
|
|
Message missing on JUnit assertion |
|
|
Misordered |
|
|
Multiple exceptions declared on test method |
|
|
Obsolete assertions in JUnit 5 tests |
|
|
Old style JUnit test method in JUnit 4 class |
|
|
@RunWith(JUnitPlatform.class) without test methods |
|
|
@RunWith(Parameterized.class) without data provider |
|
|
Simplifiable JUnit assertion |
|
|
|
|
|
|
|
|
Test class with no tests |
|
|
Unconstructable JUnit TestCase |
|
|
Usage of obsolete |
|
|
Logging
Inspection name | Default state | Default severity |
---|---|---|
Class with multiple loggers |
|
|
Class without logger |
|
|
Log condition does not match logging call |
|
|
Logger initialized with foreign class |
|
|
Logging call not guarded by log condition |
|
|
Non-constant logger |
|
|
Non-constant string concatenation as argument to logging call |
|
|
Number of placeholders does not match number of arguments in logging call |
|
|
|
|
|
Memory
Inspection name | Default state | Default severity |
---|---|---|
Anonymous class may be a named |
|
|
Calls to |
|
|
Inner class may be |
|
|
Return of instance of anonymous, local or inner class |
|
|
Static collection |
|
|
StringBuilder field |
|
|
Unnecessary zero length array usage |
|
|
Zero-length array allocation |
|
|
Method metrics
Inspection name | Default state | Default severity |
---|---|---|
Constructor with too many parameters |
|
|
Method with more than three negations |
|
|
Method with multiple loops |
|
|
Method with multiple return points |
|
|
Method with too many exceptions declared |
|
|
Method with too many parameters |
|
|
Overly complex method |
|
|
Overly coupled method |
|
|
Overly long lambda expression |
|
|
Overly long method |
|
|
Overly nested method |
|
|
Modularization issues
Inspection name | Default state | Default severity |
---|---|---|
Class independent of its module |
|
|
Class only used from one other module |
|
|
Inconsistent language level settings |
|
|
Module with too few classes |
|
|
Module with too many classes |
|
|
Inspections labeled with are not available in the editor and can be launched via Code | Inspect Code… or Code | Analyze Code | Run Inspection By Name....
Naming conventions
Inspection name | Default state | Default severity |
---|---|---|
Boolean method name must start with question word |
|
|
Class name prefixed with package name |
|
|
Class name same as ancestor name |
|
|
Class naming convention |
|
|
Confusing |
|
|
Exception class name does not end with |
|
|
Field naming convention |
|
|
Java module naming conventions |
|
|
Lambda parameter naming convention |
|
|
Lambda-unfriendly method overload |
|
|
Local variable naming convention |
|
|
Method name same as class name |
|
|
Method name same as parent class name |
|
|
Method names differing only by case |
|
|
Method naming convention |
|
|
Method parameter naming convention |
|
|
Non-boolean method name must not start with question word |
|
|
Non-constant field with upper-case name |
|
|
Non-exception class name ends with |
|
|
Overloaded methods with same number of parameters |
|
|
Overloaded varargs method |
|
|
Package naming convention |
|
|
Parameter name differs from parameter in overridden method |
|
|
Questionable name |
|
|
Standard variable names |
|
|
Use of |
|
|
Numeric issues
Inspection name | Default state | Default severity |
---|---|---|
Call to |
|
|
|
|
|
Comparison of |
|
|
Comparison to Double.NaN or Float.NaN |
|
|
Confusing floating-point literal |
|
|
Constant call to |
|
|
Divide by zero |
|
|
|
|
|
|
|
|
Floating point equality comparison |
|
|
Implicit numeric conversion |
|
|
|
|
|
Integer division in floating point context |
|
|
Integer multiplication or shift implicitly cast to long |
|
|
|
|
|
Non-reproducible call to |
|
|
Number constructor call with primitive argument |
|
|
Numeric cast that loses precision |
|
|
Numeric overflow |
|
|
Octal and decimal integers in same array |
|
|
Octal integer |
|
|
Overly complex arithmetic expression |
|
|
Pointless arithmetic expression |
|
|
Suspicious test for oddness |
|
|
Suspicious underscore in number literal |
|
|
Unary plus |
|
|
Unnecessary explicit numeric cast |
|
|
Unnecessary unary minus |
|
|
Unpredictable BigDecimal constructor call |
|
|
Packaging issues
Inspection name | Default state | Default severity |
---|---|---|
Class independent of its package |
|
|
Class only used from one other package |
|
|
Empty directory |
|
|
Exception package |
|
|
Package with classes in multiple modules |
|
|
Package with disjoint dependency graph |
|
|
Package with too few classes |
|
|
Package with too many classes |
|
|
Inspections labeled with are not available in the editor and can be launched via Code | Inspect Code… or Code | Analyze Code | Run Inspection By Name....
Performance
Inspection name | Default state | Default severity |
---|---|---|
Boolean constructor call |
|
|
Boxing of already boxed value |
|
|
Bulk operation can be used instead of iteration |
|
|
Call to |
|
|
Call to simple getter from within class |
|
|
Call to simple setter from within class |
|
|
Class initializer may be |
|
|
|
|
|
Collection without initial capacity |
|
|
Concatenation with empty string |
|
|
Dynamic regular expression could be replaced by compiled Pattern |
|
|
|
|
|
|
|
|
Explicit argument can be lambda |
|
|
Field may be |
|
|
Inefficient Stream API call chains ending with count() |
|
|
Instantiating object to get Class object |
|
|
Iteration over |
|
|
|
|
|
Loop can be terminated after condition is met |
|
|
Manual array copy |
|
|
Manual array to collection copy |
|
|
Map or Set may contain |
|
|
Map replaceable with EnumMap |
|
|
Method may be |
|
|
Non-constant String should be StringBuilder |
|
|
Object allocation in loop |
|
|
Object instantiation inside |
|
|
Redundant |
|
|
Redundant call to |
|
|
Set replaceable with EnumSet |
|
|
Single character string argument in |
|
|
Single character string concatenation |
|
|
|
|
|
String concatenation as argument to |
|
|
String concatenation in loop |
|
|
|
|
|
StringBuilder without initial capacity |
|
|
Tail recursion |
|
|
Unnecessary temporary object in conversion from String |
|
|
Unnecessary temporary object in conversion to String |
|
|
Using |
|
|
Portability
Inspection name | Default state | Default severity |
---|---|---|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Hardcoded file separator |
|
|
Hardcoded line separator |
|
|
Native method |
|
|
Use of |
|
|
Use of AWT peer class |
|
|
Use of concrete JDBC driver class |
|
|
Use of sun.* classes |
|
|
Probable bugs
Nullability problems
Inspection name | Default state | Default severity |
---|---|---|
@NotNull field is not initialized |
|
|
@NotNull/@Nullable problems |
|
|
Return of |
|
|
Inspection name | Default state | Default severity |
---|---|---|
Array comparison using |
|
|
|
|
|
|
|
|
Call to |
|
|
Call to String.replaceAll(".", ...) |
|
|
Call to default |
|
|
Cast conflicts with |
|
|
Casting to incompatible interface |
|
|
Class.getClass() call |
|
|
Cleaner captures object reference |
|
|
Collection added to self |
|
|
Comparable implemented but |
|
|
Confusing argument to varargs method |
|
|
Confusing primitive array argument to varargs method |
|
|
Constant conditions & exceptions |
|
|
Contract issues |
|
|
Copy constructor misses field |
|
|
Covariant |
|
|
Duplicated delimiters in java.util.StringTokenizer |
|
|
Empty class initializer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Infinite recursion |
|
|
Inner class referenced via subclass |
|
|
|
|
|
Instantiation of utility class |
|
|
Invalid method reference used for Comparator |
|
|
Iterable is used as vararg |
|
|
|
|
|
|
|
|
Loop executes zero or billions times |
|
|
Magic Constant |
|
|
Malformed format string |
|
|
Malformed regular expression |
|
|
Malformed XPath expression |
|
|
|
|
|
Mismatched case in String operation |
|
|
Mismatched query and update of StringBuilder |
|
|
Mismatched query and update of collection |
|
|
Mismatched read and write of array |
|
|
New object is compared using |
|
|
Non-final field referenced in |
|
|
Non-final field referenced in |
|
|
Non-final field referenced in |
|
|
Non-short-circuit boolean expression |
|
|
Non-short-circuit operation consumes the infinite stream |
|
|
Number comparison using |
|
|
Object comparison using |
|
|
|
|
|
Optional.get() is called without isPresent() check |
|
|
Overwritten Map key or Set element |
|
|
Reference checked for |
|
|
Reflective access to a source-only annotation |
|
|
Result of method call ignored |
|
|
Result of object allocation ignored |
|
|
Sorted collection with non-comparable elements |
|
|
Statement with empty body |
|
|
Static field referenced via subclass |
|
|
Static method referenced via subclass |
|
|
|
|
|
String comparison using |
|
|
String concatenation as argument to |
|
|
String concatenation as argument to |
|
|
String literal concatenation missing whitespace |
|
|
StringBuilder constructor call with |
|
|
Subtraction in |
|
|
Suspicious |
|
|
Suspicious |
|
|
Suspicious |
|
|
Suspicious |
|
|
Suspicious Arrays method calls |
|
|
Suspicious array cast |
|
|
Suspicious collections method calls |
|
|
Suspicious indentation after control statement without braces |
|
|
Suspicious integer division assignment |
|
|
Suspicious usage of compare method |
|
|
Suspicious variable/parameter name combination |
|
|
Text label in |
|
|
Throwable not thrown |
|
|
Unsafe call to |
|
|
Unused assignment |
|
|
Use of Properties object as a Hashtable |
|
|
Use of index 0 in JDBC ResultSet |
|
|
Wrong package statement |
|
|
Properties Files
Inspection name | Default state | Default severity |
---|---|---|
Invalid property key |
|
|
Reflective access
Inspection name | Default state | Default severity |
---|---|---|
MethodHandle/VarHandle type mismatch |
|
|
Non-runtime annotation to be used by reflection |
|
|
Reflective access across modules issues |
|
|
Reflective access to nonexistent/not visible class member |
|
|
Reflective invocation arguments mismatch |
|
|
Resource management
Inspection name | Default state | Default severity |
---|---|---|
Channel opened but not safely closed |
|
|
Hibernate resource opened but not safely closed |
|
|
I/O resource opened but not safely closed |
|
|
JDBC resource opened but not safely closed |
|
|
JNDI resource opened but not safely closed |
|
|
Socket opened but not safely closed |
|
|
Use of DriverManager to get JDBC connection |
|
|
Security
Inspection name | Default state | Default severity |
---|---|---|
Access of system properties |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
ClassLoader instantiation |
|
|
Cloneable class in secure context |
|
|
Custom ClassLoader |
|
|
Custom SecurityManager |
|
|
Design for extension |
|
|
Insecure random number generation |
|
|
Non- |
|
|
Non-final |
|
|
|
|
|
|
|
|
Serializable class in secure context |
|
|
Serialization issues
Inspection name | Default state | Default severity |
---|---|---|
Comparator class not declared Serializable |
|
|
Externalizable class with |
|
|
Externalizable class without |
|
|
Instance field may not be initialized by |
|
|
Non-serializable class with |
|
|
Non-serializable class with |
|
|
Non-serializable field in a Serializable class |
|
|
Non-serializable object bound to HttpSession |
|
|
Non-serializable object passed to ObjectOutputStream |
|
|
|
|
|
|
|
|
Serializable class with unconstructable ancestor |
|
|
Serializable class without |
|
|
Serializable class without |
|
|
Serializable non- |
|
|
Serializable non- |
|
|
Serializable object implicitly stores non-Serializable object |
|
|
|
|
|
|
|
|
Transient field in non-serializable class |
|
|
Transient field is not initialized on deserialization |
|
|
TestNG
Inspection name | Default state | Default severity |
---|---|---|
|
|
|
Constant TestNG assert argument |
|
|
Data provider problems |
|
|
|
|
|
Duplicated data provider names |
|
|
Expected exception never thrown in test method body |
|
|
Groups problem |
|
|
Invalid data provider return type |
|
|
JUnit Test can be converted to TestNG |
|
|
Message missing on TestNG assertion |
|
|
Misordered |
|
|
Old TestNG annotation @Configuration is used |
|
|
Simplifiable TestNG assertion |
|
|
TestNG Javadoc can be converted to annotations |
|
|
Undeclared test |
|
|
Threading issues
Inspection name | Default state | Default severity |
---|---|---|
Access to static field locked on instance data |
|
|
AtomicFieldUpdater field not declared |
|
|
AtomicFieldUpdater issues |
|
|
|
|
|
|
|
|
Busy wait |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to |
|
|
Call to a native method while locked |
|
|
Class directly extends |
|
|
Double-checked locking |
|
|
Empty |
|
|
Field accessed in both synchronized and unsynchronized contexts |
|
|
Instantiating a Thread with default |
|
|
Lock acquired but not safely unlocked |
|
|
Method with synchronized block could be synchronized method |
|
|
Nested |
|
|
Non-atomic operation on volatile field |
|
|
Non-private field accessed in synchronized context |
|
|
Non thread-safe static field access |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Static initializer references subclass |
|
|
Synchronization on |
|
|
Synchronization on |
|
|
Synchronization on |
|
|
Synchronization on a Lock object |
|
|
Synchronization on a non-final field |
|
|
Synchronization on an object initialized with a literal |
|
|
Synchronization on local variable or method parameter |
|
|
|
|
|
ThreadLocal field not declared static final |
|
|
|
|
|
Unconditional |
|
|
Unsynchronized method overrides synchronized method |
|
|
Volatile array field |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toString() issues
Inspection name | Default state | Default severity |
---|---|---|
Class does not override |
|
|
Field not used in |
|
|
Verbose or redundant code constructs
Inspection name | Default state | Default severity |
---|---|---|
Comparator can be simplified |
|
|
Condition is covered by further condition |
|
|
Duplicate branches in |
|
|
Excessive lambda usage |
|
|
Excessive range check |
|
|
Explicit array filling |
|
|
Manual min/max calculation |
|
|
Multiple occurrences of the same expression |
|
|
Redundant |
|
|
Redundant |
|
|
Redundant Collection operation |
|
|
Redundant String operation |
|
|
Redundant array creation |
|
|
Redundant type arguments |
|
|
Redundant type cast |
|
|
|
|
|
Too weak variable type leads to unnecessary cast |
|
|
Unnecessary |
|
|
Unnecessary |
|
|
Unnecessary |
|
|
Unnecessarily escaped character |
|
|
Unnecessary |
|
|
Unnecessary label on |
|
|
Unnecessary label on |
|
|
Visibility
Inspection name | Default state | Default severity |
---|---|---|
Access of inherited field looks like access of element in surrounding code |
|
|
Anonymous class variable hides variable in containing method |
|
|
Call to inherited method looks like call to local method |
|
|
Field name hides field in superclass |
|
|
Inner class field hides outer class field |
|
|
Lambda parameter hides field |
|
|
Local variable hides field |
|
|
Method overloads method of superclass |
|
|
Method overrides inaccessible method of superclass |
|
|
Method tries to override static method of superclass |
|
|
Module exports/opens package to itself |
|
|
Non-accessible class is exposed |
|
|
Parameter hides field |
|
|
Type parameter hides visible type |
|
|
Usage of service not declared in |
|
|
Thanks for your feedback!