chore(load-tests): document non-security-sensitive Math.random() usages to resolve SonarCloud hotspots#282
Merged
Merged
Conversation
Closed
5 tasks
Agent-Logs-Url: https://github.com/NickLetts2/Curvit/sessions/8f73b982-b6ac-4512-b002-d2a3a5a1273c Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review Math.random usage in load tests and mark safe where appropriate
chore(load-tests): document non-security-sensitive Math.random() usages to resolve SonarCloud hotspots
May 15, 2026
NickLetts2
added a commit
that referenced
this pull request
Jun 1, 2026
chore(load-tests): document non-security-sensitive Math.random() usages to resolve SonarCloud hotspots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SonarCloud flagged five
Math.random()calls (rulejavascript:S2245) across four load-test scenarios. All usages are non-security-sensitive — they vary sleep/think-time and weight scenario routing, not secrets or tokens.Changes
03-concurrent-uploads.jsL143 — sleep jitter06-full-stress.jsL90 — weighted scenario routing (40/30/20/10% split)06-full-stress.jsL145 — sleep jitter08-screening-session.jsL333 — think-time jitter09-soak.jsL298 — think-time jitterAdded a two-line comment above each usage, consistent with the pattern already established in
07-admin-journey.js(previously markedSAFE):The five SonarCloud hotspots can now be marked SAFE with justification: used only for load-test randomisation; not used for secrets, credentials, tokens, or authorisation decisions.