DET005warningPro

random-without-seed

Random values without seed cause non-reproducible behavior

Applies to: Go, JavaScript, Python, Ruby, Rust, TypeScript

Why this matters

Using random.choice(), random.shuffle(), etc. without setting a seed means you'll get different results each time. This makes tests flaky and debugging impossible. Set a seed for reproducibility, or use secrets module for security.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, DET005 includedstablestack explain DET005

DET005 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: DET005