Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search



About code quality analysis


Code quality analysis helps you to make your code:

  • less error-prone
  • more sustainable
  • more reliable
  • more readable
  • more welcoming to new contributors

It is also a mandatory step for projects willing to enter the PolarSys Maturity Assessment, as the analysis process relies on code metrics extracted by SonarQube.


Code quality analysis mainly relies on a set of tools that look at your code and give you hints. The most famous tools are Findbugs, PMD, Checkstyle; but also code coverage tools such as JaCoCo. JDT itself provides very powerful quality checks, but there are not enabled by default. You should go to Error/Warnings in preferences and replace all "ignore" by "Warning". You can (and should) enable such tools in IDE.

Code quality can also be analyzed out of the IDE, running those tools and using their reports to find out the "hot spots" in your code.

About SonarQube

SonarQube (formerly known as Sonar) is an open-source product which is used to gather several metrics about code quality, put them all in a single dashboard, and provide some tips to help you making your code better, more sustainable, more reliable, less bugged. is the "cloud"-version of SonarQube hosted by SonarSource.

Setting up SonarQube/SonarCloud for projects

Eclipse SonarQube server has been shutdown in early September 2020
Due to relatively low demand and to reduce our maintenance overhead, we retired the Eclipse SonarQube server ( in early September 2020. We will support projects to migrate to
Please open a HelpDesk issue for this.

If your project wants to use, please open a HelpDesk issue to request it. Please specify for which exact project this should be setup.

The webmaster/releng team will create the respective repository for your project and add a SONAR_TOKEN to your project's GitHub repo or the SONARCLOUD_TOKEN to your project's Jenkins instance.


"Automatic analysis is only available for GitHub repositories and only for a subset of languages. Java, C#, C, C++, Objective-C, and most other compiled languages are not eligible for automatic analysis, while Javascript, Typescript, Python, and other interpreted languages are."

If the project's source code is hosted on GitHub, the built-in GitHub integration can be used for some languages (see Otherwise the project must have a Jenkins instance or use GitHub actions (see

See how to get a dedicated JIPP. You should first setup a normal build to make sure the project compiles correctly.

In Jenkins your build job needs to be modified as follows:

  • Job config
    • “Use secret text(s) or file(s)
      • Add -> Secret text
        • Select “SonarCloud token”
        • Variable: SONARCLOUD_TOKEN
  • "Prepare SonarQube Scanner environment" option needs to be enabled
  • In Maven build step, Goals:
clean verify -B sonar:sonar

sonar.projectKey and sonar.organization will need to be adapted individually.

Running mvn sonar:sonar in your Maven build will result in the following flow of actions:

  1. The Maven SonarQube plugin will locally analyze code and generate reports from many analyzers
  2. The Maven SonarQube plugin will push those reports to SonarCloud

Several Eclipse projects already have quality reports enabled. You can drill-down on code to see annotations on each class, or navigate through the different widgets on the dashboard to focus on specific issues.


By default only Eclipse Webmaster can administrate the analysis projects on If you need admin permissions on some analysis projects, please open a HelpDesk issue, specifying which analysis projects you want to administrate. The name of the analysis must be close enough to the project's name. If you are not the project lead, don't forget to ask for a +1.


The initial documentation referenced Mickael Istria's blog entry at . The information in it regarding the Eclipse process is outdated, but the article is still a good reading to understand how SonarQube works and what it can bring to you.

Back to the top