feat(scoring): add noise-threshold to cap per-rule findings#23
Conversation
When a single rule fires excessively (e.g. 100+ times in a large repo), it inflates penalties and overwhelms output. --noise-threshold caps findings per rule_id, reporting what was suppressed. Wired into all 6 scoring subcommands: analyze, score, score-url, diff, audit-fleet, and github-top. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac5d91f8ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not threshold: | ||
| return findings, {} |
There was a problem hiding this comment.
Reject negative noise thresholds
filter_noise treats any non-zero integer as enabled, so a negative --noise-threshold is accepted and causes every finding to be dropped (counts[...] <= threshold is never true). This produces artificially perfect scores and an incorrect suppressed count (total - threshold exceeds actual findings), which can silently corrupt CI gating if a typo or bad config passes -1; the new CLI flags do not validate this input before calling this function.
Useful? React with 👍 / 👎.
Summary
filter_noise()to scoring.py — caps findings per rule_id at a configurable threshold--noise-thresholdflag to all 6 scoring subcommands (analyze, score, score-url, diff, audit-fleet, github-top)Usage
Test plan
🤖 Generated with Claude Code