Why is this an issue?
Having all branches in an EVALUATE
or IF
chain with the same implementation is an error. Either a copy-paste error was
made and something different should be executed, or there shouldn’t be an EVALUATE
/IF
chain at all.
Noncompliant code example
EVALUATE X *> Noncompliant
WHEN 1
PERFORM SECTION1
WHEN OTHER
PERFORM SECTION1
END-EVALUATE.
IF X = 1 THEN *> Noncompliant
PERFORM SECTION1
ELSE
PERFORM SECTION1
END-IF.
Exceptions
Note that this rule does not apply to IF
chains without ELSE
-s, or to EVALUATE
-s without WHEN
OTHER
clauses.
IF X = 1 THEN *> //no issue, this could have been done on purpose to make the code more readable
PERFORM SECTION1
ELSE-IF X = 2 THEN
PERFORM SECTION1
END-IF.