MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / collect_callers

Function collect_callers

libatomic/src/daemon/change_impact.rs:253–271  ·  view source on GitHub ↗
(
    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
253fn 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)]
274mod tests {

Calls 4

add_linkFunction · 0.85
callersMethod · 0.80
lenMethod · 0.45
pushMethod · 0.45