DebtRemediationFunction.Type.CONSTANT_ISSUE

Hello!

I am developing a plugin to analyze MuleSoft projects, properties files, RAML specs and some DataWeave issues. I am using sonar-plugin-api version 9.8.0.203 with SonarQube version 9.9.4.

I have a question about DebtRemediationFunction. According to the documentation, the type CONSTANT_ISSUE is defined as:

The cost to fix all the issues of the rule is the same whatever the number of issues of this rule in the file. Total remediation cost by file = constant

If I understand this correctly, when I set the baseEffort parameter to 1h on a rule using DebtRemediationFunction.Type.CONSTANT_ISSUE, if a file has 3 issues from this rule, the remediation effort should be 1h, shown in the UI as debt. This seems straightforward, but it is not the result I’m getting.

In my test example, I have one file with two issues, and another file with one issue. I would expect to have a total of 2 hours technical debt, 1 for each file. But I’m getting a total of 3 hours. 1 hour per issue.

What am I missing here? How does the CONSTANT_ISSUE differ from LINEAR with a gap multiplier of 1?

Thank you!

Hey @Eduardo_Marques!

What we really mean here (and what some French guy meant to write a decade ago) is that the cost will be the same for each individual issue. This is meant for issues where every instance of the issue will cost about the same to fix, which is not true for issues using LINEAR or LINEAR_OFFSET which scale based on the complexity of the individual issue.

So this behavior:

Is correct.