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

Function callersOf

__tests__/resolution.test.ts:3501–3507  ·  view source on GitHub ↗
(cg: CodeGraph, name: string, kind: string, filePath?: string)

Source from the content-addressed store, hash-verified

3499 return tmpDir;
3500 };
3501 const callersOf = async (cg: CodeGraph, name: string, kind: string, filePath?: string) => {
3502 const target = (await cg.searchNodes(name, { limit: 20 })).find(
3503 (r) => r.node.kind === kind && r.node.name === name && (!filePath || r.node.filePath === filePath)
3504 );
3505 expect(target).toBeDefined();
3506 return (await cg.getCallers(target!.node.id)).map((c) => c.node.name).sort();
3507 };
3508
3509 it('resolves same-file and imported calls to the literal member, never to the constant (#1573)', async () => {
3510 const tmpDir = setup({

Callers 1

resolution.test.tsFile · 0.70

Calls 6

mapMethod · 0.80
getNodeMethod · 0.80
searchNodesMethod · 0.65
getNodesInFileMethod · 0.65
getCallersMethod · 0.45
getIncomingEdgesMethod · 0.45

Tested by

no test coverage detected