Detecting code smells with detekt
detekt is another static code analysis tool for Kotlin. It helps us identify problems early and keep the technical debt low throughout the development process. It enforces a set of rules that help us avoid code smells and technical debt. It also gives us the flexibility to create our own custom rule sets. Detekt offers the following features:
- It identifies code smell for Kotlin projects
- It’s easily configurable and customizable to suit our needs
- We can always suppress the warnings if we feel they are not applicable
- We can specify the code smell thresholds that we want to enforce
We will be using these features in our project. But before that, let us understand the rule sets. detekt has several rule sets that check the compliance of your code with the Kotlin style guide. The available rule sets are as follows:
- Comments: This rule set provides rules that address issues in comments and the documentation of the...