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

Function callers

__tests__/pascal-conditional-blocks.test.ts:516–519  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

514 const cg = await CodeGraph.init(dir, { index: true });
515 try {
516 const callers = (name: string) => {
517 const target = cg.getNodesByKind('function').find((n) => n.qualifiedName === name && n.filePath === 'Lib.pas');
518 return target ? cg.getIncomingEdges(target.id).filter((e) => e.kind === 'calls').map((e) => cg.getNode(e.source)?.qualifiedName) : [];
519 };
520 expect(callers('LockedFind')).toEqual(['TFake::Find']);
521 expect(callers('Deref')).toEqual(['TFake::GetParams']);
522 } finally {

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getIncomingEdgesMethod · 0.65

Tested by

no test coverage detected