sicua
Version:
A tool for analyzing project structure and dependencies
76 lines (75 loc) • 1.91 kB
TypeScript
/**
* Detector for debug code and development flags in production code
*/
import { BaseDetector } from "./BaseDetector";
import { Vulnerability } from "../types/vulnerability.types";
import { ScanResult } from "../../../types";
export declare class DebugCodeDetector extends BaseDetector {
private static readonly DEBUG_PATTERNS;
constructor();
detect(scanResult: ScanResult): Promise<Vulnerability[]>;
/**
* Validate if a debug code match is problematic
*/
private validateDebugMatch;
/**
* AST-based analysis for debug code detection
*/
private analyzeASTForDebugCode;
/**
* Find debugger statements
*/
private findDebuggerStatements;
/**
* Find debug-related variables
*/
private findDebugVariables;
/**
* Find console debug method calls
*/
private findConsoleDebugCalls;
/**
* Find development-only code blocks
*/
private findDevelopmentCodeBlocks;
/**
* Analyze debugger statement
*/
private analyzeDebuggerStatement;
/**
* Analyze debug variable
*/
private analyzeDebugVariable;
/**
* Analyze console debug call
*/
private analyzeConsoleDebugCall;
/**
* Analyze development code block
*/
private analyzeDevelopmentCodeBlock;
/**
* Check if variable name is debug-related
*/
private isDebugRelatedVariable;
/**
* Check if variable is set to true
*/
private isVariableSetToTrue;
/**
* Check if condition is development-only
*/
private isDevelopmentOnlyCondition;
/**
* Get console method name
*/
private getConsoleMethodName;
/**
* Check if debug code is properly gated by environment checks
*/
private isProperlyGated;
/**
* Extract function name from AST node context
*/
private extractFunctionFromAST;
}