facebook pixelKotlin Static Analysis Rules
BACK TO LIST

Kotlin rules

Codiga provides multiple set 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
      Minor

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

      detekt.ClassNaming

      Error prone
      Minor

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

      detekt.ComplexMethod

      Error prone
      Minor

      Function too complex.

      detekt.ConstructorParameterNaming

      Error prone
      Minor

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

      detekt.DuplicateCaseInWhenExpression

      Error prone
      Minor

      When expression has multiple case statements for the same value

      detekt.EmptyCatchBlock

      Error prone
      Minor

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

      detekt.EmptyClassBlock

      Error prone
      Minor

      The class or object Attempts is empty.

      detekt.EmptyDefaultConstructor

      Error prone
      Minor

      An empty default constructor can be removed.

      detekt.EmptyKtFile

      Error prone
      Minor

      Detect empty files

      detekt.EmptyWhenBlock

      Error prone
      Minor

      This when block is empty.

      detekt.EnumNaming

      Error prone
      Minor

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

      detekt.ForEachOnRange

      Error prone
      Minor

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

      detekt.FunctionNaming

      Error prone
      Minor

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

      detekt.FunctionParameterNaming

      Error prone
      Minor

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

      detekt.IteratorNotThrowingNoSuchElementException

      Error prone
      Minor

      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
      Minor

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

      detekt.ModifierOrder

      Error prone
      Minor

      Incorrect modifier order

      detekt.ObjectPropertyNaming

      Error prone
      Minor

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

      detekt.OptionalAbstractKeyword

      Error prone
      Minor

      The abstract keyword on this declaration is unnecessary.

      detekt.ProtectedMemberInFinalClass

      Error prone
      Minor

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

      detekt.TooGenericExceptionThrown

      Error prone
      Minor

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

      detekt.UnreachableCode

      Error prone
      Minor

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

      detekt.UtilityClassWithPublicConstructor

      Error prone
      Minor

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

      detekt.VariableNaming

      Error prone
      Minor

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

      detekt.WildcardImport

      Error prone
      Minor

      Use qualified import