How to set parameters in multicriteria in sonar-project.properties

Must-share information (formatted with Markdown):

  • which versions are you using: “Enterprise Edition Version 9.1 (build 47736)”
  • what are you trying to achieve:
    I’ve existing checks in my “sonar-project.properties”, for example.
sonar.issue.ignore.multicriteria.r1.ruleKey=java:S1135
sonar.issue.ignore.multicriteria.r1.resourceKey=**

There are certain rules that need parameters.

I’m not sure how to give this parameter via sonar-project.properties.

  • what have you tried so far to achieve this:

Tried to find any documentation related to the same but couldn’t find anything useful.

Hey there.

When you’re ignoring an issue on multiple criteria, you’re telling SonarQube to not raise issues on that rule entirely (you can get more fine-grained than that, such as not to raise issues on that rule except on a certain threshold).

So using the same format for S1541 as you’ve shown for S1135 should work just fine.

Hi Kolin,

Apologies if I was not clear on what I’m trying to achieve. The particular rule, I want is disabled, I’m trying to enable it via sonar-project.properties.

sonar.issue.ignore.multicriteria.r2.ruleKey=java:S1541
sonar.issue.ignore.multicriteria.r2.resourceKey=**
sonar.issue.ignore.multicriteria.r2.Threshold=5 # <--- This isn't working. 

I want to know, how can I pass custom parameter to this.

Hey there.

Ignoring issues on multiple criteria only works to suppress issues. It can’t be used to turn a rule on. To do that (without affecting the original Quality Profile) – you’d want to extend the existing profile and enable the rule.