Riverside-Software / sonar-openedge

CABL (Code Analyzer for ABL in SonarQube) - ABL ANTLR4 Parser
https://riverside-software.fr
GNU Lesser General Public License v3.0
62 stars 25 forks source link

Flow-control statements in FINALLY block rule does not raise an issue if FINALLY block, or flow-control statement, is inside the include #1128

Open Ton-Pe opened 1 month ago

Ton-Pe commented 1 month ago

Quite a minor issue, but wanted to report this. If the whole finally block, or flow-control statement, is inside an include file the error is not shown.

For example, this is not reported as an error: test.p

DEFINE VARIABLE xError AS LOGICAL NO-UNDO.

{finally.i}

finally.i

FINALLY:
   IF xError THEN RETURN ERROR.
END FINALLY.

Neither is this: test.p

DEFINE VARIABLE xError AS LOGICAL NO-UNDO.

FINALLY:
   {finally.i}
END FINALLY.

finally.i

   IF xError THEN RETURN ERROR.

Following code works as expected and error is reported:

DEFINE VARIABLE xError AS LOGICAL NO-UNDO.

FINALLY:
   IF xError THEN RETURN ERROR.
END FINALLY.
gquerret commented 1 month ago

Is that in SonarLint or in SonarQube ?

Ton-Pe commented 1 month ago

First problem, at least, is in both. Second example was tested only in Sonarlint.

OE plugin installed is 2.26.1. SonarQube version v9.9.5. OpenEdge 12.8 and SonarLint 9.3.3006