sonarqubesonarqube6.3

Declare custom rule type as Vulnerability in SonarQube 6.3


I am using sonarQube 6.3 and when adding new custom rules for Php or Javascript, they are by default declared as Code smell. I would like to declare them as Vulnerability or bug.

Here is an example of a rule declaration

@Rule(key = "Rule1", priority = Priority.MAJOR, name = "Rule 1 sould be used.", tags = {"suspicious" })

Is there a way to do it?


Solution

  • There is a way to set the rule type using some special tags.

    So try for example:

    tags = {"suspicious", "bug"}
    

    NB: This is documented in API Javadoc (but hard to find I admit)