Common Weakness Enumeration

    CWE Definition / CWE-1126

    CWE-1126: Declaration of Variable with Unnecessarily Wide Scope

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

    Published:2 Jul 2018
    Organization:MITRE
    Modified:11 Dec 2025

    Related Weakness

    CWE-710: Improper Adherence to Coding Standards