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 25 forks source link

ClassNameCasing rule is not working as expected #885

Open Ton-Pe opened 3 years ago

Ton-Pe commented 3 years ago

This rule ClassNameCasing is not working as expected. Well, it works like described in rule definition, but not like I thought it should based on fixed issue https://github.com/Riverside-Software/sonar-openedge/issues/716

I have a class named SystemDatasetModel.cls

On class definition wrong casing is flagged correctly CLASS foo.bar.systemdatasetmodel: But not in other use cases. So all examples below are not flagged, but they should:

USING foo.bar.systemdatasetmodel FROM PROPATH.
DEFINE VARIABLE xSystem AS systemdatasetmodel NO-UNDO.
DEFINE VARIABLE xSystem2 AS SYSTEMDATASETMODEL NO-UNDO.
xSystem  = NEW Systemdatasetmodel(mApplId, mSysId).
xSystem2 = NEW SYSTEMDATASETMODEL(mApplId, mSysId).

Also it should flag the wrong case in class definition when inheriting or implementing. So CLASS Digia.Util.UnitTestHelper INHERITS basesbo: Is not flagged currently. (class to inherit is BaseSbo.cls)

Rules version 2.13.0, SonarLint version 5.5.1509, OE version 12.2.

gquerret commented 3 years ago

Do you have this problem with SonarQube or SonarLint ?

Ton-Pe commented 3 years ago

SonarLint. SonarQube seems to flag at least variable definitions correctly.

Edit: SonarLint flags CATCH statement correctly ie. CATCH xError AS Progres.Lang.error

gquerret commented 3 years ago

This rule is based on rcode. If the rcode is not available in the build directory, then the rule will not report an issue.

Ton-Pe commented 3 years ago

I do have rcode available. Rcode is saved into source directory in PDS.

I also just finished testing on SonarQube and the problem is also with SonarQube. See attached image. Only that CATCH statement is reported. image

gquerret commented 3 years ago

Can you turn verbose mode in SonarQube analysis and verify the rcode is read correctly ?