Documentation
¶
Overview ¶
Package deadcode detects and filters cryptographic findings that fall inside C/C++ preprocessor dead code blocks (e.g., #if 0 ... #endif).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterReport ¶
func FilterReport(report *entities.InterimReport, targetDir string) *entities.InterimReport
FilterReport removes cryptographic assets that fall entirely within preprocessor dead code regions (#if 0 blocks) in C/C++ files. Non-C/C++ files are passed through unchanged. If a source file cannot be read, its findings are kept (best-effort filtering). C/C++ files are processed concurrently using a bounded worker pool.
func IsInsideDeadRegion ¶
IsInsideDeadRegion checks whether a line range [startLine, endLine] falls entirely within any dead code region.
Types ¶
type Region ¶
type Region struct {
StartLine int // line number of the #if 0 directive
EndLine int // line number of the matching #endif (or #else/#elif at depth 1)
}
Region represents a contiguous block of dead code delimited by preprocessor directives.
func FindDeadRegions ¶
FindDeadRegions scans a C/C++ file and returns all preprocessor dead code regions. A dead region is a block of code inside a statically-false #if expression (e.g., #if 0) up to its matching #endif, #else, or #elif.