Duplicate lines on HTML

We started getting Quality Gate failures for duplicate lines of code on HTML. Since UI elements can be similar from page to page, this is going to happen. And HTML doesn’t have the ability to share parts of HTML between pages. So what’s the best way to handled this?

Hello @mjremijan ,

indeed, that doesn’t make sense in some HTML contexts and leads to annoying results.
However, you can exclude all HTML files or only selected files from the Copy Paste Detection (CPD).
To do so, you can either ignore files in the SonarQube UI under General Settings > Analysis Scope > Duplications using e.g. **/*.html, or make this restriction directly in your sonar-project.properties using the sonar.cpd.exclusions property.

Best,
Nils