Umbra Wiki weakness weakness/CWE-1126
Back to wiki

CWE-1126 — Declaration of Variable with Unnecessarily Wide Scope

provenance: imported · CWE: CWE-1126

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