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

Function fnRefs

__tests__/function-ref.test.ts:1314–1315  ·  view source on GitHub ↗
(owner: string, name = 'fetch')

Source from the content-addressed store, hash-verified

1312 await cg.indexAll();
1313 const byOwner = (owner: string, name = 'fetch') => cg.getNodesByName(name).find(n => n.qualifiedName.startsWith(`${owner}::`))!;
1314 const fnRefs = (owner: string, name = 'fetch') => cg.getIncomingEdges(byOwner(owner, name).id)
1315 .filter(e => e.kind === 'references' && e.metadata?.fnRef === true);
1316 // ES inherits Base.fetch and Vec overrides it: the shared declaration is Base.fetch.
1317 expect(sourceNames(cg, fnRefs('Base'))).toEqual(['gc']);
1318 expect(fnRefs('Vec')).toHaveLength(0);

Callers 1

Calls 2

byOwnerFunction · 0.85
getIncomingEdgesMethod · 0.65

Tested by

no test coverage detected