You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- limit-multiplier-from-count: tighten JSON search_pattern to require
count(...) * <number> instead of matching any count() call (24 → 0 FPs)
- rest-no-pagination: add skip_if_context_matches to scripted runner and
suppress non-GET endpoints (POST/PUT/DELETE/PATCH) via 3-line narrow
context check (16 → 8 findings)
- Cross-rule dedup: deduplicate overlapping superglobal findings
(spo-002, unsanitized-read, isset-bypass) in JSON report builder —
same file:line keeps only the first finding (23 duplicates eliminated)
Total CR self-service findings: 99 → 31 after all rounds of fixes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: 4X4.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ WP Code Check is a zero-dependency static analysis toolkit for WordPress perform
48
48
-[x] Fixed stale-registry fallback behavior - eliminated one apparent hang path in the pattern loader and guarded empty search patterns.
49
49
-[x] Fixed high-noise direct-pattern false positives - reduced `php-shell-exec-functions`, `spo-002-superglobals`, and `php-dynamic-include` noise with targeted scanner and pattern fixes.
50
50
-[x] Cleared all deferred items from CR self-service feedback review — added admin-only hook whitelist for `spo-004` (downgrade to INFO) and strengthened N+1 loop detection with brace-depth lexical containment in `find_meta_in_loop_line()`.
51
+
-[x] Round 2 FP reduction pass on CR self-service scan — tightened `limit-multiplier-from-count` pattern (24 → 0 FPs), added `skip_if_context_matches` to suppress non-GET `rest-no-pagination` endpoints (16 → 8), and cross-rule dedup for superglobal rules (eliminated 23 duplicates). Total findings: **99 → 31**.
51
52
-[ ] Phase 0b observability remains incomplete - heartbeat output and slow-check rollups are still deferred and need a focused pass.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,12 @@ All notable changes to this project will be documented in this file.
10
10
11
11
- N+1 loop detection (`find_meta_in_loop_line`) now uses brace-depth tracking to verify `get_*_meta` calls are lexically inside a loop body, not just within 80 lines of a loop keyword. Eliminates false positives from sequential meta calls after loop closure
12
12
13
+
- Tightened `limit-multiplier-from-count` JSON pattern to require `count(...) * <number>` instead of matching any `count()` call. Eliminates false positives from display/comparison uses of `count()`
14
+
15
+
-`rest-no-pagination` now skips non-GET endpoints (POST, PUT, DELETE, PATCH) via new `skip_if_context_matches` scripted runner feature. Reduces false positives on action/mutation endpoints where pagination is inapplicable
16
+
17
+
- Cross-rule deduplication for overlapping superglobal findings (`spo-002-superglobals`, `unsanitized-superglobal-read`, `unsanitized-superglobal-isset-bypass`). When the same file:line is flagged by multiple rules, only the first finding is kept
Copy file name to clipboardExpand all lines: PROJECT/2-WORKING/FEEDBACK-CR-SELF-SERVICE.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# WPCC Pattern Library — False Positive Review
2
2
**Source:** AI review of creditconnection2-self-service scan
3
3
**Date:** 2026-03-23
4
-
**Scan findings:** 99 total | **Estimated true positives after fixes:**~40
4
+
**Scan findings:** 99 total (original) → **31 after all fixes**| **Estimated true positives:**~25–30
5
5
6
6
---
7
7
@@ -64,6 +64,31 @@
64
64
65
65
---
66
66
67
+
### 📋 Round 2 — Post-Scan Analysis (2026-03-24)
68
+
69
+
-[x]**FIX `limit-multiplier-from-count` — nearly 100% FPs, no multiplier context** ✅ *Implemented in pattern*
70
+
**Findings:** 24 findings, all are `count()` used for display (`echo`), array key assignment, or loop comparison (`count($x) < $length`). Zero are `count()` multiplied into a SQL `LIMIT` clause.
71
+
**Root cause:** The JSON `search_pattern` was `count\(` (matching any `count()` call). The inline check at ~line 5122 correctly requires `count(...) * <number>`, but the simple runner ran the broader JSON pattern separately.
72
+
**Fix:** Tightened JSON `search_pattern` to `count\([^)]*\)[[:space:]]*\*[[:space:]]*[0-9]` — now requires the multiplier operator, matching only the inline check's intent.
**Findings:** 16 findings. Routes like `/business/refresh`, `/person/switch-user`, `/business/submit-update` use POST/PUT/DELETE — pagination is inapplicable.
78
+
**Root cause:** The validator checked 15-line context for pagination keywords but didn't account for HTTP method.
79
+
**Fix:** Added `skip_if_context_matches` capability to the scripted pattern runner. When a match's narrow context (3 lines) contains a pattern like `'methods' => 'POST'`, the finding is suppressed before the validator runs. Added the method-detection pattern to `rest-no-pagination.json`.
80
+
**Files changed:**`dist/bin/check-performance.sh` (scripted runner), `dist/patterns/rest-no-pagination.json` (new `skip_if_context_matches` key)
-[x]**FIX cross-rule deduplication for overlapping superglobal findings** ✅ *Implemented in scanner*
84
+
**Findings:** 14 unique `file:line` locations appeared in 2–4 rules simultaneously (`spo-002-superglobals`, `unsanitized-superglobal-read`, `unsanitized-superglobal-isset-bypass`).
85
+
**Root cause:** Three superglobal rules overlap in scope but ran independently with no dedup.
86
+
**Fix:** Added a deduplication pass in the JSON report builder (~line 1683). For a defined set of overlapping rule IDs, when the same `file:line` appears in multiple rules, only the first (highest-priority) finding is kept. Uses a seen-keys set for O(n) dedup.
0 commit comments