Redundant constructs
- Condition of 'if' expression is constant
Reports if expressions that have true or false constant literal condition and can be simplified.
- Control flow with empty body
Reports if, while, do or for statements with empty bodies.
- Function with '= { ... }' and inferred return type
Reports functions with = { ..
- Redundant 'constructor' keyword
Reports a redundant 'constructor' keyword on primary constructors.
- Redundant 'return' keyword
Reports redundant return keywords in expressions that appear as the last expression of an if or when branch when the entire if/when expression is itself returned.
- Redundant 'return' label
Reports redundant return labels outside of lambda expressions.
- Redundant 'suspend' modifier
Reports suspend modifier as redundant if no other suspending functions are called inside.
- Redundant argument-based 'let' call
Reports a redundant argument-based let call.
- Redundant backticks
Reports redundant backticks in references.
- Redundant constructor body
Reports empty bodies of secondary constructors.
- Redundant curly braces in string template
Reports usages of curly braces in string templates around simple identifiers.
- Redundant double negation
Reports redundant double negations.
- Redundant empty initializer block
Reports redundant empty initializer blocks.
- Redundant enum constructor invocation
Reports redundant constructor invocation on an enum entry.
- Redundant escaped dollar characters in string literals
Reports that escaped dollar characters in a string can be replaced with regular literals.
- Redundant interpolation prefix
Reports redundant dollar prefixes in string template expressions.
- Redundant labeled return on the last expression in a lambda
Reports labeled returns used on the last expressions in lambdas.
- Redundant overriding method
Reports redundant overriding declarations.
- Redundant property getter
Reports redundant property getters.
- Redundant property setter
Reports redundant property setters.
- Redundant receiver-based 'let' call
Reports redundant receiver-based let calls.
- Redundant SAM constructor
Reports SAM (Single Abstract Method) constructor usages which can be replaced with lambdas.
- Redundant semicolon
Reports redundant semicolons (;) that can be safely removed.
- Redundant setter parameter type
Reports explicitly specified parameter types in property setters.
- Redundant upper bound 'Any?'
Reports redundant explicit upper bound Any? on a type parameter.
- Redundant value argument
Reports arguments that are equal to the default values of the corresponding parameters.
- Replace empty class body
Reports declarations of classes and objects with an empty body.
- Simplifiable 'when'
Reports when expressions with the constant true or false branches.
- Unnecessary parentheses in function call with lambda
Reports redundant empty parentheses of function calls where the only parameter is a lambda that's outside the parentheses.
- Unused import directive
Reports redundant import statements.
- Unused symbol
Reports symbols that are not used or not reachable from entry points.
- Unused variable
This inspection reports variables that are not used.
- Variable initializer is redundant
Reports redundant initializers for local variables.