Static code analysis for Kotlin
Permalink
Failed to load latest commit information.
.buildscript Auto deploy SNAPSHOT versions. (#1088) Sep 9, 2018
.github update documentation to use new detekt gradle plugin (#1095) Sep 10, 2018
detekt-api Use private setter instead of separate backing field Oct 7, 2018
detekt-cli Migrate JUnit tests to Spek (#1213) Oct 12, 2018
detekt-core Migrate JUnit tests to Spek (#1213) Oct 12, 2018
detekt-formatting Merge branch 'master' into simplify-gradle Sep 27, 2018
detekt-generator Merge branch 'master' into simplify-gradle Sep 27, 2018
detekt-gradle-plugin Revert "Revert "Update dependencies"" Oct 3, 2018
detekt-rules Migrate JUnit tests to Spek (#1213) Oct 12, 2018
detekt-sample-extensions Migrate JUnit tests to Spek (#1213) Oct 12, 2018
detekt-test Suppress false positive UnsafeCast in ThresholdedCodeSmellAssert.kt Oct 7, 2018
detekt-watcher Remove kotlinImplementation configuration from Gradle build Sep 24, 2018
docs Update documentation Oct 7, 2018
gradle/wrapper Revert "Revert "Update dependencies"" Oct 3, 2018
reports Remove dupe SpacingBetweenPackageAndImports entry from failfast.yml Aug 31, 2018
scripts Reference vcsreader repo via GrabResolver - Fixes #1101 Sep 13, 2018
.editorconfig Add .editorconfig Sep 14, 2017
.gitattributes Checkout *.md, *.yml & *.html with LF line endings Dec 13, 2017
.gitignore Allow importing just detekt-gradle-plugin into IDE Oct 2, 2018
.travis.yml Remove unnecessary new CI commands Oct 5, 2018
LICENSE Update licence copyright date and authors - #176 Jul 9, 2017
README.md fix gradle plugin link (#1211) Oct 9, 2018
ROADMAP.md Update roadmap Mar 15, 2018
appveyor.yml AppVeyor: Disable Kotlin's incremental build support (#1240) Oct 12, 2018
build.gradle.kts Migrate JUnit tests to Spek (#1213) Oct 12, 2018
commit-msg Removed commit message length check from commit-hook Mar 20, 2018
gradle.properties Migrate JUnit tests to Spek (#1213) Oct 12, 2018
gradlew Update Gradle wrapper, using Gradle 4.1-rc-2 Aug 6, 2017
gradlew.bat Update Gradle wrapper, using Gradle 4.1-rc-2 Aug 6, 2017
idea-code-style.xml Update documents for RC2 Aug 12, 2017
settings.gradle.kts Revert "Revert "Update dependencies"" Oct 3, 2018

README.md

detekt

Join the chat at https://kotlinlang.slack.com/messages/C88E12QH4/convo/C0BQ5GZ0S-1511956674.000289/ Visit the website at https://arturbosch.github.io/detekt/ build status build status windows Download gradle plugin

All Contributors 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

Features

  • 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 https://arturbosch.github.io/detekt/ for installation guides, release notes, migration guides, rule descriptions and configuration options.

Quick-Links

Quick Start ...

with command-line interface

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

with gradle

buildscript {
    repositories {
        jcenter()
    }
}

plugins {
    id("io.gitlab.arturbosch.detekt").version("[version]")
}

detekt {
    toolVersion = "[version]"
    input = files("src/main/kotlin")
    filters = ".*/resources/.*,.*/build/.*"
}

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 {
    detekt "io.gitlab.arturbosch.detekt:detekt-formatting:[version]"
}

Likewise custom extensions can be added to detekt.

Contributors

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

Mentions

androidweekly androidweekly

As mentioned in...

Integrations:

Credits