CWE-563 — Assignment to Variable without Use
CWE-563: Assignment to Variable without Use
MITRE CWE weakness
| Kind | Weakness |
| Abstraction | Base |
| Status | Draft |
| Likelihood of exploit | — |
Description
The variable's value is assigned but never used, making it a dead store.
After the assignment, the variable is either assigned another value or goes out of scope. It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.
Common consequences
- Other: Quality Degradation, Varies by Context
Mitigations
Implementation — Remove unused variables from the code.
References
- CWE page: https://cwe.mitre.org/data/definitions/563.html
- CWE list: https://cwe.mitre.org/data/index.html