Skip to main content

sink_reachability_analysis_with_progress

Function sink_reachability_analysis_with_progress 

Source
pub fn sink_reachability_analysis_with_progress<F>(
    graph: &SqliteGraph,
    sources: &[i64],
    sinks: &[i64],
    progress: &F,
) -> Result<AHashMap<i64, Vec<i64>>, SqliteGraphError>
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 analyze
  • sources - Source node IDs where taint originates
  • sinks - Sink node IDs to analyze
  • progress - Progress callback for reporting execution status

§Returns

HashMap mapping vulnerable sink -> Vec<affecting_sources>

§Progress Reporting

The callback receives:

  • current: Current sink being analyzed
  • total: 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