Source code analysis for OpenEdge - Forum - OpenEdge General - Progress Community

Source code analysis for OpenEdge

 Forum

Source code analysis for OpenEdge

  • The first beta version of the OpenEge plugin for SonarQube is available !

    SonarQube is an extensible platform to manage code quality, and Riverside Software is proud to release this plugin for the OpenEdge language !

    The list of features can be seen from this page, and the getting started page will let you execute your first analysis in a few minutes. More pages will be added in the following days, but if you're interested in having more details about this plug-in, please contact us at contact@riverside-software.fr

  • Looks nice, I'm very glad to see this

  • Wow this is great news :)

    I was looking through the current rules and i can think of some more that would be very useful.

    What is the best place to suggest new rules?

    Will there be documentation on how to implement custom rules?

  • A small issue concerning the strategy of compiling debug-listings. When include arguments are passed:

    { i.i &defines-only = true }
    &if defined( defines-only ) = 0 &then
       function myfunc returns logical in {1}.
    &endif

    The debug listing (stripped of line numbers) is then:

    &if defined( defines-only ) = 0 &then
      function myfunc returns logical in true.
    &endif

    Since the debug listing does not have the defines, the line which should not be compiled, is.

    The work-around is to promote the include arguments to actual preprocessors:

    &scoped-define defines-only true
    { i.i }

    This could be considered a bug in the debug-list option of the compiler, but I suppose debug-listings were never considered to be compile units.

  • Thanks Stefan for reporting this issue ! The debug listing step will probably be optional in the future, we're working on that !

    sublam : documentation on Confluence will enhanced during the next days and weeks, and will include instructions on how to write new rules. For rules suggestions, please send an email to contact@riverside-software.fr and we'll open an account on Confluence.

  • Thank you for you answer.

    I tried to setup the analysis but i ran into an issue.

    The analysis doesn't seem to recognice any of my db tables that are referenced in the code.

    I get error messages like "Unknown table name: Customer"

    I have set the property with the full df dump in my buildscript like this:

    <property name="sonar.oe.databases" value="${env.WORKSPACE}\Schema\Dump.df" />

    The second problem i have is that the analyzer cant seem to find the debug listing files. i get the error

    Can not analyze debug listing file C:\Buildfolder\Build\.dbg 

    But the files are present in the C:\Buildfolder\Build\.dbg  folder.

  • Hi sublam :

    * Do you use the Ant task or the SonarRunner job ?

    * Can you double-check the value of sonar.oe.databases in your script ?

    * Can you enable the verbose mode ? With the Ant task, just add '-v' in your command line, and with the SonarRunner add '-X' to the java command line. Here's what I'm getting with this verbose switch on a demo project :

        [java] 09:43:52.107 INFO  - Using schema : dump/sp2k.df:abc,dump/empty.df:newdb

        [java] 09:43:52.114 DEBUG - Parsing C:\Users\gquer\Projets\sonar-test-project\dump\sp2k.df with alias abc

        [java] 09:43:52.357 DEBUG - Parsing C:\Users\gquer\Projets\sonar-test-project\dump\empty.df with alias newdb

        [java] 09:43:52.380 DEBUG - Adding sp2k aliases to database abc

        [java] 09:43:52.381 DEBUG - Adding db2 aliases to database newdb

    I assume the debug listing problem might be related to the first one.

    And just in case, environment variables are not expanded in .properties files IIRC.

  • I am using the ant task.

    I activated the verbose mode and looked through the logs again and i get the following message:

    [sonar:sonar] Using schema : C:\Jenkins\workspace\Sonar_Test\Schema\Dump.df

    [sonar:sonar] Unable to write proparse.schema file

    The path to the df is correct.

  • Could you try using a relative path instead of an absolute path ? I think there might an issue with Windows absolute paths.

  • Thank you that was the problem.

    Still getting a few errors in the analysis, but i think these are just some unsupported keywords.

    I will create tickets on github for these errors.

  • HI,

    i am using sonar runner, i tried with 10 programs, it did worked and generated analysis, i then ran with large set of programs and got below error -

    ERROR: Error during SonarQube Scanner execution

    java.lang.NumberFormatException: For input string: "-("

           at java.lang.NumberFormatException.forInputString(NumberFormatException.

    java:65)

           at java.lang.Integer.parseInt(Integer.java:492)

    ...

    ...

    I searched for "-(" character in my programs, found 4 programs, so i did ran for those programs only, it ran without any error.

    Any idea? what is the issue?

  • Hello,

    The stack trace is too short to have any valuable information. Would you be able to post it here, or open an issue on github.com/.../issues ?

  • Hi,

    Thanks for reply, i have created an issue on github - github.com/.../9

  • Thanks for sharing, sounds promising !