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

Function callersOf

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

Source from the content-addressed store, hash-verified

3478 return tmpDir;
3479 };
3480 const callersOf = async (cg: CodeGraph, name: string, kind: string, filePath?: string) => {
3481 const target = (await cg.searchNodes(name, { limit: 20 })).find(
3482 (r) => r.node.kind === kind && r.node.name === name && (!filePath || r.node.filePath === filePath)
3483 );
3484 expect(target).toBeDefined();
3485 return (await cg.getCallers(target!.node.id)).map((c) => c.node.name).sort();
3486 };
3487
3488 it('resolves same-file and imported calls to the literal member, never to the constant (#1573)', async () => {
3489 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