Test a new rule without impact on Quality Gate

Hi,

I like to test a new rule in my codebase without impact on the Quality Gate (project gets red). Whether a rule works is often only clear after using it on the complete codebase.

I would like to set the rule temporary to Code Smell, Info, Effort to fix=0. Is this possible? In the UI it seems to be only possible to change the severity.

I saw the rule Status Beta but seems to be something different?
https://docs.sonarqube.org/latest/user-guide/rules/

Regards,
Günter

Hi Guenter,

The status is something different, and you can’t change the type of a rule, only of an issue.

Not knowing your QG, I can’t say for sure this will do what you want, but I’d do my trial runs with the severity set to Info. You can’t adjust the remediation / technical debt via the the UI, but the web services to allow that are still available.

 
HTH,
Ann

Hi Ann,

…but the web services to allow that are still available.

I were playing around with this but can’t find an web service for doing this. api/rules/update seems to work only for custom rules? Is there another REST API I missed?

Regards,
Günter

Hi Guenter,

Look at /api/rules/update. You want the remediation_* parameters. I’m not actually sure you can set it to 0min, but 1min is certainly possible.

 
HTH,
Ann

Hi Ann,

it’s not working with /api/rules/update.

  • changing type is not supported
  • severity can only be changed for custom rules

Regards,
Günter

Hi Guenter,

Yes, you’re right:

You can’t change default severity, only severity within the context of a profile.

 
HTH,
Ann