mkrussel
11/22/2021, 7:49 PM1.19.0-RC1
on my Android project.
The type resolution tasks cannot find Android classes so they report many false positives.
For example
val sensorManager: SensorManager = context.getSystemService() ?: return null
val sensor = sensorManager.getDefaultSensor(sensorType) ?: return null
Reports unreachable code for everything after the first ?: return null
because it cannot find the type of context
and seems to assume that it always returns null.
See UnsafeCast
warnings also when checking and then casting for classes that extend View
.
Is there any configuration that I can do to make detekt find the Android classes during type resolution?gammax
11/22/2021, 7:58 PM