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

ClassNameCasing rule is not working as expected

Open Ton-Pe opened this issue 4 years ago • 5 comments

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.

Ton-Pe avatar May 07 '21 05:05 Ton-Pe

Do you have this problem with SonarQube or SonarLint ?

gquerret avatar May 07 '21 06:05 gquerret

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

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

Ton-Pe avatar May 07 '21 08:05 Ton-Pe

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

gquerret avatar May 07 '21 10:05 gquerret

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

Ton-Pe avatar May 07 '21 11:05 Ton-Pe

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

gquerret avatar May 17 '21 16:05 gquerret