lint/kotlin-detekt-strict
detekt enforces the exception and size rules
| Severity | warning |
| Tiers | all |
| Stacks | kotlin |
| Scope | each |
| Kind | expr |
| Source | library v0.0.0-20261011205826-ecb4e9b3ffd4 |
| Selected by | fleetlint-recommended@0.1.0 |
Requirement
The detekt configuration sets active: true for every rule in params.required (ruleset.Rule): swallowed and too-generic exceptions, empty catch blocks, method length and cognitive complexity. detekt --generate-config writes a full configuration to edit.
Why
The compiler accepts a swallowed exception and a 400-line method; detekt is the only place these are refused, and only when the rules are on.
Applies when
exists("**/detekt*.yml") || exists("**/detekt*.yaml")Check
For each item in:
params.requiredglob("**/detekt*.y*ml").exists(f, yaml(f) != null
&& item.split(".")[0] in yaml(f)
&& item.split(".")[1] in yaml(f)[item.split(".")[0]]
&& has(yaml(f)[item.split(".")[0]][item.split(".")[1]].active)
&& yaml(f)[item.split(".")[0]][item.split(".")[1]].active == true)Parameters
required:[exceptions.SwallowedException exceptions.TooGenericExceptionCaught empty-blocks.EmptyCatchBlock complexity.LongMethod complexity.CognitiveComplexMethod]
Fix
Set the reported rules to active: true in the detekt configuration (thresholds: LongMethod 50, CognitiveComplexMethod 15).
Agent instruction: Set each reported rule to active: true in the detekt configuration and fix the findings it produces instead of adding a baseline entry.
See: https://fleetlint.org/stacks/#kotlin-jvm--android
Generated by fleetlint docs from catalog v0.0.0-20261011205826-ecb4e9b3ffd4.