I want to write a custom SonarQube rule for Java. The example on how to do that mentions a json file to configure that rule. Here you see a json code from that tutorial:
{
"title": "Return type and parameter of a method should not be the same",
"type": "Bug",
"status": "ready",
"tags": [
"bugs",
"gandalf",
"magic"
],
"defaultSeverity": "Critical"
}
When I look at the UI of the SonarQube server, I also see something which is called “SoftwareQuality” as a further attribute of my rule. Since I did not configure it in the json file, it is set to the default “Maintainability”. But I want it to have the value “Reliability”. How must I configure the json file to achieve that?
Point taken that we ought to update the custom rules tutorial to handle these new attributes. I anticipate we’ll do that before (but probably not long before) the next LTA release.
In the meantime, you can check the open-source sonar-java repo to see how these rules are configured with software qualities and impacts.