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

Function _extract

tests/test_php_static_call_resolution.py:20–30  ·  view source on GitHub ↗
(tmp_path, files: dict[str, str])

Source from the content-addressed store, hash-verified

18
19
20def _extract(tmp_path, files: dict[str, str]):
21 for name, body in files.items():
22 p = tmp_path / name
23 p.parent.mkdir(parents=True, exist_ok=True)
24 p.write_text(body, encoding="utf-8")
25 r = extract([tmp_path / n for n in files], cache_root=Path(tempfile.mkdtemp()),
26 root=tmp_path, parallel=False)
27 labels = {n["id"]: n["label"] for n in r["nodes"]}
28 call_edges = [e for e in r["edges"] if e["relation"] == "calls"]
29 calls = {(labels[e["source"]], labels[e["target"]]): e for e in call_edges}
30 return calls, r
31
32
33def test_same_namespace_static_call_is_extracted_not_inferred(tmp_path):

Calls 2

extractFunction · 0.90
itemsMethod · 0.45

Tested by

no test coverage detected