arturbosch/detekt


Static code analysis for Kotlin

https://arturbosch.github.io/detekt/

License: Apache-2.0

Language: Kotlin

Keywords: analysis, badsmells, codesmells, detection, detekt, gradle-plugin, kotlin, linter, smell, static


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 codecov 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

Gradle 4.9+ is required:

buildscript {
    repositories {
        jcenter()
    }
}

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

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.
}

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.

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

Project Statistics

Sourcerank 11
Repository Size 8.23 MB
Stars 1,823
Forks 209
Watchers 51
Open issues 118
Dependencies 85
Contributors 83
Tags 52
Created
Last updated
Last pushed

Top Contributors See all

Artur Bosch schalkms Marvin Ramin Matthew Haughton Sebastiano Poggi Ivan Balaksha Niklas Baudy Egor Neliuba Pavlos-Petros Tournaris Lukas Mike Kobit Erhard Pointl Mishkun Ilya Zorin Radim Vaculík Dmytro Troynikov Mariano Simone Sebastian Schuberth Tyler Thrailkill marschwar

Packages Referencing this Repo

io.gitlab.arturbosch.detekt:detekt-sample-extensions
Static code analysis for Kotlin
Latest release 1.0.0-gradle-rework-beta3 - Updated - 1.82K stars
io.gitlab.arturbosch.detekt:detekt-generator
Static code analysis for Kotlin
Latest release 1.0.0-gradle-rework-beta3 - Updated - 1.82K stars
io.gitlab.arturbosch.detekt:detekt-core
Static code analysis for Kotlin
Latest release 1.0.0-gradle-rework-beta3 - Updated - 1.82K stars
io.gitlab.arturbosch.detekt:detekt-rules
Static code analysis for Kotlin
Latest release 1.0.0-gradle-rework-beta3 - Updated - 1.82K stars
io.gitlab.arturbosch.detekt:detekt-watcher
Static code analysis for Kotlin
Latest release 1.0.0-RC14 - Updated - 1.82K stars
io.gitlab.arturbosch.detekt:detekt-formatting
Static code analysis for Kotlin
Latest release 1.0.0-gradle-rework-beta3 - Updated - 1.82K stars
io.gitlab.arturbosch.detekt:detekt-test
Static code analysis for Kotlin
Latest release 1.0.0-gradle-rework-beta3 - Updated - 1.82K stars
io.gitlab.arturbosch.detekt:detekt-cli
Static code analysis for Kotlin
Latest release 1.0.0-gradle-rework-beta3 - Updated - 1.82K stars
io.gitlab.arturbosch.detekt:detekt-api
Static code analysis for Kotlin
Latest release 1.0.0-gradle-rework-beta3 - Updated - 1.82K stars

Recent Tags See all

1.0.0-RC14 February 18, 2019
1.0.0-RC13 February 10, 2019
1.0.0-RC12 December 10, 2018
1.0.0-RC11 November 15, 2018
RC10 November 02, 2018
RC9.2 September 23, 2018
RC9 September 15, 2018
RC8 July 22, 2018
RC7-3 June 28, 2018
RC7-2 June 08, 2018
RC7-2 June 08, 2018
RC7 May 08, 2018
RC7 May 08, 2018
RC6-4 March 18, 2018
RC6-4 March 18, 2018

Something wrong with this page? Make a suggestion

Last synced: 2019-03-12 22:03:08 UTC

Login to resync this repository