I want to understand little bit about How duplications metrics on new code works in Sonarqube.
If I see lines of code marked as duplicate under the “New Code” section, does it mean the lines of code are duplicate in the same file or across all the files considered as new code?
Yes I can see the duplication details marked with grey. My question was more on-if a block of new code is marked as duplicate, which files are being referred to while identifying this block as new code - All files marked under New Code or All files under overall code?
Assume there are 100 files in my enentire repo. Out of which 5 files are shown under new code due to changes made say File1, File2, File3, File4 & File5.
Now in File 5 there is a block of 20 lines of code marked as Duplicate by SonarQube.
My question is - how is the duplicate code identified?
Does it check this block of 20 codes against the 5 files under new code
OR
Does it compare it with all 100 files in the Repo?
Yes, duplication detection is run against the entire code base. And then out of all duplications found, the ones that happen on new code are reported as duplications on new code.