Code that is never executed is known as dead code. Typically, the presence of dead code indicates that a logic error has occurred as a result of changes to a program or the program's environment. Dead code is usually optimized out of a program during compilation. However, to improve readability and ensure that logic errors are resolved, dead code should be identified, understood, and eliminated.
...
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MSC07-C | lowLow | unlikelyUnlikely | mediumMedium | P2 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
| DEADCODE
| Can detect the specific instance where code can never be reached because of a logical contradiction or a dead "default" in Can detect the instances where code block is unreachable because of the syntactic structure of the code | |||||||
|
| Can detect violations of this recommendation when the | |||||||
| LV_UNUSED.GEN VA_UNUSED.* UNREACH.* |
| |||||||
| 1 J | Fully implemented | |||||||
PRQA QA-C |
| 0689 | Fully implemented | ||||||
|
| Can detect violations of this recommendation when the |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...