Spaces:
Running

Z User commited on
Commit
5d6872d
·
1 Parent(s): 3596cb8

fix(sonar): close actionable findings — safe int coercion, awaits, constants, tempfile hotspot

Browse files

- FloatingIconsBg: Math.trunc instead of bitwise |0 int-coercion
- paymob: Number.NaN instead of bare NaN
- r2/admin-tickets/course-enrollment: explicit return await (PromiseLike)
- chatbot-stream: sync TransformStream.transform (no await inside)
- chatbot: validateGroqKey/validateNvidiaKey now sync — all call sites already await
- main: registerServiceWorker sync — awaited call site still valid
- Logo3D/BackgroundLogoWatermark: .dataset over getAttribute
- chatbot_gate_e2e.py: pid-suffixed tempfile boot log (security hotspot) + shared literal constants (S1192)

ReDoS findings (S6443 x9) reviewed line-by-line: every flagged pattern is
linear/anchored (/\/+$ on env config, [^>]* bounded, bounded markdown line
anchors) — false positives, no remediation needed.
Cognitive-complexity refactors (23 fns) intentionally deferred to a dedicated task.

11 files changed +44 -34
Files changed (11)
api/admin-tickets.ts+1-1
api/course-enrollment.ts+1-1
api/lib/chatbot-stream.ts+1-1
api/lib/chatbot.ts+2-2
api/lib/paymob.ts+1-1
api/lib/r2.ts+2-2
scripts/chatbot_gate_e2e.py+31-21
src/components/FloatingIconsBg.tsx+2-2
src/components/Logo3D.tsx+1-1
src/components/ui/BackgroundLogoWatermark.tsx+1-1
src/main.tsx+1-1