Inspectopedia Help

Style issues

Name

Language

'String.format' call can be replaced with string templates  

Kotlin

'arrayOf' call can be replaced with array literal [...]  

Kotlin

'assert' call can be replaced with '!!' or '?:'  

Kotlin

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

Kotlin

'copy' method of data class is called without named arguments  

Kotlin

'if' condition can be replaced with lambda call  

Kotlin

'map.get()' with not-null assertion operator (!!)  

Kotlin

'map.put()' can be converted to assignment  

Kotlin

'protected' visibility is effectively 'private' in a final class  

Kotlin

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

Kotlin

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

Kotlin

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

Kotlin

'substring' call should be replaced with 'dropLast' call  

Kotlin

'substring' call should be replaced with 'substringAfter'  

Kotlin

'substring' call should be replaced with 'substringBefore'  

Kotlin

'substring' call should be replaced with 'take' call  

Kotlin

'substring' call should be replaced with indexing operator  

Kotlin

'to' call should be replaced with infix form  

Kotlin

'when' that can be simplified by introducing an argument  

Kotlin

Accessor call that can be replaced with property access syntax  

Kotlin

Assert boolean could be replaced with assert equality  

Kotlin

Assignment can be replaced with operator assignment  

Kotlin

Boolean expression can be simplified  

Kotlin

Boolean literal argument without parameter name  

Kotlin

Boxed properties should be replaced with unboxed  

Kotlin

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

Kotlin

Call chain on collection type can be simplified  

Kotlin

Call of 'toString' could be replaced with string template  

Kotlin

Can be replaced with binary operator  

Kotlin

Can be replaced with function reference  

Kotlin

Can be replaced with lambda  

Kotlin

Cascade 'if' can be replaced with 'when'  

Kotlin

Class member can have 'private' visibility  

Kotlin

Collection count can be converted to size  

Kotlin

Convert Pair constructor to 'to' function  

Kotlin

Convert to primary constructor  

Kotlin

Convert try / finally to use() call  

Kotlin

Equality check can be used instead of elvis for nullable boolean check  

Kotlin

Explicit 'get' or 'set' call  

Kotlin

Expression body syntax is preferable here  

Kotlin

Fully qualified name can be replaced with existing import alias  

Kotlin

Function should have 'operator' modifier  

Kotlin

Function with '= { ... }' and inferred return type  

Kotlin

Guard clause can be replaced with Kotlin's function call  

Kotlin

If-Null return/break/... foldable to '?:'  

Kotlin

If-Then foldable to '?.'  

Kotlin

If-Then foldable to '?:'  

Kotlin

Implicit 'this'  

Kotlin

Java Collections static method call can be replaced with Kotlin stdlib  

Kotlin

Java Map.forEach method call should be replaced with Kotlin's forEach  

Kotlin

Java methods should be replaced with Kotlin analog  

Kotlin

Join declaration and assignment  

Kotlin

Lambda argument inside parentheses  

Kotlin

Library function call could be simplified  

Kotlin

Local 'var' is never modified and can be declared as 'val'  

Kotlin

Loop can be replaced with stdlib operations  

Kotlin

Main parameter is not necessary  

Kotlin

Manually incremented index variable can be replaced with use of 'withIndex()'  

Kotlin

Might be 'const'  

Kotlin

Multiple operators with different precedence  

Kotlin

Negated boolean expression can be simplified  

Kotlin

Negated call can be simplified  

Kotlin

Nested lambda has shadowed implicit parameter  

Kotlin

Non-canonical modifier order  

Kotlin

Non-idiomatic 'is' type check for an object  

Kotlin

Not-null assertion can be replaced with 'return'  

Kotlin

Object literal can be converted to lambda  

Kotlin

Optionally expected annotation has no actual annotation  

Kotlin

Range can be converted to indices or iteration  

Kotlin

Redundant 'asSequence' call  

Kotlin

Redundant 'else' in 'if'  

Kotlin

Redundant 'runCatching' call  

Kotlin

Remove unnecessary parentheses  

Kotlin

Replace 'mapIndexed' with List generator  

Kotlin

Replace 'until' with '..<' operator  

Kotlin

Return or assignment can be lifted out  

Kotlin

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

Kotlin

Scope function can be converted to another one  

Kotlin

Scope function with nested forEach can be simplified  

Kotlin

Size check can be replaced with 'isNotEmpty()'  

Kotlin

Size zero check can be replaced with 'isEmpty()'  

Kotlin

String concatenation that can be converted to string template  

Kotlin

Suspicious 'asDynamic' member invocation  

Kotlin

Trailing comma recommendations  

Kotlin

Two comparisons should be converted to a range check  

Kotlin

Type parameter can have 'in' or 'out' variance  

Kotlin

Unlabeled return inside lambda  

Kotlin

Use destructuring declaration  

Kotlin

Variable declaration could be moved inside 'when'  

Kotlin

Verbose nullability and emptiness check  

Kotlin

Last modified: 13 July 2023