MCPcopy Index your code
hub / github.com/tirth8205/code-review-graph / get_subgraph

Method get_subgraph

code_review_graph/graph.py:817–832  ·  view source on GitHub ↗

Extract a subgraph containing the specified nodes and their connecting edges.

(self, qualified_names: list[str])

Source from the content-addressed store, hash-verified

815 }
816
817 def get_subgraph(self, qualified_names: list[str]) -> dict[str, Any]:
818 """Extract a subgraph containing the specified nodes and their connecting edges."""
819 nodes = []
820 for qn in qualified_names:
821 node = self.get_node(qn)
822 if node:
823 nodes.append(node)
824
825 edges = []
826 qn_set = set(qualified_names)
827 for qn in qualified_names:
828 for e in self.get_edges_by_source(qn):
829 if e.target_qualified in qn_set:
830 edges.append(e)
831
832 return {"nodes": nodes, "edges": edges}
833
834 def get_stats(self) -> GraphStats:
835 """Return aggregate statistics about the graph."""

Callers

nothing calls this directly

Calls 2

get_nodeMethod · 0.95
get_edges_by_sourceMethod · 0.95

Tested by

no test coverage detected