# SonarQube analysis config for the website repo.
# Consumed by the scanner in .gitea/workflows/sonarqube.yml on push to main.
# The project key must match the one created in SonarQube (dashboard URL
# ?id=runic-gateway-website).

sonar.projectKey=runic-gateway-website
sonar.projectName=runic gateway website

# Analysed application code. The three npm workspaces (server / client / bot).
sonar.sources=server/src,client/src,bot/src

# Test code is analysed separately from sources so coverage/metrics attribute
# correctly. The server suite and the client's pure-logic unit tests both run on
# Node's built-in test runner (no browser/DOM), so they live side by side here.
sonar.tests=server/test,client/test
sonar.test.inclusions=server/test/**/*.test.js,client/test/**/*.test.js

# Coverage. The sonarqube.yml workflow runs both suites with Node's built-in
# test-coverage and writes an LCOV report for each BEFORE the scan runs; without
# them the dashboard shows 0% (the scanner never executes tests itself). The SF:
# paths in each report are repo-root-relative (server/src/... , client/src/...) so
# the scanner resolves them against the project base dir.
sonar.javascript.lcov.reportPaths=server/coverage/lcov.info,client/coverage/lcov.info

# Test execution ("Unit Tests" measure). This is a SEPARATE report from coverage:
# the lcov files above only populate Coverage, so without this the dashboard shows
# a coverage % but an empty "Unit Tests" tile. The sonarqube.yml workflow writes
# these with a custom node:test reporter (scripts/sonar-test-reporter.mjs) that
# emits SonarQube's Generic Test Execution XML; the <file path=…> entries are
# repo-root-relative and must fall under sonar.tests above.
sonar.testExecutionReportPaths=server/coverage/test-execution.xml,client/coverage/test-execution.xml

# Never analyse dependencies, build output, generated specs, or runtime dirs.
sonar.exclusions=**/node_modules/**,client/dist/**,client/public/**,server/swagger/**,server/logs/**,server/uploads/**,server/coverage/**,client/coverage/**,**/*.min.js

sonar.sourceEncoding=UTF-8
