Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Parasoft C/C++test 10.4

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

DCL06-C

Low

Unlikely

Medium

P2

L3

Automated Detection

Tool

Version

Checker

Description

Compass/ROSE



Could detect violations of this recommendation merely by searching for the use of "magic numbers" and magic strings in the code itself. That is, any number (except a few canonical numbers: −1, 0, 1, 2) that appears in the code anywhere besides where assigned to a variable is a magic number and should instead be assigned to a const integer, enum, or macro. Likewise, any string literal (except "" and individual characters) that appears in the code anywhere besides where assigned to a char* or char[] is a magic string

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.DCL06

Fully implemented

LDRA tool suite
Include Page
LDRA_V
LDRA_V

201 S

Fully implemented

Parasoft C/C++test
Include Page
Parasoft_V
Parasoft_V
CODSTA-26

CERT_C-DCL06-a

Avoid magic numbers

Fully implemented

Polyspace Bug FinderR2016a

Hard coded buffer size, Hard coded loop boundary

Size of memory buffer is a numerical value instead of symbolic constant

Loop boundary is a numerical value instead of symbolic constant

PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v

3120
3121
3122
3123
3131
3132

Partially implemented

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

...