Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{iframe:src=http://updateredirect.sonarsource.orgcom/plugins/issuesreport.html|width=700|height=250300|frameborder=0}
YourDocumentation browser does not support iframes.
{iframe}

Description / Features

The Issues Report plugin provides the ability to run local 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 that you can download:

Image Removed

Info
titleSonar Eclipse Plugin
Note that to perform local analyses, a SonarQube Eclipse plugin is also available. It currently supports Java, C/C++ and Python.

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

Note that you do not need to install any SonarQube server and database on your local machine. Just install and configure your favorite analyzer (SonarQube RunnerMaven or Ant).

Basically, the way to run remote and local analyses is the same. Copy on your local machine the analysis configuration file (sonar-project.properties, pom.xml, etc.) that is used to analyze the project on the remote server. 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:

Code Block
languagebash
# Set the "sonar.dryRun" property to "true" to run a local analysis
sonar-runner -Dsonar.dryRun=true

To get a local report:

...

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.
In the following example, SonarQube will only check the myCobolProgram.cbl Cobol program. The analysis will be local: nothing will be pushed to the database, thus the results will not be available through the SonarQube server web interface. An HTML report will be generated to display the list of issues on the myCobolProgram.cbl file:

 

Code Block
languagenone
sonar-runner -Dsonar.dryRun=true -Dsonar.issuesReport.html.enable=true -Dsonar.inclusions=myCobolProgram.cbl
Note
titleMulti-module project compatibility
Note that the Issues Report plugin is not yet compatible with multi-module projects. See https://jira.codehaus.org/browse/SONARPLUGINS-2805.

 

Change Log

...

has been moved to [http://redirect.sonarsource.com/plugins/issuesreport.html].
{iframe}