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

Function callerNamesOf

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

Source from the content-addressed store, hash-verified

3803 }
3804
3805 function callerNamesOf(qualifiedName: string): string[] {
3806 const target = cg.getNodesByKind('method').find((n) => n.qualifiedName === qualifiedName);
3807 if (!target) return [];
3808 const names = cg
3809 .getIncomingEdges(target.id)
3810 .filter((e) => e.kind === 'calls')
3811 .map((e) => cg.getNode(e.source)?.name)
3812 .filter((n): n is string => !!n);
3813 return [...new Set(names)].sort();
3814 }
3815
3816 it('resolves singleton chains and auto locals to the right class, never the first-sorted one', async () => {
3817 // 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