pub fn sink_reachability_analysis_with_progress<F>(
graph: &SqliteGraph,
sources: &[i64],
sinks: &[i64],
progress: &F,
) -> Result<AHashMap<i64, Vec<i64>>, SqliteGraphError>where
F: ProgressCallback,Expand description
Performs sink reachability analysis with progress tracking.
Same algorithm as sink_reachability_analysis but reports progress
during execution. Useful for analyzing many sinks.
§Arguments
graph- The graph to analyzesources- Source node IDs where taint originatessinks- Sink node IDs to analyzeprogress- Progress callback for reporting execution status
§Returns
HashMap mapping vulnerable sink -> Vec<affecting_sources>
§Progress Reporting
The callback receives:
current: Current sink being analyzedtotal: Total number of sinks (Some(total))message: “Sink reachability: {current}/{total} sinks analyzed, {vulns} vulnerabilities found”
Progress is reported for each sink analyzed.
§Example
ⓘ
use sqlitegraph::{
algo::sink_reachability_analysis_with_progress,
progress::ConsoleProgress
};
let progress = ConsoleProgress::new();
let vulnerabilities = sink_reachability_analysis_with_progress(
&graph, &sources, &sinks, &progress
)?;
// Output: Sink reachability: 1/10 sinks analyzed, 1 vulnerabilities found