CWE-1126

Declaration of Variable with Unnecessarily Wide Scope
AI Translation Available

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

Status
incomplete
Abstraction
base

Common Consequences

other
Impacts
reduce maintainability increase analytical complexity

Detection Methods

automated static analysis

Potential Mitigations