---
title: JavaScript – Avoid Use Of Debugger Statements – UI Policy scriptTrue
description: "Impact Area Security Severity High Affected Element UI Policy ## Rule number **SN-0338** ## Impact The debugger statement can be placed anywhere in procedures to suspend execution. Using the debugger statement is similar to setting a breakpoint in the code.…"
url: "https://community-staging.qualityclouds.com/qcdocs/qcr/rules/javascript-avoid-use-of-debugger-statements-ui-policy-scripttrue/"
updated: "2025-03-21"
category: Best Practices Rules / JavaScript Rules
---

# JavaScript – Avoid Use Of Debugger Statements – UI Policy scriptTrue

Impact Area

Security

           Severity

High

           Affected Element

UI Policy

## Rule number

**SN-0338**

## Impact

The debugger statement can be placed anywhere in procedures to suspend execution. Using the debugger statement is similar to setting a breakpoint in the code. By definition such statement must absolutely be removed from the source code to prevent any unexpected behavior or added vulnerability to attacks in production.

## Remediation

Remove all debugger statements from your code.

### Time to fix

10 min

## References

This rule is linked to [Common Weakness Enumeration CWE-489 Leftover Debug Code](https://cwe.mitre.org/data/definitions/489.html).

## Code examples

### Noncompliant code

for (i = 1; i<6; i++) { // Print i to the Output window. Debug.write(“current loop index is ” + i); // Wait for user to resume. debugger; }

### Compliant code

for (i = 1; i<6; i++) { // Print i to the Output window. Debug.write(“current loop index is ” + i); }
