Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: minor grammar fixes

...

In this noncompliant code example, OUT_STR_LEN must always be exactly two greater than IN_STR_LEN. This is not obvious from the definitionsThe definitions fail to reflect this requirement.

Code Block
bgColor#FFcccc
public static final int IN_STR_LEN = 18;
public static final int OUT_STR_LEN = 12;

...

The definitions should reflect the lack independence of a relationship between the two constants.

Code Block
bgColor#ccccff
public static final int ADULT_AGE = 18;
public static final int ALCOHOL_AGE = 21;

...

Failure to properly encode relationships in constant declarations may can lead to unexpected values and may can complicate maintenance.

Guideline

Severity

Likelihood

Remediation Cost

Priority

Level

DCL03-J

low

unlikely

high

P1

L3

...