Feature request: Marking code duplications as a false positive

Some of our repositories contain PHP files with custom SQL queries of 40+ lines.

We see that SonarCloud will often mark queries as duplicate. While the marked queries are similar, they are functionally different: the queries have different parameters, join different tables, have different fields.

In our opinion, these are false positives. For regular code inspection, we can mark such issues as false positives, but for code duplications this doesn’t seem possible.

Alternative solutions like excluding the files from inspection or extracting the parts of the query that are the same isn’t a feasible solution to us.

1 Like