function_names_match

Function function_names_match 

Source
pub fn function_names_match(query: &str, lcov: &str) -> (bool, MatchConfidence)
Expand description

Pure function: Check if function names match with confidence level

Returns tuple of (matches: bool, confidence: MatchConfidence).

§Matching Strategy

  1. Exact match → High confidence
  2. Closure parent attribution → High confidence
  3. Variant match (method name, no generics) → Medium confidence
  4. Fuzzy substring match → Low confidence
  5. No match → None confidence

§Examples

use debtmap::risk::function_name_matching::{function_names_match, MatchConfidence};

let (matches, confidence) = function_names_match("foo", "foo");
assert!(matches);
assert_eq!(confidence, MatchConfidence::High);

let (matches, confidence) = function_names_match("Type::method", "method");
assert!(matches);
assert_eq!(confidence, MatchConfidence::Medium);