Custom plugin : debt remediation is not calculated during analysis

Hello,

i developed a custom plugin, but the debt remediation is not calculated, knowing that i have lot of different issues raised during the analysis. All of those issues are of type “func = Linear” and “LinearFactor = XYmin” . I always see a value of zero in sonar dashboard

Here is a sample of json file describing the settings of one issue { "title": "Caches should be used", "type": "BUG", "status": "ready", "remediation": { "func": "Linear", "linearFactor": "15min" }, "tags": [ "pitfall", "confusing", "unused" ], "defaultSeverity": "Critical", "sqKey": "GW-CACHE-01", "scope": "Main" }
Am i missing some other specific configuration somewhere ?

Regards,

Hi,

Do you set a gap on the issues?

For a linear remediation cost, debt = gap x factor

Hi, no i did not see any gap at all
I assumed that the gap was only for LINEAR_OFFSET.
Hmm, i have to check how to set it then

I use this SonarXmlCheck.reportIssue(…) to add new issues.
I have no possibility (apparently) to set the gap afterwards.
It is possible to set it up directly from the JSON file definition ?

Actually, i even just noticed that when i also use func : “Constant/Issue” with “constantCost” , the debt remediation is not calculated neither.
I think that the issue is even somewhere else { "title": "foobar", "type": "BUG", "status": "ready", "remediation": { "func": "Constant\/Issue", "constantCost": "55min" }, "tags": [ "clumsy", "bad-practice", "user-experience", "design" ], "defaultSeverity": "Critical", "sqKey": "GW-POL-04", "scope": "Main" }

@Julien_HENRY, well i noticed another interesting thing actually :slight_smile:
The debt remediation is calculated correctly actually, i can see in the “Issues” tab (See screenshot) … 4 issues of 5 min ==> 20 min (so far, so good !)


But in the overview tab, the “Debt” related values are all set to zero !
image

image

Any idea about the reason why i can’t see the exact value directly in the Overview main page ?

Regards,

I’m not sure, but to me Maintainability measures are only about Code Smells. Since your issue is of type “Bug”, it won’t be counted in the debt.

Indeed, you’re right. I close this issue.
Only the code smells are counted for that part.