- What language is this for? PL/SQL
- Which rule? Duplication - specifically duplicate blocks across files
- Why do you believe it’s a false-positive/false-negative? The functionality is different across each file
- Are you using
- SonarQube Server / Community Build - Enterprise
- How can we reproduce the problem?
- This can be recreated by introducing 2 or more create table commands in separate .sql files in one push.
- In our example, we have a handful of tables which share a selection of identical column names and data types. This is being flagged as duplicated code, when in reality there is no solution in pl/sql to this that would make any sort of sense.
- We cannot change the column names or types as they are being imported from an external source.
- Our current workaround is to exclude create table scripts from the analysis, however this is not a perfect solution.
Hi,
Welcome to the community!
Unfortunately your best option here is to exclude these files from duplication detection.
HTH,
Ann