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

Function calls

__tests__/js-default-export-object-members.test.ts:68–72  ·  view source on GitHub ↗
(g: CodeGraph, id: string, direction: 'in' | 'out')

Source from the content-addressed store, hash-verified

66 }
67 /** `qualifiedName@file` at the other end of a node's `calls` edges. */
68 const calls = (g: CodeGraph, id: string, direction: 'in' | 'out') =>
69 (direction === 'in' ? g.getIncomingEdges(id) : g.getOutgoingEdges(id))
70 .filter((e) => e.kind === 'calls')
71 .map((e) => { const n = g.getNode(direction === 'in' ? e.source : e.target)!; return `${n.qualifiedName}@${n.filePath}`; })
72 .sort();
73 const callees = (g: CodeGraph, qn: string, file: string) => calls(g, node(g, qn, file).id, 'out');
74 const callers = (g: CodeGraph, qn: string, file: string) => calls(g, node(g, qn, file).id, 'in');
75

Callers 2

calleesFunction · 0.70
callersFunction · 0.70

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getIncomingEdgesMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected