Qulaity gate for PR analysis

Hello Team,

We have our branch which has around 4000 lines of code and the duplication on that overall code is around 110 lines, which satisfies our duplication threshold on Quality Gates(should be less than 3%)

I have applied PR decoration on my release branches.

Now I raise a pull request against 1 branch to another which has 344 LOC in which 37 lines are duplicated, which comes upto 10.76% which is breaking my Quality Gate threshold and not allowing to merge the code.

Going forward in my next release, if I add 10 new lines and all those are duplicated then my duplication % will be 100 so increasing the duplication % threshold will not help us.
Could you please suggest how do we come across this? we want the PR analysis should run on overall branch code not just on the delta code.

Also when I go to see the duplicated lines it shows me empty lines as duplicated, how do I control this?

I am adding my colleague to follow up @sohailshaikh001


Hi Abhishek,

There are really 2 different topics here:

  • Using conditions on overall code in PR Quality Gates - feature request
  • Counting empty lines as duplicate.

On the first topic, I can tell you we have no plans to make this change.

Regarding the blank lines, I suggest you add a label to your OP with the language in question & re-categorize this post to Get Help / SonarQube.