Source code analysis for OpenEdge

Posted by Riverside Software on 17-Mar-2016 06:19

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

All Replies

Posted by cverbiest on 17-Mar-2016 06:39

Looks nice, I'm very glad to see this

Posted by sublam on 18-Mar-2016 04:55

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?

Posted by Stefan Drissen on 18-Mar-2016 05:17

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.

Posted by Riverside Software on 18-Mar-2016 08:56

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.

Posted by sublam on 18-Mar-2016 09:09

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.

Posted by Riverside Software on 21-Mar-2016 03:49

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.

Posted by sublam on 21-Mar-2016 04:25

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.

Posted by Riverside Software on 21-Mar-2016 04:43

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

Posted by sublam on 21-Mar-2016 05:08

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.

Posted by Gpandye on 04-Apr-2016 06:38

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?

Posted by Riverside Software on 04-Apr-2016 07:11

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 ?

Posted by Gpandye on 05-Apr-2016 09:02

Hi,

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

Posted by Etienne Begin on 05-Apr-2016 10:04

Thanks for sharing, sounds promising !

This thread is closed