How sonar adds custom Java rules

Source: Internet
Author: User

Reference:

1, 1190000008659108

2, Https://docs.sonarqube.org/display/DEV/Adding+Coding+Rules

3, Https://docs.sonarqube.org/display/DEV/Adding+Coding+Rules+using+Java

4, https://docs.sonarqube.org/display/PLUG/Writing+Custom+Java+Rules+101

There are two ways to extend code rules: But Java only supports mode 1

1. Writing coding rules using Java via a SonarQube plugin

2. Adding XPath rules directly through the SonarQube Web interface

Writing coding rules in Java is a six-step process:

    • Create a SonarQube plugin.
    • Put a dependency on the API of the language plugin for which is writing coding rules.
    • Create as many custom rules as required
    • Generate the SonarQube plugin (jar file)
    • Place this jar file in the sonarqube_home/extensions/plugins directory
    • Restart SonarQube Server

How sonar adds custom Java rules

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.