Giter Club home page Giter Club logo

sonar-javascript's Introduction

SonarQube JavaScript Build Status

This is the plugin for the SonarQube platform which provides static analysis of JavaScript code. It will allow you to produce stable and easily supported code by helping you find and correct bugs, vulnerabilities and smells in your code.

Features

Useful links

Have question or feedback?

To provide feedback (request a feature, report a bug etc.) use the SonarQube Google Group. Please do not forget to specify the language (JavaScript!), plugin version and SonarQube version. If you have a question on how to use plugin (and the docs don't help you) direct it to StackOverflow tagged both sonarqube and javascript.

Contributing

Topic in SonarQube Google Group

To request a new feature, please create a new thread in SonarQube Google Group. Even if you plan to implement it yourself and submit it back to the community, please start a new thread first to be sure that we can use it.

Pull Request (PR)

To submit a contribution, create a pull request for this repository. Please make sure that all tests are passing (Travis build is created for each PR).

Custom Rules

If you have an idea for a rule but you are not sure that everyone needs it you can implement a custom rule available only for you.

Testing

To run tests locally follow these instructions

Build the Project and Run Unit Tests

To build the plugin and run its unit tests, execute this command from the project's root directory:

mvn clean install

Integration Tests

To run integration tests, you will need to create a properties file like the one shown below, and set its location in an environment variable named ORCHESTRATOR_CONFIG_URL.

# version of SonarQube Server
sonar.runtimeVersion=5.2

orchestrator.updateCenterUrl=http://update.sonarsource.org/update-center-dev.properties

Plugin Test

The "Plugin Test" is an additional integration test which verifies plugin features such as metric calculation, coverage etc. To launch it:

mvn clean install -Pit-plugin

Ruling Test

The "Ruling Test" is a special integration test which launches the analysis of a large code base, saves the issues created by the plugin in report files, and then compares those results to the set of expected issues (stored as JSON files).

  • To run the test, first make sure the submodules are checked out:
  git submodule init 
  git submodule update
  • Launch ruling test
mvn clean install -Pit-ruling

This test gives you the opportunity to examine the issues created by each rule and make sure they're what you expect. You can inspect new/lost issues checking web-pages mentioned in the logs at the end of analysis:

INFO  - HTML Issues Report generated: /path/to/project/sonar-javascript/its/sources/src/.sonar/issues-report/issues-report.html
INFO  - Light HTML Issues Report generated: /path/to/project/sonar-javascript/its/sources/src/.sonar/issues-report/issues-report-light.html

If everything looks good to you, you can copy the file with the actual issues located at

sonar-javascript/its/ruling/target/actual/

into the directory with the expected issues

sonar-javascript/its/ruling/src/test/resources/expected/

sonar-javascript's People

Contributors

lindamartin avatar vilchik-elena avatar godin avatar pynicolas avatar dbolkensteyn avatar ehartmann avatar eriksnukis avatar tomverin avatar simonbrandhof avatar mpaladin avatar julienlancelot avatar gaudol avatar fmallet avatar ganntest avatar agabrys avatar bellingard avatar henryju avatar pwillworth avatar tnguyen1 avatar uny avatar kengotoda avatar lindada avatar

Watchers

Markus Heberling avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.