How we completely rewrote our static code analyzer for Kotlin
May 04, 2023
47 min
Free
kotlin
psi
semantic-analysis
sonar
android-lint
static-analysis
code-analysis
compiler
abstract-syntax-tree
kotlin-compiler
developer-tools
Description
Marharyta Nedzelska discusses the challenges and process behind completely rewriting Sonar's static code analyzer for Kotlin. The talk delves into the technical decisions, architectural changes, and the lessons learned from moving from a cross-language AST approach to a Kotlin-specific one utilizing PSI. It covers issues encountered with nullability, naming conventions in the compiler API, handling compiler diagnostics, and performance optimizations, particularly around the 'commented out code' rule. The presentation highlights the importance of community feedback and the ongoing evolution of static analysis tools for languages like Kotlin.