Inspectopedia 2026.2 Help

Style issues

''{0}'' can be used  

Reports collection literals that can be replaced with an explicit Type.of(...) call.

'addAll(map/filter {})' can be replaced with 'mapTo/filterTo'  

Reports calls to MutableCollection.addAll / += where the argument is a call to Iterable.map/filter.

'associate' can be replaced with 'associateBy' or 'associateWith'  

Reports calls to associate() and associateTo() that can be replaced with associateBy() or associateWith().

'filterIsInstance' call with a class literal argument  

Reports calls of the Kotlin standard library function filterIsInstance with a class literal argument.

'if' expression can be replaced with 'firstOrNull()'  

Reports if expressions that check whether a list, array, or string is not empty and then return the first element or null.

'map' call can be replaced with 'forEach'  

Reports map calls whose results are ignored and can be replaced with forEach.

'map.getOrDefault()' can be replaced with indexing and elvis operator  

Replaces map.getOrDefault(key, defaultValue) function calls with an indexing and elvis operator (map[key] ?: defaultValue).

'rangeTo' or the '..' call should be replaced with '..<'  

Reports calls to rangeTo or the .

'rangeTo' or the '..' call should be replaced with 'until'  

Reports calls to rangeTo or the .

'readLine' can be replaced with 'readln' or 'readlnOrNull'  

Reports calls to readLine() that can be replaced with readln() or readlnOrNull().

Assert boolean could be replaced with assert equality  

Reports calls to assertTrue() and assertFalse() that can be replaced with assert equality functions.

Boolean expression can be simplified  

Reports boolean expression parts that can be reduced to constants.

Call chain on collection could be converted into 'Sequence' to improve performance  

Reports call chain on a Collection that should be converted into Sequence.

Call of 'toString' could be replaced with string template  

Reports toString function calls that can be replaced with a string template.

Collection literal can be replaced with a function call  

Detects collection literals.

Collection literal can be used  

Reports calls to a companion object's of operator function that can be replaced with a collection literal.

Collection literals can be used  

Reports calls to collection factory functions that can be replaced with collection literal syntax.

Convert to comparisons  

Converts a range check (in) to two consecutive comparisons.

Explicit backing fields can be used  

Detects properties with backing fields and suggests a refactoring introducing backing fields explicitly using a field keyword.

Explicit context argument can be implicit  

Reports an explicit context argument that can be converted to an implicit one by wrapping the call in a context(...) { } block.

Implicit context argument can be explicit  

Reports an implicit context argument that can be converted to an explicit named argument.

Multiple operators with different precedence  

Reports binary expressions that consist of different operators without parentheses.

Negated boolean expression can be simplified  

Reports negated boolean expressions that can be simplified.

Non-canonical modifier order  

Reports modifiers that do not follow the order recommended by the style guide.

Not-null assertion can be replaced with 'error()'  

Reports not-null assertion (!!) calls that can be replaced with the elvis operator and error(...).

Nullable value 'hashCode()' can be simplified  

Reports value?.hashCode() ?: 0 and suggests replacing it with value.hashCode().

Object literal can be converted to lambda  

Reports anonymous object literals implementing a Java interface with a single abstract method that can be converted into a call with a lambda expression.

Range can be converted to indices or iteration  

Reports until and rangeTo operators that can be replaced with Collection.indices or iteration over collection inside for loop.

Redundant parentheses  

Reports expressions containing redundant parentheses.

Replace 'contains' call with 'in' operator  

Replaces contains member calls with an in operator.

Replace 'map { it.key }.toSet()' with 'keys'  

Reports map { it.key }.toSet() call chains on map receivers that could be replaced with keys.

Replace 'mapIndexed' with List generator  

Reports a mapIndexed call that can be replaced by List generator.

Replace 'until' with '..<' operator  

Reports until that can be replaced with ..< operator.

Replace explicit backing field with private property  

Detects explicit backing fields.

Safe cast with 'return' should be replaced with 'if' type check  

Reports safe cast with return that can be replaced with if type check.

Sealed class can be converted to sealed interface  

Reports sealed classes that have no properties and can be converted to sealed interfaces.

Sealed interface can be converted to sealed class  

Reports sealed interfaces that have no properties and can be converted to sealed classes.

Suspicious 'asDynamic' member invocation  

Reports usages of asDynamic function on a receiver of dynamic type.

Trailing comma recommendations  

Reports trailing commas that do not follow the recommended style guide.

Two comparisons should be converted to a range check  

Reports two consecutive comparisons that can be converted to a range check.

Type conversion on collection literal can be removed  

Flags chain expressions with collection literals that change the expression's type.

Unsafe cast with 'return' should be replaced with the safe one  

Reports an unsafe cast with return in variable assignments or in value arguments that can be replaced with a safe cast.

Use destructuring declaration  

Reports declarations that can be destructured.

Variable declaration could be moved into 'when'  

Reports variable declarations that can be moved inside a when expression.

Last modified: 30 June 2026