CWE Database
/

CWE-1126

Back to CWE list

CWE-1126

Declaration of Variable with Unnecessarily Wide Scope

Base
Incomplete

Description

The source code declares a variable in one scope, but the variable is only used within a narrower scope.

Common Consequences

Scope

Other

Impact

Reduce Maintainability, Increase Analytical Complexity

Applicable Platforms

Not Language-Specific

Security Training

Train your team to recognize and prevent security threats with our comprehensive security awareness program.

Start Training

Vulnerability Scanning

Discover vulnerabilities in your applications and infrastructure before attackers do.

Scan Now