All Projects → detekt → Detekt

detekt / Detekt

Licence: apache-2.0
Static code analysis for Kotlin

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Detekt

Reviewdog
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
Stars: ✭ 4,541 (+8.92%)
Mutual labels:  linter, lint, static-analysis, code-quality
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-99.66%)
Mutual labels:  lint, analysis, linter, static-analysis
Static Analysis
⚙️ A curated list of static analysis (SAST) tools for all programming languages, config files, build tools, and more.
Stars: ✭ 9,310 (+123.31%)
Mutual labels:  linter, analysis, static-analysis, code-quality
Exakat
The Exakat Engine : smart static analysis for PHP
Stars: ✭ 346 (-91.7%)
Mutual labels:  linter, analysis, lint, static-analysis
Cflint
Static code analysis for CFML (a linter)
Stars: ✭ 156 (-96.26%)
Mutual labels:  linter, lint, static-analysis, code-quality
Wotan
Pluggable TypeScript and JavaScript linter
Stars: ✭ 271 (-93.5%)
Mutual labels:  linter, static-analysis, code-quality
Protoc Gen Lint
A plug-in for Google's Protocol Buffers (protobufs) compiler to lint .proto files for style violations.
Stars: ✭ 221 (-94.7%)
Mutual labels:  linter, lint, static-analysis
sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (-98.9%)
Mutual labels:  linter, static-analysis, code-quality
constyble
CSS complexity linter
Stars: ✭ 92 (-97.79%)
Mutual labels:  analysis, linter, static-analysis
Woke
✊ Detect non-inclusive language in your source code.
Stars: ✭ 190 (-95.44%)
Mutual labels:  linter, lint, static-analysis
mllint
`mllint` is a command-line utility to evaluate the technical quality of Python Machine Learning (ML) projects by means of static analysis of the project's repository.
Stars: ✭ 67 (-98.39%)
Mutual labels:  lint, linter, static-analysis
Gradle Code Quality Tools Plugin
Gradle plugin that generates ErrorProne, Findbugs, Checkstyle, PMD, CPD, Lint, Detekt & Ktlint Tasks for every subproject.
Stars: ✭ 282 (-93.24%)
Mutual labels:  gradle-plugin, lint, code-quality
Gradle Pitest Plugin
Gradle plugin for PIT Mutation Testing
Stars: ✭ 144 (-96.55%)
Mutual labels:  gradle-plugin, static-analysis, code-quality
D Scanner
Swiss-army knife for D source code
Stars: ✭ 221 (-94.7%)
Mutual labels:  linter, lint, static-analysis
flake8-broken-line
🚨 Flake8 plugin to forbid backslashes (\) for line breaks
Stars: ✭ 85 (-97.96%)
Mutual labels:  lint, linter, code-quality
codeclimate-eslint
Code Climate Engine for ESLint
Stars: ✭ 86 (-97.94%)
Mutual labels:  linter, static-analysis, code-quality
Pylint
It's not just a linter that annoys you!
Stars: ✭ 3,733 (-10.46%)
Mutual labels:  linter, static-analysis, code-quality
Njsscan
njsscan is a semantic aware SAST tool that can find insecure code patterns in your Node.js applications.
Stars: ✭ 128 (-96.93%)
Mutual labels:  linter, lint, static-analysis
Pmd
An extensible multilanguage static code analyzer.
Stars: ✭ 3,667 (-12.04%)
Mutual labels:  linter, static-analysis, code-quality
sonar-gherkin-plugin
SonarQube Cucumber Gherkin Analyzer
Stars: ✭ 33 (-99.21%)
Mutual labels:  linter, static-analysis, code-quality

detekt

Join the chat at #detekt on KotlinLang Visit the website at detekt.github.io/detekt/ Maven Central Gradle Plugin

Pre Merge Checks Codecov Awesome Kotlin Badge FOSSA Status

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 reports based on lines of code, cyclomatic complexity and amount of code smells
  • Highly configurable rule sets
  • Suppression of findings with Kotlin's @Suppress and Java's @SuppressWarnings annotations
  • Specification of quality gates which will break your build
  • Code Smell baseline and suppression for legacy projects
  • Gradle plugin for code analysis via Gradle builds
  • SonarQube integration
  • Extensibility by enabling incorporation of personal rule sets, FileProcessListener's and OutputReport's
  • IntelliJ integration
  • Third party integrations for Maven, Bazel and Github Actions (Docker based and Javascript based)

Project Website

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

Quick-Links

Quick Start ...

with the command-line interface

curl -sSLO https://github.com/detekt/detekt/releases/download/v[version]/detekt-cli-[version]-all.jar
java -jar detekt-cli-[version]-all.jar --help

You can find other ways to install detekt here

with Gradle

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

repositories {
    mavenCentral()
}

detekt {
    buildUponDefaultConfig = true // preconfigure defaults
    allRules = false // activate all available (even unstable) rules.
    config = files("$projectDir/config/detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
    baseline = file("$projectDir/config/baseline.xml") // a way of suppressing issues before introducing detekt
}

tasks.withType<Detekt>().configureEach {
    reports {
        html.required.set(true) // observe findings in your browser with structure and code snippets
        xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins
        txt.required.set(true) // similar to the console output, contains issue signature to manually edit baseline files
        sarif.required.set(true) // standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with Github Code Scanning
    }
}

// Groovy DSL
tasks.withType(Detekt).configureEach {
    jvmTarget = "1.8"
}
tasks.withType(DetektCreateBaselineTask).configureEach {
    jvmTarget = "1.8"
}

// or

// Kotlin DSL
tasks.withType<Detekt>().configureEach {
    jvmTarget = "1.8"
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
    jvmTarget = "1.8"
}

See maven central for releases and sonatype for snapshots.

If you want to use a SNAPSHOT version, you can find more info on this documentation page.

Requirements

Gradle 6.1+ is the minimum requirement. However, the recommended versions together with the other tools recommended versions are:

Detekt Version Gradle Kotlin AGP Java Target Level JDK Max Version
1.19.0 7.3.0 1.5.31 4.2.2 1.8 17

The list of recommended versions for previous detekt version is listed here.

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:

Custom rules and reports from 3rd parties:

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].