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

Features

FeatureScreenshot
Static code analysis with JSLint
 Expand...

Unit test and code coverage reports with JsTestDriver
 Expand...

 

Code metrics:

  • sizing (files, lines of code)
  • duplication
  • comments
  • cyclomatic complexity (function complexity, file complexity, complexity density)
 Expand...

 

Usage & Installation

Installation

  1. Install JavaScript plugin through Update Center
  2. Restart Sonar

Analysis with Maven

Create a maven pom for your project and run "mvn sonar:sonar" to run analysis and import JsTestDriver results

Sample pom.xml

Sample JavaScript project analysis with Maven

  1. Checkout http://javascript-plugin-for-sonar.googlecode.com/svn/trunk/sample

  2. Update <browser> in pom.xml to point to browser where JavaScript unit tests should be run

  3. Run "mvn test" to execute JsTestDriver unit tests and gather code coverage statistics
  4. Run "mvn sonar:sonar" to analyse JavaScript code and import unit test results

Analysis with simple Java runner

  1. Download latest version of Simple Java Runner
  2. Create sonar-project.properties file for your project

 

Sample sonar-project.properties

Sample JavaScript project analysis with Simple Java Runner

  1. Checkout https://javascript-plugin-for-sonar.googlecode.com/svn/trunk/sample-simple-runner

  2. Change "<base_dir>" placeholders to actual path in sample JsTestDriver coverage file "jstestdriver/jsTestDriver.conf-coverage.dat"

  3. Run "sonar-runner"

Unit Tests and Code Coverage Reports

Unit test and code coverage reports produced by JsTestDriver. Integrated through jstd-maven-plugin.

Changelog

Error rendering macro 'jiraissues' : JIRA project does not exist or you do not have permission to view it.

Release 0.4 (5 issues)
Type Key Summary Priority Status Resolution
Bug SONARPLUGINS-1625 NullPointer on loading test file Major Closed Fixed
New Feature SONARPLUGINS-1587 Support of JsTestDriver unit test execution and code coverage reports should be added Major Closed Fixed
Bug SONARPLUGINS-1319 Doesn't work with SCM Plugin Major Closed Fixed
Bug SONARPLUGINS-1295 Cannot specify sonar.javascript.lslint.predef in POM Major Closed Fixed
Bug SONARPLUGINS-1139 Cannot define multiple predefined variables Major Closed Fixed

Release 0.3 (1 issues)
Type Key Summary Priority Status Resolution
New Feature SONARPLUGINS-1006 Migrate JavaScript plugin from code.google.com to Codehaus Minor Closed Fixed

Roadmap Ideas

 

Labels
  • None