SonarQube Java :: ITS :: Semantic :: Java Debugging Plugin

Java Debugging plugin used to declare helper rules

License

License

Categories

Categories

Java Languages
GroupId

GroupId

org.sonarsource.java
ArtifactId

ArtifactId

java-debugging-plugin
Last Version

Last Version

6.6.0.22815
Release Date

Release Date

Type

Type

sonar-plugin
Description

Description

SonarQube Java :: ITS :: Semantic :: Java Debugging Plugin
Java Debugging plugin used to declare helper rules
Project URL

Project URL

http://redirect.sonarsource.com/plugins/java.html/java-debugging-plugin
Project Organization

Project Organization

SonarSource

Download java-debugging-plugin

Dependencies

compile (1)

Group / Artifact Type Version
com.google.guava : guava jar 26.0-jre

provided (2)

Group / Artifact Type Version
org.sonarsource.sonarqube : sonar-plugin-api jar 7.9
org.sonarsource.java : sonar-java-plugin sonar-plugin 6.6.0.22815

test (3)

Group / Artifact Type Version
org.sonarsource.java : java-checks-testkit jar 6.6.0.22815
junit : junit jar 4.13
org.assertj : assertj-core jar 3.8.0

Project Modules

There are no modules declared in this project.

Code Quality and Security for Java Build Status Quality Gate Coverage

This SonarSource project is a code analyzer for Java projects. Information about the analysis of Java features is available here.

Features

Useful links

Have question or feedback?

To provide feedback (request a feature, report a bug etc.) use the SonarQube Community Forum. Please do not forget to specify the language (Java!), plugin version and SonarQube version.

If you have a question on how to use plugin (and the docs don't help you), we also encourage you to use the community forum.

Contributing

Topic in SonarQube Community Forum

To request a new feature, please create a new thread in SonarQube Community Forum. 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 you follow our code style and all tests are passing (all checks must be green).

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. Note that in order to help you, we highly recommend to first follow the Custom Rules 101 tutorial before diving directly into implementing rules from scratch.

Work with us

Would you like to work on this project full-time? We are hiring! Check out https://www.sonarsource.com/hiring

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 the url pointing to its location in an environment variable named ORCHESTRATOR_CONFIG_URL.

# version of SonarQube Server
sonar.runtimeVersion=7.9

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

# Location of Maven local repository is not automatically guessed. It can also be set with the env variable MAVEN_LOCAL_REPOSITORY.
maven.localRepository=/home/myName/.m2/repository

With for instance the ORCHESTRATOR_CONFIG_URL variable being set as:

export ORCHESTRATOR_CONFIG_URL=file:///home/user/workspace/orchestrator.properties

Before running the ITs, be sure your MAVEN_HOME environment variable is set.

Sanity Test

The "Sanity Test" is a test which runs all checks against all the test sources files without taking into account the result of the analysis. It verifies that rules are not crashing on any file in our test sources. By default, this test is excluded from the build. To launch it:

mvn clean install -P sanity

Plugin Test

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

mvn clean install -Pit-plugin

Ruling Test

The "Ruling Test" are an integration test suite 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:

cd its/ruling
mvn clean install -DskipTests=false

This test gives you the opportunity to examine the issues created by each rule and make sure they're what you expect. Any implemented rule is highly likely to raise issues on the multiple projects we use as ruling code base.

  • For newly implemented rule, it means that a first build will most probably fail, caused by differences between expected results (without any values for the new rule) and the new results. You can inspect these new issues by searching for files named after your rule (squid-SXXXX.json) in the following folder:

      /path/to/project/sonar-java/its/ruling/target/actual/...
    
  • For existing rules which are modified, you may expect some differences between "actual" (from new analysis) and expected results. Review carefully the changes which are shown and update the expected resources accordingly.

All the json files contain a list of lines, indexed by file, expliciting where the issues raised by a specific rule are located. If/When everything looks good to you, you can copy the file with the actual issues located at:

its/ruling/target/actual/

Into the directory with the expected issues:

its/ruling/src/test/resources/

For example using the command:

cp its/ruling/target/actual/* its/ruling/src/test/resources/

License

Copyright 2012-2020 SonarSource.

Licensed under the GNU Lesser General Public License, Version 3.0

org.sonarsource.java

SonarSource

Continuous Code Quality

Versions

Version
6.6.0.22815
6.5.1.22586
6.5.0.22421
6.4.0.21967
6.3.2.22818
6.3.0.21585
6.2.0.21135
6.1.0.20866
6.0.2.20657
6.0.1.20589
6.0.0.20538
5.14.0.18788
5.13.1.18282
5.13.0.18197
5.12.1.17771
5.12.0.17701
5.11.0.17289
5.10.2.17019
5.10.1.16922
5.10.0.16874
5.9.2.16552
5.9.1.16423
5.9.0.16391
5.8.0.15699
5.7.0.15470
5.6.1.15064
5.5.0.14655
5.4.0.14284
5.3.0.13828
5.2.0.13398
5.1.1.13214
5.1.0.13090
5.0.1.12818
5.0.0.12796
4.15.0.12310
4.14.0.11784
4.13.0.11627
4.12.0.11033
4.11.0.10660