Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion from DECIMAL to INT can overflow: not reported in PDSOE when decimal returned from METHOD #1102

Open
stefandrissen opened this issue Nov 23, 2023 · 7 comments

Comments

@stefandrissen
Copy link

I thought I had cleaned up everything in PDSOE only to find that there were still issues according to SonarQube server.

CLASS foo:

   METHOD DECIMAL bar ( i_c AS CHARACTER ):
      RETURN DECIMAL( i_c ).
   END METHOD.

   METHOD VOID nowarning ():

      DEFINE VARIABLE i AS INTEGER NO-UNDO.

      i = bar( '123':u ). // no warning in PDSOE, only in SonarQube server
      i = DECIMAL( '123':u ). // warning in PDSOE

   END METHOD.

END CLASS.

image

The source issue on the server:
image

@gquerret gquerret transferred this issue from Riverside-Software/sonar-openedge Dec 22, 2023
@gquerret gquerret transferred this issue from Riverside-Software/pct Dec 22, 2023
@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2023
@gquerret gquerret reopened this Dec 22, 2023
@gquerret
Copy link
Contributor

Should be fixed with SonarLint 7.13 or 9.1. Could you check in your environment ?

@stefandrissen
Copy link
Author

Updated to 9.1.2906 - still an issue:

image

@gquerret
Copy link
Contributor

Could this be related to this issue: #1105 ?
Do you see the issue intermittently ?

@stefandrissen
Copy link
Author

The tiny file above reproduces the issue, #1105 seems to be related to larger files?

@gquerret
Copy link
Contributor

It's in fact not directly related to the size of the file.

@stefandrissen
Copy link
Author

I now see that #1105 is marked as fixed in 9.1.2912 - the latest release, which I am using, is 9.1.2906.

@gquerret
Copy link
Contributor

9.1.2906 generates .sonarlint/rcc.txt with the list of known classes, and passes a property to SonarLint with this filename. However, that was dependant on the status of the PDSOE code model. In 9.1.2912, the property is always passed, even when the code model is not available when starting SonarLint.

So if you never the issue, check that rcc.txt contains your classname. You can delete the file, it will be regenerated. If this issue is reported intermittently, then upgrade to 9.1.2912 (I'll send a link soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants