/** * Pass #84: excessive-allocation (CWE-770, category: performance) * * Detects collection/object allocations inside loop bodies that * create unnecessary GC pressure and slow down hot paths. * Each allocation forces the garbage collector to do extra work, * degrading throughput in tight loops. * * Detection strategy: * 1. Identify loop body line ranges via graph.loopBodies(). * 2. For each line within a loop body, scan source text for * language-specific allocation patterns. * 3. Skip lines with explicit reuse signals (pool, cache, preallocat). * 4. Emit one warning per allocation site. * * Languages: Java, JavaScript/TypeScript, Python, Rust. Bash — skipped. */ import type { AnalysisPass, PassContext } from '../../graph/analysis-pass.js'; export interface ExcessiveAllocationResult { allocationsInLoops: Array<{ line: number; pattern: string; }>; } export declare class ExcessiveAllocationPass implements AnalysisPass { readonly name = "excessive-allocation"; readonly category: "performance"; run(ctx: PassContext): ExcessiveAllocationResult; } //# sourceMappingURL=excessive-allocation-pass.d.ts.map