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

Function calls

__tests__/python-generic-bases.test.ts:218–223  ·  view source on GitHub ↗
(fn: string)

Source from the content-addressed store, hash-verified

216 // one; the globals are not named after their classes, so no name match does.
217 /** Qualified names of the methods `fn` in app/globals.py calls. */
218 const calls = (fn: string): string[] => {
219 const node = cg.getNodesInFile('app/globals.py').find((n) => n.name === fn && n.kind === 'function')!;
220 expect(node, fn).toBeDefined();
221 return cg.getOutgoingEdges(node.id).filter((e) => e.kind === 'calls')
222 .map((e) => cg.getNode(e.target)!).filter((n) => n.kind === 'method').map((n) => n.qualifiedName);
223 };
224 expect(calls('use_plain')).toEqual(['Base::run']);
225 expect(calls('use_leaf')).toEqual(['Base::run']);
226 expect(calls('use_two')).toEqual(['Pair::run']);

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected