Join the chat at Visit the website at Download gradle plugin

build status build status windows codecov CodeFactor Awesome Kotlin Badge

Meet detekt, a static code analysis tool for the Kotlin programming language. It operates on the abstract syntax tree provided by the Kotlin compiler.

detekt in action


  • Code smell analysis for your Kotlin projects
  • Complexity report based on logical lines of code, McCabe complexity and amount of code smells
  • Highly configurable
  • Suppress findings with Kotlin’s @Suppress and Java’s @SuppressWarnings annotations
  • Specify code smell thresholds to break your build
  • Code Smell baseline and ignore lists for legacy projects
  • Gradle plugin for code analysis via Gradle builds
  • Gradle tasks to use local IntelliJ distribution for formatting and inspecting Kotlin code
  • SonarQube integration
  • Extensible by own rule sets, FileProcessListener's and OutputReport's
  • IntelliJ integration
  • Unofficial Maven plugin by Ozsie

Project Website

Visit for installation guides, release notes, migration guides, rule descriptions and configuration options.

  • Changelog and migration guides:
  • Available CLI options:
  • Rule set and rule descriptions:
  • Writing custom rules and extending detekt:
  • Suppressing findings?
  • Configuring detekt?
  • Sample gradle integrations examples
    • multi project (kotlin dsl):
    • single project (groovy dsl):
    • single project (unofficial maven plugin):
    • setup additional detekt task for all modules (kotlin dsl):
    • setup additional formatting task for all modules (kotlin dsl):

Quick Start …

with command-line interface

  • git clone
  • cd detekt
  • ./gradlew build shadowJar
  • java -jar detekt-cli/build/libs/detekt-cli-[version]-all.jar --help

with gradle

Gradle 4.9+ is required:

buildscript {
    repositories {

plugins {

detekt {
    toolVersion = "[version]"
    input = files("src/main/kotlin")
    filters = ".*/resources/.*,.*/build/.*"
    baseline = file("my-detekt-baseline.xml") // Just if you want to create a baseline file.

See bintray for releases and artifactory for snapshots.

Adding more rule sets

detekt itself provides a wrapper over KtLint as a formatting rule set which can be easily added to the gradle configuration:

dependencies {
    detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:[version]"

Likewise custom extensions can be added to detekt.


If you contributed to detekt but your name is not in the list, please feel free to add yourself to it!


androidweekly androidweekly

As mentioned in…



compile "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.RC9.2"

Related Libraries


Easy to use and concise yet powerful and robust command line argument parsing for Kotlin

Last updated 3 mins ago


Java/Kotlin library to check against Maven for the latest version of your package

Last updated 3 mins ago


SOLID Analytics Interface for Android, written in Kotlin

Last updated 3 mins ago


An anti-bikeshedding Kotlin linter with built-in formatter

Last updated 3 mins ago


A logger facilitating lazily-evaluated log calls via Kotlin's inline classes & functions.

Last updated 3 mins ago