(tmp_path, files: dict[str, str])
| 16 | |
| 17 | |
| 18 | def _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 | |
| 31 | FOO = "<?php\nnamespace App;\nclass Foo { public function __construct() {} }\n" |
no test coverage detected