Skip to content

Commit 037bd8e

Browse files
committed
Exclude generated OpenAPI models from SonarCloud duplication (CPD) check
Context: The generated model classes under com/adyen/model/<api>/** follow a repetitive OpenAPI Generator template (getters/setters, equals/hashCode/ toString, isSet* flags, getExplicitNulls, toJson/fromJson). Sonar's Copy-Paste Detection flags huge numbers of duplicated blocks across these files, e.g. CI run: https://github.com/Adyen/adyen-java-api-library/actions/runs/29031747289/job/86166267497?pr=2002 logged 'Too many duplication references ... Keep only the first 100 references' for hundreds of blocks, all within com/adyen/model/**. This duplication is a byproduct of code generation, not a real maintenance risk, and drowns out genuine duplication signal in hand-written code. Change: Add sonar.cpd.exclusions=**/com/adyen/model/*/** to pom.xml, using the same glob already applied to sonar.coverage.exclusions for consistency. This only removes generated model packages from the duplication metric; Sonar still analyzes them for bugs, vulnerabilities, and code smells, and hand-written code (serializer packages, services, httpclient, etc.) remains fully covered by duplication detection.
1 parent 965db3d commit 037bd8e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
3333
<sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
3434
<sonar.coverage.exclusions>**/com/adyen/model/*/**</sonar.coverage.exclusions>
35+
<sonar.cpd.exclusions>**/com/adyen/model/*/**</sonar.cpd.exclusions>
3536

3637
<!-- Dependency Versions -->
3738
<!-- Compile -->

0 commit comments

Comments
 (0)