MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / collect

Method collect

src/mcp/tools.ts:1662–1677  ·  view source on GitHub ↗
(defNodes: Node[])

Source from the content-addressed store, hash-verified

1660 : '';
1661
1662 const collect = (defNodes: Node[]) => {
1663 const seen = new Set<string>();
1664 const callers: Node[] = [];
1665 const labels = new Map<string, string>();
1666 for (const node of defNodes) {
1667 for (const c of cg.getCallers(node.id)) {
1668 if (!seen.has(c.node.id)) {
1669 seen.add(c.node.id);
1670 callers.push(c.node);
1671 const label = this.edgeLabel(c.edge);
1672 if (label) labels.set(c.node.id, label);
1673 }
1674 }
1675 }
1676 return { callers, labels };
1677 };
1678
1679 // Single definition (or same-file overloads): the familiar flat list.
1680 if (groups.length === 1) {

Callers

nothing calls this directly

Calls 5

edgeLabelMethod · 0.95
hasMethod · 0.80
getCallersMethod · 0.45
setMethod · 0.45
getCalleesMethod · 0.45

Tested by

no test coverage detected