Introduction
This document describes how to add source code to a SonarQube project
- Using plain source code
- Without using a repository management system (e.g., BitBucket, Git)
- Without using a Continuous Integration tool (e.g., Bamboo, Jenkins)
Adding your source code to the newly created project and analysing it with SonarQube
Steps:
1- Go to the main page of "Projects" to find your newly added project. Next, click on "Configure analysis".
...
Analyzing with SonarQube Scanner: More info available here.
5a- The analysis itself will be performed by running the sonar-scanner application on your local system (the system which also hosts the source code of that project). If you have not already downloaded sonar-scanner you can do that now by pressing the "Download" button.
...
- -Dsonar.projectKey: the project key as defined in Step 3 here
- -Dsonar.sources: the local directory path to the source code to be analysed
- -Dsonar.host.url: the URL to GEANT's SonarQube instance (there's no need to change this)
- -Dsonar.login: the token as provided by the system in Step 3 above
...
7- Please note that following the process as described above will run the SonarQube analysis on your source code only once. The analysis will not be repeated (unless you perform step "5c" manually again). In order to have SonarQube regularly analyse your source code you need to have it linked to a Continuous Integration (CI) process such as GitLab CI.
Getting help:
- For more details we recommend to visit the user documentation provided by SonarQube
- WP9 T2 provides the dedicated Slack channel #sonarqube-code-review to help users with any issues they may face