Function
collect_callers
(
index: &SyntaxIndex,
target: &str,
path: &str,
files: &mut BTreeMap<String, u32>,
links: &mut BTreeSet<(String, String, String)>,
warnings: &mut Vec<String>,
)
Source from the content-addressed store, hash-verified
| 251 | } |
| 252 | |
| 253 | fn collect_callers( |
| 254 | index: &SyntaxIndex, |
| 255 | target: &str, |
| 256 | path: &str, |
| 257 | files: &mut BTreeMap<String, u32>, |
| 258 | links: &mut BTreeSet<(String, String, String)>, |
| 259 | warnings: &mut Vec<String>, |
| 260 | ) { |
| 261 | let callers = index.callers(target); |
| 262 | if callers.len() > MAX_CALLERS { |
| 263 | warnings.push(format!( |
| 264 | "{path}: common/high-fanout entity skipped (over {MAX_CALLERS} callers)." |
| 265 | )); |
| 266 | return; |
| 267 | } |
| 268 | for caller in callers { |
| 269 | add_link(&caller.path, path, "calls", files, links); |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | #[cfg(test)] |
| 274 | mod tests { |