...
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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 |
...