Disable Sonar duplications on Entity, DTO packages
With a newer SonarQube installation, you can use sonar.cpd.exclusions
to exclude certain files only from duplicate checks.
See: https://docs.sonarqube.org/latest/analysis/analysis-parameters/
Example:
sonar.cpd.exclusions=**/AssemblyInfo.cs,**/*.g.cs,**/Mappings/*.cs
You can exclude resources using the standard "sonar.exclusions" parameter or use the Switch Off violation plugin to exclude "Duplicated code" violations.
Note that the 2nd option (use of the switch off plugin) works only if you're using the SQALE plugin, which embeds the "sqale-java:DuplicatedBlocksCheck" rule.