Enabling and overriding debug feature Medium

Don't enable or override an application's debug feature. Instead, use OS environment variables to set up the debug feature.

Detector ID
kotlin/detect-activated-debug-feature@v1.0
Category
Common Weakness Enumeration (CWE) external icon

Noncompliant example

1// Noncompliant: The Debug feature should not be enabled or overridden.
2fun noncompliant() {
3    WebView.setWebContentsDebuggingEnabled(true)
4}

Compliant example

1// Compliant: The Debug feature should not be enabled or overridden.
2fun compliant() {
3   WebView.setWebContentsDebuggingEnabled(false)
4}