/** * Pass #45: n-plus-one (CWE-1049, category: performance) * * Detects calls to database or external-API methods that occur inside a loop * body, producing N+1 round-trips instead of a single batch query. * * Detection uses two signals: * 1. The call line falls inside a loop body identified by a CFG back-edge * (`graph.loopBodies()`). * 2. The method name (and optionally its receiver) matches a curated set of * DB / HTTP / ORM patterns. * * Precision strategy: * - High-confidence method names (e.g. `executeQuery`, `findUnique`) are * flagged regardless of receiver. * - Medium-confidence names (e.g. `find`, `save`, `get`) require a receiver * that looks like a DB/HTTP client. */ import type { CallInfo } from '../../types/index.js'; import type { AnalysisPass, PassContext } from '../../graph/analysis-pass.js'; export interface NPlusOnePassResult { /** Calls inside loop bodies that hit a DB or external API. */ loopDbCalls: CallInfo[]; } export declare class NPlusOnePass implements AnalysisPass { readonly name = "n-plus-one"; readonly category: "performance"; run(ctx: PassContext): NPlusOnePassResult; } //# sourceMappingURL=n-plus-one-pass.d.ts.map