# SonarCloud Configuration for Karting Dashboard Project
# https://sonarcloud.io

sonar.organization=themaksoo
sonar.projectKey=TheMaksoo_karting
sonar.projectName=Karting Dashboard
sonar.projectVersion=1.0.0

# Source encoding
sonar.sourceEncoding=UTF-8

# ========================================
# Coverage Reports (All Languages)
# ========================================

# PHP Backend (Laravel) - Clover format from PHPUnit/Pest
sonar.php.coverage.reportPaths=portal/backend/coverage/clover.xml
sonar.php.tests.reportPath=portal/backend/tests-report.xml

# TypeScript/Vue Frontend - LCOV format from Vitest
sonar.javascript.lcov.reportPaths=portal/frontend/coverage/lcov.info

# ========================================
# Source Files (ONLY actual source code)
# ========================================
sonar.sources=portal/backend/app,portal/frontend/src

# ========================================
# Test Files
# ========================================
# Frontend tests are in subdirectories: composables/__tests__, views/__tests__, etc.
sonar.tests=portal/backend/tests,portal/frontend/src/composables/__tests__,portal/frontend/src/views/__tests__,portal/frontend/src/components/__tests__,portal/frontend/src/stores/__tests__,portal/frontend/src/router/__tests__,portal/frontend/src/services/__tests__,portal/frontend/src/utils/__tests__
sonar.test.inclusions=**/*Test.php,**/*.spec.ts,**/*.test.ts

# ========================================
# Exclusions (CRITICAL - exclude everything that shouldn't be analyzed)
# ========================================

# Exclude from analysis completely
sonar.exclusions=\
  **/node_modules/**,\
  **/vendor/**,\
  **/.venv/**,\
  **/dist/**,\
  **/coverage/**,\
  **/storage/**,\
  **/bootstrap/cache/**,\
  **/*.min.js,\
  **/*.min.css,\
  **/public/build/**,\
  **/artifacts/**,\
  **/.github/**,\
  data-importer/**,\
  **/eml-samples/**,\
  **/*.eml,\
  **/*.csv,\
  **/*.json,\
  **/*.xml,\
  **/*.lock,\
  **/*.txt,\
  **/*.md,\
  **/*.html,\
  **/*.bat,\
  **/*.sh,\
  **/*.ps1,\
  **/check-*.php,\
  **/debug-*.php,\
  **/test-*.php,\
  **/process-*.php,\
  **/show-*.php,\
  **/final-report.php,\
  **/generate-secrets.ps1,\
  **/setup-*.ps1,\
  **/setup-*.sh,\
  test_*.php,\
  **/build-wrapper-dump.json,\
  **/*Test.php,\
  **/*.spec.ts,\
  **/*.test.ts,\
  **/test_*.py,\
  **/__tests__/**,\
  secrets*.json,\
  tracks.json,\
  Karten.csv,\
  *.txt,\
  *.md

# Exclude from duplication detection
sonar.cpd.exclusions=\
  **/tests/**,\
  **/*.spec.ts,\
  **/*.test.ts,\
  **/test_*.py,\
  **/*Test.php,\
  **/migrations/**,\
  **/factories/**,\
  **/seeders/**

# Exclude from coverage (files that CAN'T have test coverage)
sonar.coverage.exclusions=\
  **/tests/**,\
  **/*.spec.ts,\
  **/*.test.ts,\
  **/test_*.py,\
  **/*Test.php,\
  **/database/migrations/**,\
  **/database/seeders/**,\
  **/database/factories/**,\
  **/config/**,\
  **/bootstrap/**,\
  **/routes/**,\
  **/resources/**,\
  **/lang/**,\
  portal/backend/app/Providers/**,\
  portal/backend/app/Console/Kernel.php,\
  portal/backend/app/Http/Kernel.php,\
  portal/backend/app/Exceptions/Handler.php,\
  portal/frontend/src/main.ts,\
  portal/frontend/src/App.vue,\
  portal/frontend/src/router/**,\
  portal/frontend/src/assets/**,\
  portal/frontend/vite.config.ts,\
  portal/frontend/tailwind.config.js,\
  data-importer/**,\
  **/check-*.php,\
  **/debug-*.php,\
  **/test-*.php,\
  **/process-*.php,\
  test_*.php,\
  **/*.d.ts

# ========================================
# Language-specific settings
# ========================================

# PHP settings
sonar.php.file.suffixes=php

# TypeScript/JavaScript settings  
sonar.typescript.file.suffixes=.ts,.tsx
sonar.javascript.file.suffixes=.js,.jsx,.vue

# Python settings
sonar.python.file.suffixes=py

# ========================================
# Quality Gates
# ========================================
sonar.qualitygate.wait=true
