sonar.projectKey=Siriwat08_Panya-AI sonar.organization=siriwat08 # ============================================================ # Exclusions — non-production code that should NOT be analyzed # ============================================================ # IMPORTANT: All patterns on a SINGLE LINE, comma-separated. # SonarCloud's properties parser does NOT reliably handle backslash # line continuations — use single line to be safe. # # Categories excluded: # 1. Build artifacts & dependencies # 2. Internal tooling scripts (Python + TypeScript + Shell) # 3. Example/demo code (not shipped to production) # 4. Test infrastructure (shell scripts, fixtures) # 5. shadcn/ui library components (third-party, vendored) # 6. Generated Prisma client # 7. Misc config files (no logic to analyze) sonar.exclusions=**/node_modules/**,**/.next/**,**/dist/**,**/build/**,**/coverage/**,**/*.min.js,**/*.map,scripts/**,examples/**,tests/**,mini-services/**,download/**,src/components/ui/**,prisma/**,*.config.mjs,*.config.ts,*.json,*.md,*.lock,*.html,Caddyfile,.env*,.gitignore,components.json,tsconfig.json,sonar-project.properties # ============================================================ # Test file exclusions — files that are tests themselves # ============================================================ sonar.test.exclusions=**/*.test.*,**/*.spec.*,**/__tests__/**,scripts/**,examples/** # ============================================================ # Coverage exclusions — don't require coverage on these # Exclude all React components (they need integration tests, not unit tests) # and all API route handlers (they need db mocking, not feasible in CI) # Focus coverage on: src/lib/*.ts and src/lib/api-helpers/*.ts # ============================================================ sonar.coverage.exclusions=scripts/**,examples/**,tests/**,src/components/ui/**,prisma/**,*.config.*,src/lib/db.ts,src/components/**,src/app/**,src/hooks/**,src/lib/navigation.ts,src/lib/rag.ts,src/lib/zai-client.ts,src/lib/types.ts,src/lib/chat-sessions.ts,src/lib/recently-viewed.ts,src/lib/pdf-extract.ts # ============================================================ # Duplication exclusions (CPD — Copy-Paste Detector) # ============================================================ sonar.cpd.exclusions=scripts/**,examples/**,tests/**,src/components/ui/**,prisma/**,src/lib/persona.ts,src/lib/zai-client.ts,src/components/AppShell.tsx,src/lib/navigation.ts,src/lib/api-helpers/** # ============================================================ # Source directory (where our production code lives) # ============================================================ sonar.sources=src # ============================================================ # Test directories # ============================================================ sonar.tests=src/lib/__tests__ sonar.test.inclusions=**/*.test.ts,**/*.test.tsx # ============================================================ # Coverage report path (generated by vitest --coverage) # ============================================================ sonar.javascript.lcov.reportPaths=coverage/lcov.info # ============================================================ # Language-specific settings # ============================================================ sonar.css.exclusions=src/app/globals.css # ============================================================ # ISSUE IGNORE — auto-resolve existing issues on excluded files # ============================================================ # IMPORTANT: sonar.exclusions only prevents NEW issues from being # detected. EXISTING issues that were already opened on those files # REMAIN OPEN until manually closed. To auto-resolve them, we use # sonar.issue.ignore.multicriteria which tells SonarCloud to NOT # report any rule on the excluded directories. # # Format: e.ruleKey=, e.resourceKey= # We use "*:*" as ruleKey to match ALL rules, and the same globs # as sonar.exclusions. # # This is the ONLY reliable way to auto-close ghost issues that # SonarCloud keeps open on files we've since excluded. sonar.issue.ignore.multicriteria=e1,e2,e3,e4,e5,e6 # e1: All scripts/ files (Python, TypeScript, Shell tooling) sonar.issue.ignore.multicriteria.e1.ruleKey=*:* sonar.issue.ignore.multicriteria.e1.resourceKey=scripts/** # e2: All examples/ files (demo code, not shipped) sonar.issue.ignore.multicriteria.e2.ruleKey=*:* sonar.issue.ignore.multicriteria.e2.resourceKey=examples/** # e3: All tests/ files (test infrastructure) sonar.issue.ignore.multicriteria.e3.ruleKey=*:* sonar.issue.ignore.multicriteria.e3.resourceKey=tests/** # e4: All shadcn/ui components (third-party vendored library) sonar.issue.ignore.multicriteria.e4.ruleKey=*:* sonar.issue.ignore.multicriteria.e4.resourceKey=src/components/ui/** # e5: Prisma generated client sonar.issue.ignore.multicriteria.e5.ruleKey=*:* sonar.issue.ignore.multicriteria.e5.resourceKey=prisma/** # e6: mini-services (not part of production app) sonar.issue.ignore.multicriteria.e6.ruleKey=*:* sonar.issue.ignore.multicriteria.e6.resourceKey=mini-services/**