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

Function callers

__tests__/param-default-calls.test.ts:259–265  ·  view source on GitHub ↗
(file: string, name: string)

Source from the content-addressed store, hash-verified

257 graph = await CodeGraph.init(root, { index: true });
258
259 const callers = (file: string, name: string): string[] => {
260 const target = graph!.getNodesInFile(file).find((n) => n.name === name)!;
261 return graph!.getIncomingEdges(target.id)
262 .filter((e) => e.kind === 'calls')
263 .map((e) => graph!.getNode(e.source)!.name)
264 .sort();
265 };
266 expect(callers('src/f.ts', 'buildNote')).toEqual(['arrow', 'destr', 'inBody', 'm', 'renderWithNote']);
267 expect(callers('tool/ctl.py', 'build')).toEqual(['in_body']);
268 }, 120_000);

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getIncomingEdgesMethod · 0.65

Tested by

no test coverage detected