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