|
| 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 | +# Wildcard patterns are NOT supported here, so all exclusion paths must be |
| 7 | +# listed explicitly. |
| 8 | +# ============================================================================= |
| 9 | + |
| 10 | +sonar.sources=src/ |
| 11 | +sonar.tests=test/ |
| 12 | +sonar.sourceEncoding=UTF-8 |
| 13 | + |
| 14 | +# ============================================================================= |
| 15 | +# Global exclusions |
| 16 | +# ============================================================================= |
| 17 | + |
| 18 | +sonar.exclusions=\ |
| 19 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs,\ |
| 20 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.Designer.cs,\ |
| 21 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs,\ |
| 22 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.Designer.cs,\ |
| 23 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs,\ |
| 24 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.Designer.cs,\ |
| 25 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs,\ |
| 26 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs,\ |
| 27 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/PlayerDbContextModelSnapshot.cs |
| 28 | + |
| 29 | +# ============================================================================= |
| 30 | +# Coverage exclusions |
| 31 | +# Test files and generated/infrastructure code should not count against |
| 32 | +# production code coverage metrics. |
| 33 | +# ============================================================================= |
| 34 | + |
| 35 | +sonar.coverage.exclusions=\ |
| 36 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs,\ |
| 37 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerServiceTests.cs,\ |
| 38 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerValidatorTests.cs,\ |
| 39 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/DatabaseFakes.cs,\ |
| 40 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerFakes.cs,\ |
| 41 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs,\ |
| 42 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerStubs.cs,\ |
| 43 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Usings.cs,\ |
| 44 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs,\ |
| 45 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.Designer.cs,\ |
| 46 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs,\ |
| 47 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.Designer.cs,\ |
| 48 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs,\ |
| 49 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.Designer.cs,\ |
| 50 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs,\ |
| 51 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs,\ |
| 52 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/PlayerDbContextModelSnapshot.cs,\ |
| 53 | + src/Dotnet.Samples.AspNetCore.WebApi/Data/PlayerDbContext.cs,\ |
| 54 | + src/Dotnet.Samples.AspNetCore.WebApi/Program.cs |
| 55 | + |
| 56 | +# ============================================================================= |
| 57 | +# Duplicate code (CPD) exclusions |
| 58 | +# Automatic analysis does not support wildcard patterns, so each file is |
| 59 | +# listed explicitly. |
| 60 | +# |
| 61 | +# Migrations — EF Core migration files are intentionally repetitive |
| 62 | +# (sequential InsertData/UpdateData/Sql calls). |
| 63 | +# |
| 64 | +# PlayerDbContext.cs — scaffolded EF Core infrastructure. |
| 65 | +# |
| 66 | +# PlayerData.cs — parallel WithId/without-Id method pairs mirror each other |
| 67 | +# by design; duplication is structural, not accidental. |
| 68 | +# |
| 69 | +# PlayerRequestModelValidator.cs — the "Create" and "Update" rule sets share |
| 70 | +# common rules by design; duplication is intentional. |
| 71 | +# |
| 72 | +# Test files — Fakes, Mocks, and Stubs are intentionally repetitive by design. |
| 73 | +# ============================================================================= |
| 74 | + |
| 75 | +sonar.cpd.exclusions=\ |
| 76 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.cs,\ |
| 77 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414191223_InitialCreate.Designer.cs,\ |
| 78 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.cs,\ |
| 79 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20250414195445_SeedStarting11.Designer.cs,\ |
| 80 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.cs,\ |
| 81 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20251221220614_SeedSubstitutes.Designer.cs,\ |
| 82 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs,\ |
| 83 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.Designer.cs,\ |
| 84 | + src/Dotnet.Samples.AspNetCore.WebApi/Migrations/PlayerDbContextModelSnapshot.cs,\ |
| 85 | + src/Dotnet.Samples.AspNetCore.WebApi/Data/PlayerDbContext.cs,\ |
| 86 | + src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs,\ |
| 87 | + src/Dotnet.Samples.AspNetCore.WebApi/Validators/PlayerRequestModelValidator.cs,\ |
| 88 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerControllerTests.cs,\ |
| 89 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerServiceTests.cs,\ |
| 90 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerValidatorTests.cs,\ |
| 91 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/DatabaseFakes.cs,\ |
| 92 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerFakes.cs,\ |
| 93 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs,\ |
| 94 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerStubs.cs,\ |
| 95 | + test/Dotnet.Samples.AspNetCore.WebApi.Tests/Usings.cs |
0 commit comments