import type { ASTNode, Rule, AnalysisContext } from "../../types.js"; /** * Advanced rule that detects unreachable code using CFG analysis * * This rule uses Control Flow Graph analysis to identify code that can never * be executed due to the control flow structure. Common causes include: * 1. Code after return statements * 2. Code in unreachable branches (e.g., after revert without condition) * 3. Code after infinite loops * 4. Dead code due to conditional logic errors * * Unlike simple AST analysis, this rule can detect complex unreachable * patterns across multiple control flow branches. */ export declare class UnreachableCodeRule implements Rule { readonly id = "unreachable-code"; readonly description = "Detect unreachable code that can never be executed"; readonly severity: "warning"; private cfgBuilder; private cfgAnalyzer; apply(ast: ASTNode, context: AnalysisContext): void; private checkFunction; /** * Fallback basic analysis when CFG construction fails */ private performBasicAnalysis; /** * Add suggestions for fixing unreachable code patterns */ private addUnreachableCodeSuggestions; /** * Generate specific suggestions for fixing unreachable code */ private generateUnreachableCodeSuggestions; /** * Check if statement is a return statement */ private isReturnStatement; /** * Check if statement always causes a revert */ private isAlwaysRevertStatement; } //# sourceMappingURL=unreachable-code.d.ts.map