Skip to main content

Module patterns

Module patterns 

Source
Expand description

Pattern detection utilities for bug-hunter.

This module contains functions for detecting code patterns and determining whether they represent real technical debt or false positives.

§Safety:

This module contains the string literals “unsafe {” and “transmute” as pattern matchers for detecting unsafe code in scanned files. These are string constants used for pattern matching, not actual unsafe code.

Functions§

compute_test_lines
Determine which lines are inside test code (after #[cfg(test)] or #test).
is_real_pattern
Check if pattern appears in a “real” code context, not inside a string literal.
should_suppress_finding
Check if a finding should be suppressed (BH-15). Wired into analyze_common_patterns per issue #17.