Skip to content

Commit f260b06

Browse files
nanotaboadaclaude
andcommitted
chore(ci): add .sonarcloud.properties for automatic analysis (#435)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9586e35 commit f260b06

1 file changed

Lines changed: 98 additions & 0 deletions

File tree

.sonarcloud.properties

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# =============================================================================
2+
# SonarCloud Automatic Analysis configuration
3+
# https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/automatic-analysis/
4+
#
5+
# SonarCloud's automatic analysis (GitHub App, no CI workflow) reads THIS file,
6+
# not sonar-project.properties. Wildcard patterns are NOT supported here, so
7+
# all exclusion paths must be listed explicitly.
8+
#
9+
# sonar-project.properties is kept for documentation and as a fallback if
10+
# CI-based analysis is ever introduced.
11+
# =============================================================================
12+
13+
sonar.sources=src/
14+
sonar.tests=test/
15+
sonar.sourceEncoding=UTF-8
16+
17+
# =============================================================================
18+
# Global exclusions
19+
# =============================================================================
20+
21+
sonar.exclusions=\
22+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs,\
23+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.Designer.cs,\
24+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs,\
25+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.Designer.cs,\
26+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs,\
27+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.Designer.cs,\
28+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs,\
29+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs,\
30+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/PlayerDbContextModelSnapshot.cs
31+
32+
# =============================================================================
33+
# Coverage exclusions
34+
# Test files and generated/infrastructure code should not count against
35+
# production code coverage metrics.
36+
# =============================================================================
37+
38+
sonar.coverage.exclusions=\
39+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs,\
40+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerServiceTests.cs,\
41+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerValidatorTests.cs,\
42+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/DatabaseFakes.cs,\
43+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerFakes.cs,\
44+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs,\
45+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerStubs.cs,\
46+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Usings.cs,\
47+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs,\
48+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.Designer.cs,\
49+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs,\
50+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.Designer.cs,\
51+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs,\
52+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.Designer.cs,\
53+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs,\
54+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs,\
55+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/PlayerDbContextModelSnapshot.cs,\
56+
src/Dotnet.Samples.AspNetCore.WebApi/Data/PlayerDbContext.cs,\
57+
src/Dotnet.Samples.AspNetCore.WebApi/Program.cs
58+
59+
# =============================================================================
60+
# Duplicate code (CPD) exclusions
61+
# Automatic analysis does not support wildcard patterns, so each file is
62+
# listed explicitly.
63+
#
64+
# Migrations — EF Core migration files are intentionally repetitive
65+
# (sequential InsertData/UpdateData/Sql calls).
66+
#
67+
# PlayerDbContext.cs — scaffolded EF Core infrastructure.
68+
#
69+
# PlayerData.cs — parallel WithId/without-Id method pairs mirror each other
70+
# by design; duplication is structural, not accidental.
71+
#
72+
# PlayerRequestModelValidator.cs — the "Create" and "Update" rule sets share
73+
# common rules by design; duplication is intentional.
74+
#
75+
# Test files — Fakes, Mocks, and Stubs are intentionally repetitive by design.
76+
# =============================================================================
77+
78+
sonar.cpd.exclusions=\
79+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs,\
80+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.Designer.cs,\
81+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs,\
82+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.Designer.cs,\
83+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs,\
84+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.Designer.cs,\
85+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs,\
86+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs,\
87+
src/Dotnet.Samples.AspNetCore.WebApi/Migrations/PlayerDbContextModelSnapshot.cs,\
88+
src/Dotnet.Samples.AspNetCore.WebApi/Data/PlayerDbContext.cs,\
89+
src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs,\
90+
src/Dotnet.Samples.AspNetCore.WebApi/Validators/PlayerRequestModelValidator.cs,\
91+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs,\
92+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerServiceTests.cs,\
93+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerValidatorTests.cs,\
94+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/DatabaseFakes.cs,\
95+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerFakes.cs,\
96+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs,\
97+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerStubs.cs,\
98+
test/Dotnet.Samples.AspNetCore.WebApi.Tests/Usings.cs

0 commit comments

Comments
 (0)