Inspectopedia Help

Probable bugs

'@Deferred' result is unused   New in this release

Reports function calls with the Deferred result type if the return value is not used.

'catch' block may ignore exception  

Reports catch blocks that are empty or may ignore an exception.

'equals()' and 'hashCode()' not paired  

Reports classes that override equals() but do not override hashCode(), or vice versa.

'equals()' between objects of inconvertible types  

Reports calls to equals() where the receiver and the argument are of incompatible primitive, enum, or string types.

'lateinit var' property overrides 'lateinit var' property   New in this release

Reports lateinit var properties that override other lateinit var properties.

Ambiguous coroutineContext due to CoroutineScope receiver of suspend function   New in this release

Reports calls and accesses of CoroutineScope extensions or members inside suspend functions with CoroutineScope receiver.

Ambiguous non-local 'break' or 'continue'   New in this release

Reports break or continue usages inside of lambdas of loop-like functions.

Ambiguous unary operator use with number constant   New in this release

Reports an unary operator followed by a dot qualifier such as -1.inc().

Array property in data class   New in this release

Reports properties with an Array type in a data class without overridden equals() or hashCode().

Arrays comparison via '==' and '!='   New in this release

Reports usages of == or != operator for arrays that should be replaced with contentEquals().

Augmented assignment creates a new collection under the hood   New in this release

Reports augmented assignment (+=) expressions on a read-only Collection.

Constant conditions   New in this release

Reports non-trivial conditions and values that are statically known to be always true, false, null or zero.

Constructor can never be complete   New in this release

Reports constructors with a non-null self-reference parameter.

Control flow with empty body   New in this release

Reports if, while, do or for statements with empty bodies.

Convert 'object' to 'data object'   New in this release

Reports object that can be converted to data object.

Convert equality check with 'NaN' to 'isNaN' call   New in this release

Reports an equality check with Float.NaN or Double.NaN that should be replaced with an isNaN() check.

Covariant 'equals()'  

Reports equals() that takes an argument type other than Any? if the class does not have another equals() that takes Any? as its argument type.

Delegating to 'var' property   New in this release

Reports interface delegation to a var property.

Existing backing field without assignment   New in this release

Reports property setters that don't update the backing field.

Extension property conflicting with synthetic one   New in this release

Reports extension properties that conflict with synthetic ones that have been automatically produced from Java get or set methods.

External interface contains non-nullable boolean property   New in this release

Reports non-nullable boolean properties in external interface.

External interface contains val property   New in this release

Reports not var properties in external interface.

Implicit 'Nothing?' type   New in this release

Reports variables and functions with the implicit Nothing? type.

Implicit (unsafe) cast from dynamic type   New in this release

Reports expressions with a dynamic type in the specified inspection scope that are implicitly cast to another type.

Incomplete destructuring declaration   New in this release

Reports incomplete destructuring declaration.

Iterated elements are not used in forEach   New in this release

Reports forEach loops that do not use iterable values.

Leaking 'this' in constructor   New in this release

Reports unsafe operations with this during object construction including: Accessing a non-final property during class initialization: from a constructor or property initialization Calling a non-final function during class initialization Using this as a function argument in a constructor of a non-final class If other classes inherit from the given class, they may not be fully initialized at the moment when an unsafe operation is carried out.

Main function should return 'Unit'   New in this release

Reports when a main function does not have a return type of Unit.

Private data class constructor is exposed via the 'copy' method   New in this release

Reports the private primary constructor in data classes.

Range with start greater than endInclusive is empty   New in this release

Reports ranges that are empty because the start value is greater than the endInclusive value.

Recursive equals call   New in this release

Reports recursive equals(==) calls.

Recursive property accessor   New in this release

Reports recursive property accessor calls which can end up with a StackOverflowError.

Redundant assignment  

Reports assignments of a variable to itself.

Sealed subclass without state and overridden equals   New in this release

Reports direct inheritors of sealed classes that have no state and overridden equals() method.

Serializable object must implement 'readResolve'   New in this release

Reports objects (data object including) that implement java.io.Serializable but don't implement readResolve.

Suspicious 'var' property: its setter does not influence its getter result   New in this release

Reports var properties with default setter and getter that do not reference backing field.

Suspicious callable reference used as lambda result   New in this release

Reports lambda expressions with one callable reference.

Suspicious combination of == and ===   New in this release

Reports == and === comparisons that are both used on the same variable within a single expression.

Throwable not thrown  

Reports instantiations of Throwable or its subclasses, when the created Throwable is never actually thrown.

Unresolved reference in KDoc   New in this release

Reports unresolved references in KDoc comments.

Unused equals expression   New in this release

Reports unused equals(==) expressions.

Unused result of data class copy   New in this release

Reports calls to data class copy function without using its result.

Unused return value of a function with lambda expression body   New in this release

Reports calls with an unused return value when the called function returns a lambda from an expression body.

Unused unary operator   New in this release

Reports unary operators for number types on unused expressions.

Useless call on collection type   New in this release

Reports filter… calls from the standard library on already filtered collections.

Useless call on not-null type   New in this release

Reports calls on not-null receiver that make sense only for nullable receiver.

Variable in destructuring declaration uses name of a wrong data class property   New in this release

Reports entries of destructuring declarations that match the name of a different property of the destructured data class.

Last modified: 11 September 2024