sonarqube-scanner
makes it very easy to trigger SonarQube
analyses on a JavaScript code base, without needing to install any specific tool
or (Java) runtime.
This module is analyzed on SonarQube.com using itself:
- See the Gulp file
- See the analysis results on SonarQube.com
This package is available on npm as: sonarqube-scanner
npm install sonarqube-scanner
The following example shows how to run a SonarQube analysis on a JavaScript project using Gulp, and pushing the results to SonarQube.com, the online SonarQube service:
var gulp = require('gulp');
var sonarqubeScanner = require('sonarqube-scanner');
gulp.task('default', function(callback) {
sonarqubeScanner({
serverUrl : "https://sonarqube.com",
token : "019d1e2e04eefdcd0caee1468f39a45e69d33d3f",
options : {}
}, callback);
});
Syntax: sonarqube-scanner ( parameters
, [callback
] )
parameters
MapserverUrl
String (optional) The URL of the SonarQube server. Defaults to http://localhost:9000token
String (optional) The token used to connect to the SonarQube server. Empty by default.options
Map (optional) Used to pass extra parameters for the SonarQube analysis. See the official documentation for more details.
callback
Function (optional) Callback (the execution of the analysis is asynchronous).
sonarqube-scanner
is licensed under the LGPL v3 License.