在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:SonarSource/sonar-java开源软件地址:https://github.com/SonarSource/sonar-java开源编程语言:Java 93.6%开源软件介绍:Code Quality and Security for JavaThis 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 Sonar 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. ContributingTopic in SonarQube Community ForumTo 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 RulesIf 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 usWould you like to work on this project full-time? We are hiring! Check out https://www.sonarsource.com/hiring TestingTo run tests locally follow these instructions. Java versionsYou need Build the Project and Run Unit TestsTo build the plugin and run its unit tests, execute this command from the project's root directory:
Integration TestsTo 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
With for instance the
Before running the ITs, be sure your MAVEN_HOME environment variable is set. Sanity TestThe "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:
Plugin TestThe "Plugin Test" is an integration test suite which verifies plugin features such as metric calculation, coverage etc. To launch it:
Beware that some tests, specifically the Ruling TestThe "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:
Launch ruling test:
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.
All the
Into the directory with the expected issues:
For example using the command:
Debugging Integration TestsYou can debug ITs by adding LicenseCopyright 2012-2022 SonarSource. Licensed under the GNU Lesser General Public License, Version 3.0 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论