Commit Graph
2 Commits
Author SHA1 Message Date
williamandClaude Sonnet 5 09ae70cb36 fix: resolve SonarQube findings and high-severity npm audit vulnerability
CI / quality (push) Successful in 11m52s
CI / quality (pull_request) Successful in 11m45s
SonarQube dev scan (localhost:9000, project max-app) flagged 2 bugs,
6 vulnerabilities and 3 code smells; quality gate now passes.

- visionCapture.ts: .sort() without a compare function relied on locale-
  dependent default ordering — fixed with localeCompare.
- index.html: added missing lang="fr" on <html>; documented why style-src
  keeps 'unsafe-inline' (React/mermaid inline styles) while script-src stays
  strictly 'self'.
- drawingWindow.ts/exerciseWindow.ts/windowBridge.ts: replaced Math.random()
  with crypto.randomUUID() for IPC correlation ids (flagged as insecure PRNG,
  even though these ids are never security-sensitive).
- translate.ts/deleteFileOrFolder.ts: replaced two regexes flagged for
  superlinear backtracking with plain indexOf/loop-based equivalents.
- App.tsx: documented with NOSONAR why the whole-window drag surface isn't
  given fake keyboard interactivity (no keyboard gesture equivalent to
  "drag the window"; would also break tab order).
- drawingWindow.ts: extracted the near-identical request/ack/timeout
  boilerplate shared by revealShape() and playCaption() into waitForAck(),
  fixing a new-code duplication-density quality gate failure surfaced once
  these lines were touched.

Also fixes the Gitea CI "Security audit" step (npm audit --audit-level=high):
pptxgenjs@4.0.1 pinned image-size to ^1.2.1, within the high-severity DoS
range (GHSA-5p2g-fcmc-qvqq / GHSA-w3rx-r6r6-pgpr, affects <=2.0.2). Added an
npm "overrides" entry forcing image-size to ^2.0.4 under pptxgenjs. The
affected code path (image embedding) isn't even used by createPowerpoint.ts,
and existing tests still pass. Remaining audit findings are all moderate,
dev-tooling-only (eslint/electron-builder's minimatch/glob chain).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 10:37:10 +01:00
williamandClaude Sonnet 5 e9690a49f9 feat: add CI/CD, code quality, testing and security hardening
CI / quality (push) Failing after 6m22s
Implements Max_Code_Quality_CICD_Production.md: TypeScript strict mode,
ESLint flat config with type-checking and security plugin, Prettier,
Husky + lint-staged, Vitest with 80%+ coverage (473 tests), Playwright
e2e, Electron security hardening (contextIsolation, CSP, IPC validation),
electron-builder + electron-updater, Dockerfile, Gitea Actions CI/release
workflows, and SonarQube docker-compose setup. Also fixes two real bugs
found while writing tests: unawaited clipboard promises and a mermaid
container ref timing issue in CoachDrawingView.

Fixes lint-staged on Windows/Node 24 by invoking eslint/prettier via
`node <bin>.js` instead of their .cmd shims, which Node's child_process
now refuses to spawn without shell:true.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-29 09:05:21 +01:00