Full documentation for SonarQube has moved to a new location: http://docs.sonarqube.org/display/SONAR

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 77 Next »

Description / Features

The Issues Report plugin provides the ability to generate HTML report on issues.

The main use case is for developers to check the code they have added or changed before pushing it back to the SCM.

Here's an example of HTML report (you can download the full report here):

Issues can then be filtered by severity, new issues only, etc.

SonarQube Eclipse Plugin

Icon
Note that while the Issues Report plugin supports every language, there is also support for certain languages within the IDE. The SonarQube plugin for Eclipse supports Java, C/C++ and Python. The SonarQube plugin for IntelliJ supports Java.

Installation

  1. Install the plugin through the Update Center or download it into the SONARQUBE_HOME/extensions/plugins directory
  2. Restart the SonarQube server

Usage

As the main use case is for developers to check the code they have added or changed before pushing it back to the SCM, the Issues Report plugin is usually used in preview mode. This is this usage that is detailed below.

Install your favorite analyzer (SonarQube RunnerMaven or Ant) on your local machine. You only have to set the sonar.host.url property to point to your remote SonarQube server (connection settings to the remote database do not have to be provided for a preview analysis as no data is pushed to the database). Note that you don't need to install any SonarQube server on your local machine.

Copy the 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. 

To get an HTML report, set the sonar.issuesReport.html.enable property to true. To define its location, set the sonar.issuesReport.html.location property 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 sonar.issuesReport.console.enable property to true:

Finally, run a preview analysis that generates an HTML report:

 

Even more useful, you can limit the scope of the analysis to the files that have been recently created or modified (i.e. incremental mode):

 

 

Icon
If you'll be running incremental analysis of very large projects, you may need to increase the SonarQube server's maximum heap size. In SONARQUBE_HOME/conf/wrapper.conf increase the value of wrapper.java.maxmemory.

  • No labels