Skip to content

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

Open

Description

@stefandrissen

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

Activity

  1. transferred this issue fromprogress/pcton Dec 22, 2023
  2. gquerret commented on Jan 15, 2024

    @gquerret
    Collaborator

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

  3. stefandrissen commented on Jan 18, 2024

    @stefandrissen
    Author

    Updated to 9.1.2906 - still an issue:

    image

  4. gquerret commented on Jan 18, 2024

    @gquerret
    Collaborator

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

  5. stefandrissen commented on Jan 18, 2024

    @stefandrissen
    Author

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

  6. gquerret commented on Jan 18, 2024

    @gquerret
    Collaborator

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

  7. stefandrissen commented on Jan 18, 2024

    @stefandrissen
    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.

  8. gquerret commented on Jan 19, 2024

    @gquerret
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions