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