user3108007
user3108007

Reputation: 31

How to add Rules to SonarQube?

How can I add rules to SonarQube (V4.5.2) via the web interface? The most easy and logical way would be to copy/duplicate an existing rule and then customize it, but I can not find this copy-functionality.

It is possible to add a new rule, but there is no way to add semantics to it here or to set the severity.

Upvotes: 2

Views: 6975

Answers (1)

Mithfindel
Mithfindel

Reputation: 4708

You will not be able to add arbitrary rules directly from the UI.

What is possible from the Rules page is:

  • Change activation parameters of en existing rule on a given profile
  • Create a custom rule using an existing rule template; this is the easiest way to customize behavior of rules, but this feature is limited to a restricted subset
  • Create a manual rule; these rules will not raise issues at analysis, but can be used to create manual issues on source code

If you need to develop completely custom rules (e.g non existing ones), you will need to develop a plugin and provide an implementation (using Java code) for your custom rules.

Upvotes: 4

Related Questions