sonar-openedge icon indicating copy to clipboard operation
sonar-openedge copied to clipboard

Nested IF THEN ELSE without DO block

Open MadMx57 opened this issue 4 years ago • 1 comments

It would be a good idea to add a rule to track the following ambiguous code in imbricated IF THEN ELSE.

Exemple :

IF myLogical THEN IF myOtherLogical THEN RUN first.p. ELSE RUN second.p.

Even if for expert eyes it is obvious to know to which IF the ELSE is referring to, I think it is a good idea to avoid such code (even if it is properly indented).

MadMx57 avatar Aug 10 '20 17:08 MadMx57

Rule IfIndent should help. But the current implementation doesn't report anything with this indentation:

IF condition THEN
  IF condition2 THEN
    MESSAGE "1".
ELSE
  MESSAGE "2".

While indentation is wrong.

gquerret avatar Aug 11 '20 10:08 gquerret

Fixed as part of issue #1039

gquerret avatar Apr 12 '23 11:04 gquerret