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 @Deployment annotation | Enabled | Error |
Arquillian test class should have only one method with @Deployment annotation | Enabled | Error |
Wrong return type of @Deployment method | Enabled | Error |
Wrong signature of @Deployment method | Enabled | Error |
Abstraction issues
Inspection name | Default state | Default severity |
---|---|---|
Cast to a concrete class | Disabled | Warning |
Chain of instanceof checks | Disabled | Warning |
Class references one of its subclasses | Disabled | Warning |
Feature envy | Disabled | Warning |
instanceof a concrete class | Disabled | Warning |
instanceof check for this | Disabled | Warning |
Interface method clashes with method in java.lang.Object | 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 |
Optional used as field or parameter type | Enabled | Warning |
Overly strong type cast | Disabled | Warning |
Private method only used from inner class | Disabled | Warning |
public method not exposed in interface | Disabled | Warning |
public method with boolean parameter | 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 for loop parameter | 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 |
null assignment | 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 private constructors should be declared final | 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 |
final class | Disabled | Warning |
final method | Disabled | Warning |
final method in final class | Disabled | Warning |
Inner class of interface | Disabled | Warning |
Interface may be annotated @FunctionalInterface | 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- final field in enum | Disabled | Warning |
Non- static initializer | Disabled | Warning |
Parameter can be local | Enabled | Warning |
private method declared final | Enabled | Warning |
private method in final class | Disabled | Warning |
public constructor | Disabled | Warning |
public constructor in non-public class | Disabled | Warning |
Singleton | Disabled | Warning |
static , non- final field | Disabled | Warning |
static method declared final | Enabled | Warning |
Utility class | Disabled | Warning |
Utility class can be enum | Disabled | Warning |
Utility class is not final | Disabled | Warning |
Utility class with public constructor | Disabled | Warning |
Utility class without public constructor | 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 |
---|---|---|
clone() does not declare CloneNotSupportedException | Enabled | Warning |
clone() instantiates objects with constructor | Disabled | Warning |
clone() method in non-Cloneabe class | Disabled | Warning |
clone() method in non-Cloneabe class | Disabled | Warning |
clone() method not public | Disabled | Warning |
clone() should have return type equal to the class it contains | Disabled | Warning |
Cloneable class without clone() method | Disabled | Warning |
Use of clone() Cloneable | Disabled | Warning |
Code maturity
Inspection name | Default state | Default severity |
---|---|---|
Call to printStackTrace() | Disabled | Warning |
Call to Thread.dumpStack() | Disabled | Warning |
Deprecated API usage | Enabled | Warning |
Deprecated method is still used | Enabled | Warning |
Inspection suppression annotation | Disabled | Warning |
Throwable printed to System.out | 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 new expression | Enabled | No highlighting, only fix |
assert message is not a String | 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 String.concat() can be replaced with + | Disabled | Warning |
Can use bounded wildcard | Disabled | Warning |
Chained equality comparisons | Disabled | Warning |
Chained method calls | Disabled | Warning |
Class explicitly extends java.lang.Object | 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 |
equals() called on Enum value | Disabled | Warning |
expression.equals("literal") rather than "literal".equals(expression) | Disabled | Warning |
Field assignment can be moved to initializer | Enabled | No highlighting, only fix |
Field can be Final | Disabled | Warning |
If statement can be replaced with ?:, && or || expression | Enabled | No highlighting, only fix |
Implicit call to super() | Disabled | Warning |
Instance field access not qualified with this | Disabled | Warning |
Instance field access not qualified with this | 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 |
'List.indexOf()' expression is replaceable with contains() | 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 |
Optional contains array or collection | Disabled | Warning |
Optional.isPresent() can be replaced with functional-style expression | Enabled | Warning |
Raw type can be generic | Enabled | No highlighting, only fix |
Redundant new expression in constant array creation | Disabled | Warning |
Redundant field initialization | Disabled | Warning |
Redundant interface declaration | Disabled | Warning |
Redundant no-arg constructor | Disabled | Warning |
return separated from the result computation | Enabled | No highlighting, only fix |
Return of this | Disabled | Warning |
Simplifiable annotation | Disabled | Warning |
Single-element annotation | Enabled | No highlighting, only fix |
size() == 0 replaceable with isEmpty() | 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 |
try statement with multiple resources can be split | Enabled | No highlighting, only fix |
Type parameter explicitly extends java.lang.Object | 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 final on local variable or parameter | Disabled | Warning |
Unnecessary null check before equals() call | Disabled | Warning |
Unnecessary super qualifier | Disabled | Warning |
Unnecessary this qualifier | Disabled | Warning |
Unnecessary call to super() | Disabled | Warning |
Unnecessary call to toString() | 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 this or super | 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 |
break statement with label | Disabled | Warning |
break statement | 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 |
continue statement with label | Disabled | Warning |
continue statement | Disabled | Warning |
default not last case in switch statement | Disabled | Warning |
Double negation | Enabled | Warning |
Duplicate condition in if statement | Enabled | Warning |
Duplicate condition on && or || | Disabled | Warning |
Enum switch statement that misses case | Enabled | No highlighting, only fix |
Fallthrough in switch statement | Disabled | Warning |
for loop may be replaced with while loop | Enabled | No highlighting, only fix |
for loop with missing components | Disabled | Warning |
Idempotent loop body | Enabled | Warning |
if statement could be replaced with conditional expression | Disabled | Warning |
if statement with common parts | Enabled | Weak Warning |
if statement with negated condition | Disabled | Warning |
if statement with too many branches | Disabled | Warning |
Infinite loop statement | Enabled | Warning |
Labeled statement | Disabled | Warning |
Local variable used and declared in different switch branches | 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 switch | Disabled | Warning |
Nested conditional expression | Disabled | Warning |
Overly complex boolean expression | Disabled | Warning |
Pointless indexOf() comparison | Disabled | Warning |
Pointless boolean expression | Enabled | Warning |
Redundant else | Enabled | No highlighting, only fix |
Redundant if statement | Enabled | Warning |
Redundant conditional expression | Enabled | Warning |
Simplifiable boolean expression | Enabled | Warning |
Simplifiable conditional expression | Enabled | Warning |
Statement can be replaced with assert or Objects.requireNonNull | Enabled | No highlighting, only fix |
switch statement | Disabled | Warning |
switch statement with too few branches | Enabled | Warning |
switch statement with too low of a branch density | Disabled | Warning |
switch statement with too many branches | Disabled | Warning |
switch statement without default branch | Enabled | No highlighting, only fix |
Unnecessary null check before method call | 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 close() | Enabled | Warning |
Redundant requires statement in module-info | Enabled | Warning |
Redundant throws clause | 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 |
public field | Enabled | No highlighting, only fix |
public nested class | 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 java.lang.Throwable | Disabled | Warning |
continue or break inside finally block | Enabled | Warning |
Empty finally block | Enabled | Warning |
Empty try block | Enabled | Warning |
Exception constructor called without arguments | Disabled | Warning |
finally block which cannot complete normally | Enabled | Warning |
instanceof on catch parameter | Disabled | Warning |
java.lang.Error not rethrown | Disabled | Warning |
java.lang.ThreadDeath not rethrown | Disabled | Warning |
Nested try statement | Disabled | Warning |
Non-final field of exception class | Disabled | Warning |
null thrown | Disabled | Warning |
Overly broad catch block | Disabled | Warning |
Overly broad throws clause | Disabled | Warning |
Prohibited exception caught | Disabled | Warning |
Prohibited exception declared | Disabled | Warning |
Prohibited exception thrown | Disabled | Warning |
return inside finally block | Enabled | Warning |
throw caught by containing try statement | Disabled | Warning |
throw inside catch block which ignores the caught exception | Disabled | Warning |
throw inside finally block | Enabled | Warning |
Unchecked exception class | Disabled | Warning |
Unchecked exception declared in throws clause | Disabled | Warning |
Unnecessary call to Throwable.initCause() | Enabled | Warning |
Finalization
Inspection name | Default state | Default severity |
---|---|---|
finalize() called explicitly | Enabled | Warning |
finalize() declaration | Disabled | Warning |
finalize() not declared protected | 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 |
---|---|---|
* import | Disabled | Warning |
Import from same package | Disabled | Warning |
java.lang import | 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 |
public constructor in abstract class | 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 |
this reference escaped in object construction | Disabled | Warning |
Unsafe lazy initialization of static field | Disabled | Warning |
Internationalization
Inspection name | Default state | Default severity |
---|---|---|
Absolute alignment used in AWT/Swing code | Disabled | Warning |
Call to Date.toString() | Disabled | Warning |
Call to String.toUpperCase() or codetoLowerCase() without a Locale | Disabled | Warning |
Call to Time.toString() | Disabled | Warning |
Call to Numeric toString() | 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 startsWith() or codeendsWith() | Disabled | Warning |
Synthetic accessor call | Disabled | Warning |
Java language level
Inspection name | Default state | Default severity |
---|---|---|
Annotation | Disabled | Warning |
Annotation class | Disabled | Warning |
assert statement | Disabled | Warning |
Auto-boxing | Disabled | Warning |
Auto-unboxing | Disabled | Warning |
Enumerated class | Disabled | Warning |
Extended for statement | Disabled | Warning |
Use of assert as identifier | Disabled | Warning |
Use of enum as identifier | Disabled | Warning |
Varargs method | Enabled | No highlighting, only fix |
Java language level migration aids
Inspection name | Default state | Default severity |
---|---|---|
compare() method can be used to compare numbers | Enabled | Warning |
Enumeration can be iteration | Disabled | Warning |
if replaceable with switch | Enabled | Warning |
Usages of API which isn't available at the configured language level | Enabled | Error |
Java 5
BigDecimal legacy method called | Disabled | Warning |
Collections.EMPTY_* field access replaceable with Collections.empty*() method call | Disabled | Warning |
for loop replaceable with enhanced for loop | Enabled | Warning |
String.indexOf() expression is replaceable with contains() | Enabled | Warning |
Method can be varargs method | Enabled | No highlighting, only fix |
Raw use of parameterized class | Enabled | Warning |
StringBuffer may be StringBuilder | Enabled | Warning |
Unnecessary boxing | Enabled | Warning |
Unnecessary unboxing | Enabled | Warning |
while loop replaceable with enhanced for loop | Enabled | Warning |
Java 7
equals() expression replaceable by Objects.equals() expression | Enabled | Weak Warning |
Explicit type can be replaced with <> | Enabled | Warning |
Identical catch branches in try statement | Enabled | Warning |
Possible heap pollution from parameterized vararg type | Enabled | Warning |
try finally replaceable with try with resources | 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
Files.readString() or Files.writeString() can be used | Enabled | No highlighting, only fix |
String.repeat() can be used | Enabled | No highlighting, only fix |
Java 13
New style switch can be replaced with old style one | Enabled | No highlighting, only fix |
Statement can be replaced with enhanced switch | 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 package-info.java | Disabled | Warning |
Missing @Deprecated annotation | Disabled | Warning |
package-info.java without package statement | Disabled | Warning |
package.html may be converted to package-info.java | Disabled | Warning |
Unnecessary Javadoc link | Disabled | Warning |
Unnecessary {@inheritDoc} Javadoc comment | Disabled | Warning |
JUnit
Inspection name | Default state | Default severity |
---|---|---|
assertEquals() between objects of inconvertible types | Enabled | Warning |
assertEquals() called on array | Disabled | Warning |
assertEquals() may be assertSame() | Disabled | Warning |
Assertion expression can be replaced with assertThat method call | 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 @Ignore / @Disabled | 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 setUp() or tearDown() method | 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 assertEquals() arguments | 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 |
suite() method not declared static | Enabled | Warning |
super.tearDown() not called from finally block | Disabled | Warning |
Test class with no tests | Disabled | Warning |
Unconstructable JUnit TestCase | Enabled | Warning |
Usage of obsolete junit.framework.Assert method | 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 |
public method without logging | Disabled | Warning |
Memory
Inspection name | Default state | Default severity |
---|---|---|
Anonymous class may be a named static inner class | Disabled | Warning |
Calls to System.gc() or Runtime.gc() | Disabled | Warning |
Inner class may be static | 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 main() method | Disabled | Warning |
Exception class name does not end with Exception | 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 Exception | 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 $ in identifier | Disabled | Warning |
Numeric issues
Inspection name | Default state | Default severity |
---|---|---|
Call to BigDecimal method without a rounding mode argument | Enabled | Warning |
char expression used in arithmetic context | Disabled | Warning |
Comparison of short and char values | Disabled | Warning |
Comparison to Double.NaN or Float.NaN | Enabled | Warning |
Confusing floating-point literal | Disabled | Warning |
Constant call to java.lang.Math | Disabled | Warning |
Divide by zero | Enabled | Warning |
double literal cast to float could be float literal | Disabled | Warning |
equals() called on java.math.BigDecimal | Disabled | Warning |
Floating point equality comparison | Disabled | Warning |
Implicit numeric conversion | Disabled | Warning |
int literal cast to long could be long literal | Disabled | Warning |
Integer division in floating point context | Enabled | Warning |
Integer multiplication or shift implicitly cast to long | Disabled | Warning |
long literal ending with l instead of L | Enabled | Warning |
Non-reproducible call to java.lang.Math | 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 Arrays.asList() with too few arguments | Enabled | Warning |
Call to simple getter from within class | Disabled | Warning |
Call to simple setter from within class | Disabled | Warning |
Class initializer may be static | Enabled | Warning |
Collection.toArray() call style | 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 |
equals() call can be replaced with == | Enabled | No highlighting, only fix |
equals() or hashCode() called on java.net.URL object | Disabled | Warning |
Explicit argument can be lambda | Enabled | No highlighting, only fix |
Field may be static | Disabled | Warning |
Inefficient Stream API call chains ending with count() | Enabled | Warning |
Instantiating object to get Class object | Enabled | Warning |
Iteration over keySet() may be optimized | Disabled | Warning |
List.remove() called in loop | 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 java.net.URL objects | Disabled | Warning |
Map replaceable with EnumMap | Disabled | Warning |
Method may be static | Disabled | Warning |
Non-constant String should be StringBuilder | Disabled | Warning |
Object allocation in loop | Disabled | Warning |
Object instantiation inside equals() or hashCode() | Disabled | Warning |
Redundant Collection.addAll() call | Enabled | Warning |
Redundant call to String.format() | Enabled | Warning |
Set replaceable with EnumSet | Disabled | Warning |
Single character string argument in String.indexOf() call | Disabled | Warning |
Single character string concatenation | Enabled | No highlighting, only fix |
String.equals("") | Disabled | Warning |
String concatenation as argument to StringBuilder.append() call | Enabled | Warning |
String concatenation in loop | Enabled | Warning |
StringBuilder.toString() in concatenation | 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 Random.nextDouble() to get random integer | Disabled | Warning |
Portability
Inspection name | Default state | Default severity |
---|---|---|
Call to Runtime.exec() | Disabled | Warning |
Call to System.exit() or related methods | Disabled | Warning |
Call to System.getenv() | Disabled | Warning |
Hardcoded file separator | Disabled | Warning |
Hardcoded line separator | Disabled | Warning |
Native method | Disabled | Warning |
Use of java.lang.ProcessBuilder class | 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 null | Disabled | Warning |
Inspection name | Default state | Default severity |
---|---|---|
Array comparison using == , instead of Arrays.equals() | Disabled | Warning |
assert statement condition is constant | Disabled | Warning |
assert statement with side effects | Enabled | Warning |
Call to toString() on array | Enabled | Warning |
Call to String.replaceAll(".", ...) | Enabled | Warning |
Call to default toString() | Disabled | Warning |
Cast conflicts with instanceof | 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 equals() not overridden | 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 equals() | Disabled | Warning |
Duplicated delimiters in java.util.StringTokenizer | Enabled | Warning |
Empty class initializer | Disabled | Warning |
equal() instead of equals() | Disabled | Warning |
equals() and hashCode() not paired | Disabled | Warning |
equals() between objects of inconvertible types | Enabled | Warning |
equals() called on StringBuilder | Enabled | Warning |
equals() called on array | Enabled | Warning |
equals() called on itself | Enabled | Warning |
equals() method which does not check class of parameter | Enabled | Warning |
hashCode() called on array | Enabled | Warning |
Infinite recursion | Enabled | Warning |
Inner class referenced via subclass | Disabled | Warning |
instanceof with incompatible interface | Disabled | Warning |
Instantiation of utility class | Disabled | Warning |
Invalid method reference used for Comparator | Enabled | Warning |
Iterable is used as vararg | Enabled | Warning |
Iterator.hasNext() which calls next() | Disabled | Warning |
Iterator.next() which can't throw NoSuchElementException | 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 |
Math.random() cast to int | 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 compareTo() | Disabled | Warning |
Non-final field referenced in equals() | Disabled | Warning |
Non-final field referenced in hashCode() | Disabled | Warning |
Non-short-circuit boolean expression | Disabled | Warning |
Non-short-circuit operation consumes the infinite stream | Enabled | Warning |
Number comparison using == , instead of equals() | Enabled | Warning |
Object comparison using == , instead of equals() | Enabled | No highlighting, only fix |
Objects.equals() called on arrays | Enabled | Warning |
Optional.get() is called without isPresent() check | Enabled | Warning |
Overwritten Map key or Set element | Enabled | Warning |
Reference checked for null is not used inside if | 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 |
String.equals() called with CharSequence argument | Enabled | Warning |
String comparison using == , instead of equals() | Enabled | Warning |
String concatenation as argument to MessageFormat.format() call | Disabled | Warning |
String concatenation as argument to format() call | Disabled | Warning |
String literal concatenation missing whitespace | Disabled | Warning |
StringBuilder constructor call with char argument | Enabled | Warning |
Subtraction in compareTo() | Disabled | Warning |
Suspicious Collection.toArray() call | Enabled | Warning |
Suspicious Comparator.compare() implementation | Enabled | Warning |
Suspicious List.remove() in the loop | Enabled | Warning |
Suspicious System.arraycopy() call | 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 switch statement | Enabled | Warning |
Throwable not thrown | Enabled | Warning |
Unsafe call to Class.newInstance() | 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 Connection.prepare*() with non-constant string | Disabled | Warning |
Call to Runtime.exec() with non-constant string | Disabled | Warning |
Call to Statement.execute() with non-constant string | Disabled | Warning |
Call to System.loadLibrary() with non-constant string | Disabled | Warning |
Call to System.setSecurityManager() | 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- static inner class in secure context | Disabled | Warning |
Non-final clone() in secure context | Disabled | Warning |
public static array field | Disabled | Warning |
public static collection field | 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 readObject() or writeObject() | Disabled | Warning |
Externalizable class without public no-arg constructor | Enabled | Warning |
Instance field may not be initialized by readObject() | Disabled | Warning |
Non-serializable class with readObject() or writeObject() | Disabled | Warning |
Non-serializable class with serialVersionUID | 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 |
readObject() or writeObject() not declared private | Disabled | Warning |
readResolve() or writeReplace() not declared protected | Disabled | Warning |
Serializable class with unconstructable ancestor | Disabled | Warning |
Serializable class without readObject() and writeObject() | Disabled | Warning |
Serializable class without serialVersionUID | Disabled | Warning |
Serializable non- static inner class with non-Serializable outer class | Disabled | Warning |
Serializable non- static inner class without serialVersionUID | Disabled | Warning |
Serializable object implicitly stores non-Serializable object | Disabled | Warning |
serialPersistentFields field not declared private static final ObjectStreamField[] | Disabled | Warning |
serialVersionUID field not declared private static final long | 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 |
---|---|---|
assertEquals() between objects of inconvertible types | Enabled | Warning |
Constant TestNG assert argument | Disabled | Warning |
Data provider problems | Enabled | Warning |
dependsOnMethods problem | 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 assertEquals() arguments | 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 static final | Enabled | Warning |
AtomicFieldUpdater issues | Enabled | Warning |
await() not in loop | Disabled | Warning |
await() without corresponding signal() | Disabled | Warning |
Busy wait | Disabled | Warning |
Call to System.runFinalizersOnExit() | Disabled | Warning |
Call to Thread.run() | Enabled | Warning |
Call to Thread.setPriority() | Disabled | Warning |
Call to Thread.sleep() while synchronized | Disabled | Warning |
Call to Thread.start() during object construction | Disabled | Warning |
Call to Thread.stop() , suspend() or resume() | Disabled | Warning |
Call to Thread.yield() | Disabled | Warning |
Call to notify() instead of notifyAll() | Disabled | Warning |
Call to signal() instead of signalAll() | Disabled | Warning |
Call to a native method while locked | Disabled | Warning |
Class directly extends java.lang.Thread | Disabled | Warning |
Double-checked locking | Disabled | Warning |
Empty synchronized statement | Disabled | Warning |
Field accessed in both synchronized and unsynchronized contexts | Disabled | Warning |
Instantiating a Thread with default run() method | Disabled | Warning |
Lock acquired but not safely unlocked | Disabled | Warning |
Method with synchronized block could be synchronized method | Disabled | Warning |
Nested synchronized statement | 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 |
notify() or notifyAll() called on java.util.concurrent.locks.Condition object | Disabled | Warning |
notify() or notifyAll() without corresponding state change | Disabled | Warning |
notify() without corresponding wait() | Disabled | Warning |
signal() without corresponding await() | Disabled | Warning |
Static initializer references subclass | Enabled | Warning |
Synchronization on getClass() | Enabled | Warning |
Synchronization on static field | Disabled | Warning |
Synchronization on this | 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 |
synchronized method | Disabled | Warning |
ThreadLocal field not declared static final | Disabled | Warning |
ThreadLocalRandom instance might be shared | Disabled | Warning |
Unconditional wait() call | Disabled | Warning |
Unsynchronized method overrides synchronized method | Disabled | Warning |
Volatile array field | Disabled | Warning |
wait() called on java.util.concurrent.locks.Condition object | Disabled | Warning |
wait() not in loop | Disabled | Warning |
wait() or await() without timeout | Disabled | Warning |
wait() or notify() while not synchronized | Disabled | Warning |
wait() while holding two locks | Disabled | Warning |
wait() without corresponding notify() | Disabled | Warning |
while loop spins on field | Enabled | Warning |
toString() issues
Inspection name | Default state | Default severity |
---|---|---|
Class does not override toString() method | Disabled | Warning |
Field not used in toString() method | 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 switch | 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 compare method call | Enabled | Warning |
Redundant isInstance or cast call | 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 |
StringBuilder can be replaced with String | Enabled | Warning |
Too weak variable type leads to unnecessary cast | Enabled | Warning |
Unnecessary break statement | Enabled | Warning |
Unnecessary continue statement | Enabled | Warning |
Unnecessary default for enum switch statement | Enabled | Warning |
Unnecessarily escaped character | Enabled | Warning |
Unnecessary return statement | Enabled | Warning |
Unnecessary label on break statement | Enabled | Warning |
Unnecessary label on continue statement | 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 module-info | Enabled | Warning |
Last modified: 01 July 2021