MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _callers

Function _callers

scripts/theme_gate.py:476–492  ·  view source on GitHub ↗

file -> every file that (transitively) renders it, from the grep-level (a) cases.

(root: Path)

Source from the content-addressed store, hash-verified

474
475
476def _callers(root: Path) -> dict[str, set[str]]:
477 """file -> every file that (transitively) renders it, from the grep-level (a) cases."""
478 direct: dict[str, set[str]] = {}
479 for f, _l, _n, target in cases_a(root):
480 direct.setdefault(target, set()).add(f)
481 closure: dict[str, set[str]] = {}
482 for f in direct:
483 seen: set[str] = set()
484 todo = list(direct[f])
485 while todo:
486 c = todo.pop()
487 if c in seen:
488 continue
489 seen.add(c)
490 todo.extend(direct.get(c, ()))
491 closure[f] = seen
492 return closure
493
494
495# ------------------------------------------------------------------ measuring

Callers 1

measureFunction · 0.85

Calls 2

cases_aFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected