Static Code Analysis For Kotlin
summary
Detekt is a static analysis tool for Kotlin that plugs into Gradle and uses a YAML config to enable rule sets, thresholds and reports; it runs locally via a git pre-commit hook or on CI and can fail builds when issues exceed a max. Under the hood it builds a PSI tree from the Kotlin compiler and traverses it with a KT tree visitor to implement rules like unsafe call nullable and use data class, plus examples: a data-class-no-methods rule and a too-many-functions threshold (default 11).
AI-written summary · about
chapters (7)
- 0:00Introduction to static analysis
- 1:11Legacy code conversion challenges
- 5:28Setting up Detekt in project
- 12:27How Detekt works under the hood
- 22:33Implementing custom rules
- 34:13Benefits of PSI exploration
- 36:02Closing and Q&A
related talks
42mSafe(r) Kotlin Code - Static Analysis Tools for Kotlin
41mDetekt - State of the Union
22mKotlin on Code Quality Tools
37mKotlin on Code Quality Tools
41mKotlin Static Analysis with Android Lint
47mComputer Says No — Static analysis and CI in a Kotlin world
45mComputer Says No - Static Analysis and CI in a Kotlin Word
47mHow we completely rewrote our static code analyzer for Kotlin
