CWE-1126 — Declaration of Variable with Unnecessarily Wide Scope
CWE-1126: Declaration of Variable with Unnecessarily Wide Scope
MITRE CWE weakness
| Kind | Weakness |
| Abstraction | Base |
| Status | Incomplete |
| Likelihood of exploit | — |
Description
The source code declares a variable in one scope, but the variable is only used within a narrower scope.
Common consequences
- Other: Reduce Maintainability, Increase Analytical Complexity
Mitigations
(none listed)
References
- CWE page: https://cwe.mitre.org/data/definitions/1126.html
- CWE list: https://cwe.mitre.org/data/index.html