How to add custom rules to sonarqube 5.1+

I have a requirement to add some more rules to the existing rules. But I can't find a way for the latest version of sonarqube ie 5.1+ Can someone tell me how to do this?

As we know in the latest version, we already have a rules sonavigator that gets in trouble when we run the sonar runner for any language plugin. I want to add some more rules to the existing rules that will be caught when the sonar starts.

Manual rules are like we need to do it manually.

I did a lot of research before posting the question.

+3


source to share


1 answer


First, the set of available rules is determined by the installed plugins, it does not depend on the SonarQube version.

Some language plugins support custom rules. As mentioned by benzonico, there is documentation available for writing custom rules . Custom rules can be written in Java or XPath depending on the language plugin.



If you don't want to write custom rules, you need to find a plugin that implements the rule you want. The PHP plugin is used to provide some integration with external tools such as PHPCodeSniffer and supports importing a quality profile via XML. However, as mentioned in the documentation for this plugin , this feature was removed in version 2.0.

0


source







All Articles