False positives in duplications

Good morning.

As we have seen in the last few with our clients, we need a bit more control over duplicates, in order to be able to select if a duplicate is indeed a duplicate or not.

We have run into situations where a js template, such as react components is taken as a duplicate. We have also had problems with some Swagger annotations.

In those situations, we must exclude the entire file, which leads to losing any actual duplicates in that file.

Therefore, we felt it would be useful to be able to:

  • Mark a duplicate block or even a duplicate line as a “false positive” and have it disregarded.
  • Select a file to be disregarded for duplicates directly in the user interface, and not via sonar.cpd.exclusions.

Thank you,