BACK TO LIST

Kotlin rules

Codiga provides multiple sets of rules for 12+ languages. Below we provide a link and a description for all the rules supported by our platform. Note that not all the rules are being listed and described below.

detekt.ComplexCondition

Error prone
Error

Condition is too complex

detekt.LargeClass

Design
Error

Detect classes that are too large

detekt.MayBeConst

Design
Error

Refactor into a const

detekt.EmptyElseBlock

Error prone
Error

Empty block of code can be removed.

Learn more

detekt.EmptyFunctionBlock

Error prone
Error

Empty function block can be removed

detekt.EmptyIfBlock

Error prone
Error

Empty if block can be removed

detekt.EmptySecondaryConstructor

Error prone
Error

Empty secondary constructor can be removed

detekt.EqualsWithHashCodeExist

Error prone
Error

A class should always override hashCode when overriding equals and the other way around.

detekt.SerialVersionUIDInSerializableClass

Code style
Error

Classes which implement the Serializable interface should also correctly declare a serialVersionUID

detekt.ThrowingExceptionsWithoutMessageOrCause

Error prone
Error

Exceptions should always call one of the constructor overloads to provide a message or a cause.

We use cookies to improve your site experience, including analytics cookies to understand how you use our product and design better experiences. Please read our Cookie Policy.