Description / Features
The Issues Report plugin provides the ability to run preview SonarQube analyses on your machine. The main use case is for developers to check the code they have added or changed before pushing it back to the SCM.
It generates an HTML report that displays a list of issues that can be filtered by severity, new issues only (comparison made against the latest version available on the remote server), etc.
It supports all languages.
Here's an example of HTML report (you can download the full report here):
- Install the plugin through the Update Center or download it into the SONARQUBE_HOME/extensions/plugins directory
- Restart the SonarQube server
Basically, the way to run an analysis and a preview is the same. Copy the analysis configuration file (sonar-project.properties, pom.xml, etc.) that is used to analyze the project on the remote server to your local machine. Make sure that the
sonar.sources property refers to the directory containing the source code on your local machine (or update it accordingly). The tree structure of the source code on your local machine must match the tree structure that has been remotely analyzed by SonarQube. Finally, run a local analysis:
To get a local report:
- To get an HTML report, set the
true. To define its location, set the
sonar.issuesReport.html.locationproperty to an absolute or relative path to the destination for the HTML report. The default value is .sonar/issues-report.html for the SonarQube Runner and Ant, and target/sonar/issues-report.html for Maven.
- To display a short report in the console, set the
A useful feature is to limit the scope of the analysis to the files that have been created or modified. To do so, the
sonar.inclusions property can be set.