/** * Pass #20: null-deref (CWE-476, category: reliability) * * Detects variables that are explicitly assigned null/None/undefined and then * used as a receiver (method call or field access) without an intervening * null guard. * * Detection strategy: * 1. Find DFG defs where the expression is an explicit null literal * (null / None / undefined). * 2. For each such def, find all DFG uses via graph.usesOfDef(). * 3. For each use that occurs after the def in the same method and is used * as a receiver, check whether any line between def and use contains a * null-check for that variable. * 4. Emit a finding if no guard is found. * * Scope is limited to the enclosing method to avoid cross-method FPs. */ import type { AnalysisPass, PassContext } from '../../graph/analysis-pass.js'; export interface NullDerefResult { /** Potential null-dereferences detected. */ potentialNullDerefs: Array<{ defLine: number; useLine: number; variable: string; }>; } export declare class NullDerefPass implements AnalysisPass { readonly name = "null-deref"; readonly category: "reliability"; run(ctx: PassContext): NullDerefResult; } //# sourceMappingURL=null-deref-pass.d.ts.map