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

Function callsFrom

__tests__/java-bare-call-scope.test.ts:64–67  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

62 const cg = await CodeGraph.init(root, { index: true });
63 try {
64 const callsFrom = (name: string): string[] => {
65 const from = cg.getNodesByName(name).find((n) => n.kind === 'method')!;
66 return cg.getOutgoingEdgesFrom([from.id], ['calls']).map((e) => cg.getNode(e.target)!.name).sort();
67 };
68 expect(callsFrom('sends')).not.toContain('verify');
69 expect(callsFrom('run')).toEqual(['format', 'helper', 'own']);
70 } finally {

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByNameMethod · 0.65
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected