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

Function _extract

tests/test_php_object_creation.py:18–28  ·  view source on GitHub ↗
(tmp_path, files: dict[str, str])

Source from the content-addressed store, hash-verified

16
17
18def _extract(tmp_path, files: dict[str, str]):
19 for name, body in files.items():
20 p = tmp_path / name
21 p.parent.mkdir(parents=True, exist_ok=True)
22 p.write_text(body, encoding="utf-8")
23 r = extract([tmp_path / n for n in files], cache_root=Path(tempfile.mkdtemp()),
24 root=tmp_path, parallel=False)
25 labels = {n["id"]: n["label"] for n in r["nodes"]}
26 calls = {(labels[e["source"]], labels[e["target"]]) for e in r["edges"]
27 if e["relation"] == "calls"}
28 return calls, r
29
30
31FOO = "<?php\nnamespace App;\nclass Foo { public function __construct() {} }\n"

Calls 2

extractFunction · 0.90
itemsMethod · 0.45

Tested by

no test coverage detected