I am using sonarqube *6.7.5, sonar java plugin *5.7 (build 15470)
I analyze one of my maven project and it returns positive value for duplication on sonar dashboard.
But, when I try to get quality gate from API, it return different result with negative value.
If my understanding is correct, you’ve configured your Quality Gate using the metric Duplicated Lines (%), and you’ve checked the On New Code checkbox.
This can lead to such negative values, because it’s doing a diff between current value and value found in the leak.
So if the Duplicated Lines (%) measure decreased between 2 analysis, you’ll get a negative measure.
You should instead use the Duplicated Lines on New Code (%) metric, this will be a far more accurate result !
@julienlancelot yes, it is still 0%
I assume it won’t be displayed if it is 0% or it is a new period but it never has any value yet? I check some of my project, even quality gate is passed, it still displayed duplicated value.
Btw I have some other question about quality gate and it doesn’t belong this topic. If you know this issue, please help me. Here is the link