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
The N+1 check emitted findings with an empty code field because
find_meta_in_loop_line only returned the line number. Now extracts
the actual source line via sed before passing to add_json_finding.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
add_json_finding "n-plus-1-pattern""info""LOW""$f""$N1_LINE""Potential N+1 but loop iterates over fields for single object - WordPress caches all meta on first call"""
5550
+
add_json_finding "n-plus-1-pattern""info""LOW""$f""$N1_LINE""Potential N+1 but loop iterates over fields for single object - WordPress caches all meta on first call""$N1_CODE"
5548
5551
((N1_OPTIMIZED_COUNT++))||true
5549
5552
# Priority 3: Check if file uses explicit meta caching
5550
5553
elif has_meta_cache_optimization "$f";then
5551
5554
# File uses update_meta_cache() - likely optimized, downgrade to INFO
add_json_finding "n-plus-1-pattern""info""LOW""$f""$N1_LINE""Potential N+1 (meta in loop), but update_meta_cache() is present - verify optimization"""
5556
+
add_json_finding "n-plus-1-pattern""info""LOW""$f""$N1_LINE""Potential N+1 (meta in loop), but update_meta_cache() is present - verify optimization""$N1_CODE"
0 commit comments