Skip to end of metadata
Go to start of metadata

Live example

Icon

If you want to see a live example of the capabilities of the JavaScript plugin, you can have a look at the analysis of the jQuery project on Nemo.

Description / Features

The plugin enables analysis of JavaScript projects with SonarQube.

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

Run an Analysis with the SonarQube Runner (Recommended method)

To run an analysis of your JavaScript project, use the SonarQube Runner.

A sample project is available on GitHub that can be browsed or downloaded: /projects/languages/javascript/javascript-sonar-runner.

Run an Analysis with the other Analyzers

Maven and Ant can also be used to launch analysis on JavaScript projects.

Code Coverage

To display code coverage data:

  1. Prior to the SonarQube analysis, execute your unit tests and generate the LCOV report.
  2. Import this report while running the SonarQube analysis by setting the sonar.javascript.lcov.reportPath property to the path to the LCOV report. The path may be absolute or relative to the project base directory.

A sample project can be browsed or downloaded: /projects/languages/javascript/javascript-sonar-runner-lcov

Metrics

See Metrics documentation page.

Extending Coding Rules using XPath

New coding rules can be added using XPath. See the related documentation.

To navigate the AST, download the SSLR JavaScript Toolkit.

Release Notes

Version 1.5

It is no longer possible to:

  • let SonarQube drive the execution of unit tests
  • import unit test execution reports
  • No labels