Inspectopedia Help

Code style issues

Name

Language

'List.indexOf()' expression can be replaced with 'contains()'  

Java

'Objects.equals()' can be replaced with 'equals()'  

Java

'Optional' can be replaced with sequence of 'if' statements  

Java

'Optional' contains array or collection  

Java

'assert' message is not a string  

Java

'equals()' called on enum value  

Java

'if' statement can be replaced with conditional or boolean expression  

Java

'return' separated from the result computation  

Java

'size() == 0' can be replaced with 'isEmpty()'  

Java

'try' statement with multiple resources can be split  

Java

Array can be replaced with enum values  

Java

Array creation without 'new' expression  

Java

Assignment can be joined with declaration  

Java

Block marker comment  

Java

C-style array declaration  

Java

Call to 'String.concat()' can be replaced with '+'  

Java

Can use bounded wildcard  

Java

Chained equality comparisons  

Java

Chained method calls  

Java

Class explicitly extends 'Object'  

Java

Code block contains single statement  

Java

Conditional can be replaced with Optional  

Java

Confusing octal escape sequence  

Java

Constant expression can be evaluated  

Java

Constant on wrong side of comparison  

Java

Control flow statement without braces  

Java

Diamond can be replaced with explicit type arguments  

Java

Field assignment can be moved to initializer  

Java

Field may be 'final'  

Java

Implicit call to 'super()'  

Java

Instance field access not qualified with 'this'  

Java

Instance method call not qualified with 'this'  

Java

Labeled switch rule can have code block  

Java

Labeled switch rule has redundant code block  

Java

Lambda body can be code block  

Java

Lambda can be replaced with anonymous class  

Java

Lambda parameter type can be specified  

Java

Local variable or parameter can be 'final'  

Java

Method reference can be replaced with lambda  

Java

Missorted modifiers  

Java

Multi-catch can be split into separate catch blocks  

Java

Multiple operators with different precedence  

Java

Multiple variables in one declaration  

Java

Nested method call  

Java

Non functional style 'Optional.isPresent()' usage  

Java

Non-normalized annotation  

Java

Non-terminal use of '\s' escape sequence  

Java

Reassigned variable  

Java

Record can be converted to class  

Java

Redundant 'new' expression in constant array creation  

Java

Redundant field initialization  

Java

Redundant no-arg constructor  

Java

Return of 'this'  

Java

Same file subclasses are missing from permits clause of a sealed class  

Java

Simplifiable annotation  

Java

Standard 'Charset' object can be used  

Java

Stream API call chain can be replaced with loop  

Java

String literal may be 'equals()' qualifier  

Java

Subsequent steps can be fused into Stream API chain  

Java

Trailing whitespace in text block  

Java

Type parameter explicitly extends 'Object'  

Java

Unnecessarily qualified inner class access  

Java

Unnecessarily qualified static access  

Java

Unnecessarily qualified statically imported element  

Java

Unnecessary 'final' on local variable or parameter  

Java

Unnecessary 'null' check before 'equals()' call  

Java

Unnecessary 'super' qualifier  

Java

Unnecessary 'this' qualifier  

Java

Unnecessary call to 'super()'  

Java

Unnecessary call to 'toString()'  

Java

Unnecessary code block  

Java

Unnecessary conversion to 'String'  

Java

Unnecessary fully qualified name  

Java

Unnecessary modifier  

Java

Unnecessary parentheses  

Java

Unnecessary qualifier for 'this' or 'super'  

Java

Unnecessary semicolon  

Java

Unqualified inner class access  

Java

Unqualified static access  

Java

Using 'instanceof' with patterns  

Java

Last modified: 13 July 2023