---
name: detekt
description: "Use when adopting detekt to assess this standard: Check Kotlin complexity and code smells"
---

# Apply detekt

Enable rules appropriate for the Kotlin modules in scope. Track complexity and potential defects with the committed Gradle configuration.

## Procedure

1. Inspect the repository configuration and identify the files or targets covered by detekt.
2. Use detekt in this repository to meet this standard: Check Kotlin complexity and code smells. Enable rules appropriate for the Kotlin modules in scope. Track complexity and potential defects with the committed Gradle configuration. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.
3. Record the tool version, configuration, scope and findings. Explain any checks that could not run.
4. Use the same invocation after changes and compare the evidence against the baseline.

Refer to [the upstream documentation](https://detekt.dev/) for configuration and prerequisites.

## Tool invocation

```
./gradlew detekt
```
