-
Notifications
You must be signed in to change notification settings - Fork 26
Getting started
- A quick installation guide is available here.
- The full installation guide is available here.
- The OpenEdge plugin is supported on 6.x version (minimum 6.6, 6.7 highly recommended) and 7.x (7.9 being the current version)
When SonarQube is up and running, you can download and install the OpenEdge plugin and Riverside rules from https://github.com/Riverside-Software/sonar-openedge/releases/latest. Installation is done by dropping the JAR files in $SONAR_HOME/extensions/downloads
. The commercial set of rules (riverside-rules package) requires a license. Don't install this JAR file if you only want to test the open-source part.
After having restarting SonarQube, you should see the plugins in the Update Center:
A server ID is mandatory to execute the commercial rules, so follow the instructions to generate a server ID. If you don't plan to execute commercial rules, you can safely skip this step.
In order to get an evaluation license, please send an email to [email protected] with:
- Your name and contact details
- Your company name
- The server ID
You'll receive an answer in the next 24 hours.
The OpenEdge plugins only work if you build your applications using Ant and PCT, as they expect a specific directory structure for the build directories. Describing how to setup Ant and PCT builds is out of the scope of this document.
<PCTCompile destdir="target/build" listing="true" xmlXref="true" keepXref="true" relativePaths="true">
<fileset dir="src/openedge" includes="**/*.p,**/*.w,**/*.cls" />
<propath location="src/openedge" />
<DBConnection dbName="xxx" dbDir="db" singleUser="true" />
</PCTCompile>
Please note that standard XREF files are not analyzed, only XML XREF are.
You can use any framework to execute unit tests, but getting code coverage requires generating profiler output. This can achieved with the Profiler attribute in PCT :
<!-- A simple example using PCTRun, but you can use ABLUnit, ProUnit or OEUnit -->
<PCTRun procedure="unit-tests/test-suite.p">
<propath location="target/build" />
<!-- Use dedicated directory for profiler output -->
<Profiler enabled="true" outputDir="target/profiler" coverage="true" />
<DBConnection dbName="xxx" dbDir="db" singleUser="true" />
</PCTRun>
This example will generate a profiler file (including coverage information) for each session in the profiler
directory.
Download and unzip SonarQube scanner, then make sure that you have the bin
directory in your PATH.
Create a sonar-project.properties
file in order to describe the project to SonarQube:
# Unique key
sonar.projectKey=companyName:projectKey
# Display name in SonarQube
sonar.projectName=Project name
sonar.projectVersion=1.0
sonar.projectDescription=...
# Comma-separated list of directories - Dump contains .df files, and src/openedge contains source code
sonar.sources=dump,src/openedge
# Comma-separated list of patterns to be excluded
sonar.exclusions=src/procedures/sample/excl/**
sonar.sourceEncoding=iso8859-1
# Directory where r-code can be found
sonar.oe.binaries=target/build
# Comma-separated list of PL or directories
sonar.oe.propath=src/openedge
# OpenEdge installation path (see next property)
sonar.oe.dlc=/path/to/dlc
# Append $DLC/gui, $DLC/tty and $DLC/src to the propath
sonar.oe.propath.dlc=true
# Comma-separated list of full DF files
sonar.oe.databases=dump/sp2k.df
# Semi colon separated list of entries, each entry is a comma-separated list of aliases (first entry is the db name)
sonar.oe.aliases=sp2k,db1,db2
# No Copy-Paste Detection on DF files
sonar.cpd.exclusions=dump/**
# Set to true to generate token listing in .tokens subdirectory
sonar.oe.cpd.debug=false
# Set to true to generate AST for each file in .proparse subdirectory
sonar.oe.proparse.debug=false
# Default extensions are .p, .w, .i and .cls. Use this option if you have additional extensions to analyze
# sonar.oe.file.suffixes=p,w,t
# Comma-separated list of directories where *.out files will be parsed for code coverage
sonar.oe.coverage.profiler.dirs=target/profiler
The list of properties is described here.
Analysis can then be triggered from your shell:
cd </path/to/project>
sonar-scanner
Depending on the size of the project, you may have to increase -Xmx parameter. A usual setting for 10k files codebase is -Xmx2048m
.
© Riverside Software 2013-2024