(tmp_path: Path, files: dict[str, str])
| 14 | |
| 15 | |
| 16 | def _graph(tmp_path: Path, files: dict[str, str]): |
| 17 | paths = [] |
| 18 | for name, body in files.items(): |
| 19 | p = tmp_path / name |
| 20 | p.parent.mkdir(parents=True, exist_ok=True) |
| 21 | p.write_text(body, encoding="utf-8") |
| 22 | paths.append(p) |
| 23 | r = extract(paths, cache_root=tmp_path / "graphify-out") |
| 24 | label = {n["id"]: n["label"] for n in r["nodes"]} |
| 25 | calls = { |
| 26 | (label.get(e["source"]), label.get(e["target"])) |
| 27 | for e in r["edges"] |
| 28 | if e["relation"] == "calls" |
| 29 | } |
| 30 | return r, calls |
| 31 | |
| 32 | |
| 33 | MODEL = ( |
no test coverage detected