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
63 stars 26 forks source link

Check that buffer is correctly accessed in WHERE clause rule #1126

Open Ton-Pe opened 6 months ago

Ton-Pe commented 6 months ago

Rule: BufferUsageInWhereClause Following find statement raises an issue: "WHERE clause does not have any reference to buffer ProdRes"

 FIND FIRST ProdOper OF ProdOrder WHERE
          CAN-FIND(FIRST ProdRes OF ProdOper WHERE  ProdRes.Qtyrep = YES).

Looks like that the rule does not recognize the OF statement that is used in the CAN-FIND part of the WHERE clause.

If I write the can-find without OF, issues is not raised

FIND FIRST ProdOper OF ProdOrder WHERE
          CAN-FIND(FIRST ProdRes WHERE ProdRes.PrOrderNum = ProdOper.PrOrderNum AND ProdRes.Qtyrep = YES).
gquerret commented 6 months ago

Thanks for the report, will be fixed !