...
Failure to minimize scope could result in less reliable, readable, and reusable code.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
DCL19-C | Low | Unlikely | Medium | P2 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Astrée |
| local-object-scope global-object-scope | Partially checked | ||||||
| CodeSonar |
| LANG.STRUCT.SCOPE.FILE | Scope could be file static | ||||||
| CC2.DCL19 | Fully implemented | |||||||
| LDRA tool suite |
| 25 D, 61 D, 40 S | Fully implemented | ||||||
| Parasoft C/C++test |
|
|
| OPT-01 |
| Implemented | ||||||||
| PRQA QA-C |
| 1504, 1505, 1531, 1532, 3210, 3218 |
| RuleChecker |
| local-object-scope global-object-scope | Partially checked |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
| SEI CERT C++ Coding Standard | VOID DCL07-CPP. Minimize the scope of variables and methods |
| MISRA C:2012 | Rule 8.9 (advisory) |
...
...