facebook pixelCodiga Analysis Kotlin Rules, severity informational
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.ArrayPrimitive

Error prone
Informational

Using Array<Primitive> leads to implicit boxing and a performance hit

detekt.ClassNaming

Error prone
Informational

Class and Object names should match the pattern: [A-Z][a-zA-Z0-9]*

detekt.ComplexMethod

Error prone
Informational

Function too complex.

detekt.ConstructorParameterNaming

Error prone
Informational

Constructor private parameter names should match the pattern: [a-z][A-Za-z0-9]*

detekt.DuplicateCaseInWhenExpression

Error prone
Informational

When expression has multiple case statements for the same value

detekt.EmptyCatchBlock

Error prone
Informational

Empty catch block detected. If the exception can be safely ignored

detekt.EmptyClassBlock

Error prone
Informational

The class or object Attempts is empty.

detekt.EmptyDefaultConstructor

Error prone
Informational

An empty default constructor can be removed.

detekt.EmptyKtFile

Error prone
Informational

Detect empty files

detekt.EmptyWhenBlock

Error prone
Informational

This when block is empty.

detekt.EmptyWhileBlock

Design
Informational

This empty block of code can be removed.

detekt.EnumNaming

Error prone
Informational

Enum entry names should match the pattern: [A-Z][\_a-zA-Z0-9]*

detekt.ForbiddenComment

Code style
Informational

This comment contains text that has been defined as forbidden in detekt.

detekt.ForEachOnRange

Error prone
Informational

Using the forEach method on ranges has a heavy performance cost. Prefer using simple for loops.

detekt.FunctionNaming

Error prone
Informational

Function names should match the pattern: ([a-z][a-zA-Z0-9]*)|(`.*`)

detekt.FunctionParameterNaming

Error prone
Informational

Function parameter names should match the pattern: [a-z][A-Za-z0-9]*

detekt.IteratorNotThrowingNoSuchElementException

Error prone
Informational

This implementation of Iterator does not correctly implement the next() method as it doesn't throw a NoSuchElementException when no elements remain in the Iterator.

detekt.MatchingDeclarationName

Error prone
Informational

The file name 'does not match the name of the single top-level declaration

detekt.ModifierOrder

Error prone
Informational

Incorrect modifier order

detekt.ObjectPropertyNaming

Error prone
Informational

Object constant names should match the pattern: [A-Za-z][\_A-Za-z0-9]*

detekt.OptionalAbstractKeyword

Error prone
Informational

The abstract keyword on this declaration is unnecessary.

detekt.ProtectedMemberInFinalClass

Error prone
Informational

Member with protected visibility in final class is private. Consider using private or internal as modifier.

detekt.ReturnCount

Best practice
Informational

Function has 3 return statements which exceeds the limit of 2.

detekt.SpreadOperator

Best practice
Informational

In most cases using a spread operator causes a full copy of the array to be created before calling a method which has a very high performance penalty.

detekt.TooGenericExceptionThrown

Error prone
Informational

Throwable is a too generic Exception. Prefer throwing specific exceptions that indicate a specific error case.

detekt.UnreachableCode

Error prone
Informational

This expression is followed by unreachable code which should either be used or removed.

detekt.UtilityClassWithPublicConstructor

Error prone
Informational

The class only contains utility functions. Consider defining it as an object.

detekt.VariableNaming

Error prone
Informational

Private variable names should match the pattern: (\_)?[a-z][A-Za-z0-9]*

detekt.WildcardImport

Error prone
Informational

Use qualified import

detekt.UnusedPrivateMember

Best practice
Informational

Function parameter is unused