detekt alternatives and similar libraries
Based on the "Tools" category.
Alternatively, view detekt alternatives based on common mentions on social networks and blogs.
-
kotlin-android-template
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = ❤️ -
jtransc
Bytecode to source converting Java & Kotlin code into JavaScript, C++, D, C#, PHP, AS3, Dart and Haxe and run it everywhere. Also use JVM code in your favourite language as a library. -
CrunchyCalendar
A beautiful material calendar with endless scroll, range selection and a lot more! -
Ostara
Ostara is a cross-platform desktop app for managing and monitoring Spring Boot applications using the Actuator API, providing comprehensive insights and effortless control. -
MpApt
(Deprecated) :wrench: Kotlin Native/JS/JVM Annotation Processor library for Kotlin compiler plugins -
BlurTutorial
Library for creating blur effects under Android UI elements -
ktfmt-gradle
A Gradle plugin to apply ktfmt to your builds, and reformat you Kotlin source code like a glimpse 🧹🐘 -
LiveStream-Kt (Android) 📱
LiveStream is a simple class which makes communication easy among different modules of your application. -
Kotlin Telegram Bot
Telegram Bot API wrapper with handy Kotlin DSL. -
ComposeRecyclerView
Seamlessly integrate Jetpack Compose composables in RecyclerView with ComposeRecyclerView🔥. This library enhances performance⚡, tackles LazyList issues🔨, and offers built-in drag-and-drop👨🏽💻 support for dynamic UIs. -
detekt-hint
Detection of design principle violations in Kotlin as a plugin to detekt. -
AnimatedBottomBarCompose
Cool animated navigation bars for your compose android app. -
ARFaceDetection
AR-based library for Android which is capable of detecting faces and overlaying images above the user’s head -
Kotlin Bootstrap
This set of libraries is designed to help developers accomplish various tasks easier and faster -
Credit Card Scanner
Android Credit Card Scanner using CameraX and ML Kit -
GradleMavenPush
Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Central, Corporate staging/snapshot servers and local Maven repositories). -
EasyDokkaPlugin
Gradle Script plugin to generate documentation by Dokka documentation engine in Javadoc or other formats for Java, Kotlin, Android and non-Android projects. It's very easy, you don't need to add to dependencies section additional classpath or think about compatibility issues, you don't need additional repositories also. -
KotlinW
A small wrapper for the Kotlin compiler that can be used to execute .kts scripts -
AndroidOtpView (With gradient color in lines)
Android Otp View with gradient in kotlin -
buildSrcVersions
Better Gradle dependencies management inside the IDE. Search for available updates.
InfluxDB - Power Real-Time Data Analytics at Scale
Do you think we are missing an alternative of detekt or a related project?
README
detekt
Meet detekt, a static code analysis tool for the Kotlin programming language. Visit the project website for installation guides, rule descriptions, configuration options and more.
[detekt in action](website/static/img/tutorial/detekt_in_action.png "detekt in action")
Features
- Code smell analysis for your Kotlin projects.
- Highly configurable rule sets.
- Code Smell baseline and suppression for legacy projects.
- Suppression of findings with
@Suppress
annotations. - Support for different report formats: html, markdown, SARIF and xml (checkstyle). Is it not enough? You can extend detekt and create your own reports.
- Extensibility by enabling incorporation of personal rule sets,
FileProcessListener's
andOutputReport's
. - Complexity reports based on lines of code, cyclomatic complexity and number of code smells.
- First party integration with Gradle with our Gradle plugin.
- A community of third party plugins that adds more rules and features to detekt.
Quick-Links
- Changelog and migration guides
- Available CLI options
- Rule set and rule descriptions
- Writing custom rules and extending detekt
- Suppressing issues in code
- Suppressing issues via baseline file
- Configuring detekt
- Sample Gradle integrations examples:
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
md.required.set(true) // simple Markdown format
}
}
// 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.7.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.21.0 |
7.5 |
1.6.21 |
7.2.1 |
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 the 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.
Contributing
See [CONTRIBUTING](.github/CONTRIBUTING.md)
Thanks to all the people who contributed to detekt!
Mentions
As mentioned in...
- driodcon London 2021 - Detekt - State of the Union
- KotlinConf 2018 - Safe(r) Kotlin Code - Static Analysis Tools for Kotlin by Marvin Ramin
- droidcon NYC 2018 - Static Code Analysis For Kotlin
- Kotlin on Code Quality Tools - by @vanniktech Slides Presentation
- Integrating detekt in the Workflow
- Check the quality of Kotlin code
- Kotlin Static Analysis Tools
- Are you still smelling it?: A comparative study between Java and Kotlin language by Flauzino et al.
- Preventing software antipatterns with Detekt
Integrations:
- IntelliJ integration
- SonarQube integration
- Codacy
- Gradle plugin that configures Error Prone, Checkstyle, PMD, CPD, Lint, Detekt & Ktlint
- Violations Lib is a Java library for parsing report files like static code analysis.
- sputnik is a free tool for static code review and provides support for detekt
- Gradle Static Analysis plugin
- Detekt Maven plugin that wraps the Detekt CLI
- Detekt Bazel plugin that wraps the Detekt CLI
- Gradle plugin that helps facilitate GitHub PR checking and automatic commenting of violations
- Codefactor
- GitHub Action: Detekt All
- GitHub Action: Setup detekt
- Sonatype Lift
Custom rules and reports from 3rd parties can be found on our Detekt Marketplace.
Credits
- JetBrains - Creating IntelliJ + Kotlin
- PMD & Checkstyle & ktlint - Ideas for threshold values and style rules