-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsonar-project.properties
More file actions
100 lines (84 loc) · 6.4 KB
/
Copy pathsonar-project.properties
File metadata and controls
100 lines (84 loc) · 6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# =============================================================================
# SonarQube / SonarCloud – Project Configuration
# Project : CedroTech-API
# Stack : NestJS 11 · TypeScript · Node 22
# CI : GitHub Actions → SonarSource/sonarqube-scan-action@v5 (SonarCloud)
# =============================================================================
# ──────────────────────────────────────────────────────────────────────────────
# Project Identification
#
# sonar.projectKey and sonar.organization are NOT hardcoded here.
# They are injected at scan time via GitHub Actions Variables:
# vars.SONAR_PROJECT_KEY → -Dsonar.projectKey
# vars.SONAR_ORGANIZATION → -Dsonar.organization
# See: .github/workflows/ci.yml (SonarQube Scan step → args)
# ──────────────────────────────────────────────────────────────────────────────
sonar.projectName=CedroTech-API
sonar.projectVersion=0.0.1
# ──────────────────────────────────────────────────────────────────────────────
# Source & Test Paths
#
# sonar.sources → production code only (TypeScript in src/).
# sonar.tests → directories that contain test files; SonarQube uses this to
# attribute coverage and avoid false code-smell detections.
# Unit specs live alongside sources in src/; e2e specs in test/.
# ──────────────────────────────────────────────────────────────────────────────
sonar.sources=src
sonar.tests=src,test
sonar.test.inclusions=**/*.spec.ts,**/*.e2e-spec.ts
# ──────────────────────────────────────────────────────────────────────────────
# File Exclusions (source analysis)
#
# Keeps the scanner focused on hand-written production TypeScript and avoids
# noise from compiled output, dependency trees, and coverage artefacts.
# ──────────────────────────────────────────────────────────────────────────────
sonar.exclusions=\
node_modules/**,\
dist/**,\
coverage/**,\
**/*.js,\
**/*.mjs
# ──────────────────────────────────────────────────────────────────────────────
# Coverage Exclusions
#
# Test files and the NestJS bootstrap entrypoint (src/main.ts) are excluded
# from coverage metrics – they are either themselves tests or untestable glue.
# ──────────────────────────────────────────────────────────────────────────────
sonar.coverage.exclusions=\
**/*.spec.ts,\
**/*.e2e-spec.ts,\
src/main.ts
# ──────────────────────────────────────────────────────────────────────────────
# Duplication Exclusions
#
# Test files often contain repetitive boilerplate (describe/it/expect blocks)
# that would produce misleading duplication warnings.
# ──────────────────────────────────────────────────────────────────────────────
sonar.cpd.exclusions=\
**/*.spec.ts,\
**/*.e2e-spec.ts
# ──────────────────────────────────────────────────────────────────────────────
# TypeScript / JavaScript Configuration
#
# Providing both tsconfig files lets SonarQube resolve all type information:
# tsconfig.json – full compiler settings (includes emitDecoratorMetadata,
# experimentalDecorators, strictNullChecks …)
# tsconfig.build.json – production-only subset (excludes spec/test files)
# ──────────────────────────────────────────────────────────────────────────────
sonar.typescript.tsconfigPaths=tsconfig.json,tsconfig.build.json
# ──────────────────────────────────────────────────────────────────────────────
# Code Coverage (LCOV)
#
# Jest is configured with:
# rootDir = "src"
# coverageDirectory = "../coverage"
# → report resolves to <project-root>/coverage/lcov.info
#
# The CI workflow runs `npm run test -- --coverage` BEFORE the scanner step,
# so the report is guaranteed to exist when the scanner runs.
# ──────────────────────────────────────────────────────────────────────────────
sonar.javascript.lcov.reportPaths=coverage/lcov.info
# ──────────────────────────────────────────────────────────────────────────────
# Encoding
# ──────────────────────────────────────────────────────────────────────────────
sonar.sourceEncoding=UTF-8