Commit 35b3480
committed
fix(sonar): clear remaining new-code BUGs and S8565 lock-file vuln
After excluding benchmarks/ via sonar-project.properties had no effect
(SonarCloud Automatic Analysis honors sonar.sources but not
sonar.exclusions from the properties file — only the UI config does),
fix the 3 outstanding benchmark BUGs and the lock-file vulnerability
directly so the quality gate clears.
- benchmarks/stratified_analysis.py:585 (S1764, S2583): replace the
IEEE-754 idiom `p != p` with `math.isnan(p)`. Same semantics, but
Sonar's flow analysis no longer mistakes the self-inequality for a
bug (the two rules both fired on the same line).
- benchmarks/cell_metrics.py:90 (S2583): hoist the two endpoint-clamp
conditions into named booleans. Sonar incorrectly inferred that
`q >= 1` was always true after the `q <= 0` early return; with the
conditions materialized as locals the flow analysis no longer fires.
- pyproject.toml (text:S8565): generate uv.lock via `uv lock` so the
rule ("Dependency versions are not predictable if the lock file is
missing") has the lock file it expects. pip is unaffected — it
resolves from pyproject.toml as before; uv.lock is purely advisory
for downstream consumers.
Local: pytest 408 passed / 1 skipped.1 parent 4c28826 commit 35b3480
3 files changed
Lines changed: 2733 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
89 | 96 | | |
90 | | - | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
582 | 583 | | |
583 | 584 | | |
584 | 585 | | |
585 | | - | |
| 586 | + | |
586 | 587 | | |
587 | 588 | | |
588 | 589 | | |
| |||
0 commit comments