Skip to content

Commit 90383a5

Browse files
nanotaboadaclaude
andcommitted
ci(sonar): exclude validator from CPD to suppress intentional duplication
The "Create" and "Update" rule sets in PlayerRequestModelValidator share common rules by design; each operation's validation is intentionally kept self-contained for readability. // NOSONAR only suppresses rule-based issues and has no effect on CPD metrics, so the file is listed under sonar.cpd.exclusions instead. Co-authored-by: Claude <noreply@anthropic.com>
1 parent b32c56d commit 90383a5

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

sonar-project.properties

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,19 @@ sonar.coverage.exclusions=\
4343

4444
# =============================================================================
4545
# Duplicate code (CPD) exclusions
46-
# Test utilities (Fakes, Mocks, Stubs) are intentionally repetitive by design:
47-
# each operation gets its own factory method and the similarity between
48-
# arrange/act/assert blocks across tests is expected and harmless.
46+
# NOTE: // NOSONAR suppresses rule-based issues (bugs, code smells, security
47+
# hotspots) but has no effect on CPD metrics. Files must be listed here to be
48+
# excluded from duplicate code detection.
49+
#
50+
# test/**/*.cs — Fakes, Mocks, and Stubs are intentionally repetitive by
51+
# design; similarity between arrange/act/assert blocks across tests is
52+
# expected and harmless.
53+
#
54+
# **/Validators/PlayerRequestModelValidator.cs — the "Create" and "Update"
55+
# rule sets share common rules by design; the duplication is intentional to
56+
# keep each operation's validation self-contained and readable.
4957
# =============================================================================
5058

51-
sonar.cpd.exclusions=test/**/*.cs
59+
sonar.cpd.exclusions=\
60+
test/**/*.cs,\
61+
**/Validators/PlayerRequestModelValidator.cs

0 commit comments

Comments
 (0)