MCPcopy
hub / github.com/colbymchenry/codegraph / callerNamesOf

Function callerNamesOf

__tests__/resolution.test.ts:2691–2700  ·  view source on GitHub ↗
(qualifiedName: string)

Source from the content-addressed store, hash-verified

2689 }
2690
2691 function callerNamesOf(qualifiedName: string): string[] {
2692 const target = cg.getNodesByKind('method').find((n) => n.qualifiedName === qualifiedName);
2693 if (!target) return [];
2694 const names = cg
2695 .getIncomingEdges(target.id)
2696 .filter((e) => e.kind === 'calls')
2697 .map((e) => cg.getNode(e.source)?.name)
2698 .filter((n): n is string => !!n);
2699 return [...new Set(names)].sort();
2700 }
2701
2702 it('resolves singleton chains and auto locals to the right class, never the first-sorted one', async () => {
2703 // Two classes share writeLog; Logger sorts first so it wins any name-only

Callers 1

resolution.test.tsFile · 0.85

Calls 3

getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getIncomingEdgesMethod · 0.45

Tested by

no test coverage detected