Inspectopedia Help

Abstraction issues

'Optional' used as field or parameter type  

Reports any cases in which java.util.Optional<T>, java.util.OptionalDouble, java.util.OptionalInt, java.util.OptionalLong, or com.google.common.base.Optional are used as types for fields or parameters.

'instanceof' check for 'this'  

Reports usages of instanceof or getClass() == SomeClass.class in which a this expression is checked.

'public' method not exposed in interface  

Reports public methods in classes which are not exposed in an interface.

'public' method with 'boolean' parameter  

Reports public methods that accept a boolean parameter.

Chain of 'instanceof' checks  

Reports any chains of if-else statements all of whose conditions are instanceof expressions or class equality expressions (e.g.

Class references one of its subclasses  

Reports classes which contain references to one of their subclasses.

Collection declared by class, not interface  

Reports declarations of Collection variables made by using the collection class as a type, rather than an appropriate interface.

Feature envy  

Reports the Feature Envy code smell.

Interface method clashes with method in 'Object'  

Reports interface methods that clash with the protected methods clone() and finalize() from the java.lang.Object class.

Magic number  

Reports "magic numbers": numeric literals that are not named by a constant declaration.

Overly strong type cast  

Reports type casts that are overly strong.

Private method only used from inner class  

Reports private methods which are only called from an inner class of the class containing the method.

Static member only used from one other class  

Reports static methods and fields that are only used from a class other than the containing class.

Type may be weakened  

Reports variable and method return types that can be changed to a more abstract (weaker) type.

Use of concrete class  

Reports usages of concrete classes, rather than interfaces.

Last modified: 18 June 2024