Enables the SonarRPG analyzer.
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=.
Assuming steps 1-3 above have already been completed, you'll want to encapsulate your analysis parameters in a sonar-project.properties file at the root of your project (see a sample project on GitHub: https://github.com/SonarSource/sonar-scanning-examples/tree/master/sonarqube-scanner). Then subsequent analyses can simply be run with:
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 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).
See Custom Rules for RPG