Skip to end of metadata
Go to start of metadata

Could not retrieve - Page not found.


Enables the SonarRPG analyzer.

First Analysis of a RPG Project

  1. Install SonarQube Server (see Setup and Upgrade for more details)
  2. Install SonarQube Scanner and be sure your can call sonar-scanner from the directory where you have your source code
  3. Install SonarRPG (see Installing a Plugin for more details)
  4. Run your analysis with the SonarQube Scanner by executing the following command from the root directory of the project:

    sonar-scanner -Dsonar.projectKey=xxx -Dsonar.sources=.
  5. Follow the link provided at the end of the analysis to browse your project's quality in SonarQube UI

Further Analyses

Assuming steps 1-3 above have already been completed, you'll want to encapsulate your analysis parameters in a file at the root of your project (see a sample project on GitHub: Then subsequent analyses can simply be run with:




RPG Source Format

Depending on your extraction process, your RPG source files may include an extra margin on the left of the 80 columns used for code. This margin is in addition to the standard margin which takes up characters 1-5 in the 80-character source format. The extra margin is controlled through the sonar.rpg.leftMarginWidth property. By default, it is set to 12, which is the size of the margin in an IBM “source physical file”. If your RPG source files do not contain such margin, you should set sonar.rpg.leftMarginWidth to 0.

You can find an example file illustrating a 12-character margin in our sample project.

You should also make sure to set sonar.sourceEncoding to the appropriate encoding. Please check the documentation of this property.

Free-Form Support

Free-form is supported for C-specs and SQL statements. Free-form is not yet supported for H, F, D and P specs (which were added in IBM i 7.2). 

Custom Rules

See Custom Rules for RPG

  • No labels