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

Function callerNamesOf

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

Source from the content-addressed store, hash-verified

4438 }
4439
4440 function callerNamesOf(qualifiedName: string): string[] {
4441 const target = cg.getNodesByKind('method').find((n) => n.qualifiedName === qualifiedName);
4442 if (!target) return [];
4443 const names = cg
4444 .getIncomingEdges(target.id)
4445 .filter((e) => e.kind === 'calls')
4446 .map((e) => cg.getNode(e.source)?.name)
4447 .filter((n): n is string => !!n);
4448 return [...new Set(names)].sort();
4449 }
4450
4451 it('resolves singleton chains and auto locals to the right class, never the first-sorted one', async () => {
4452 // Two classes share writeLog; Logger sorts first so it wins any name-only

Callers 1

resolution.test.tsFile · 0.70

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getIncomingEdgesMethod · 0.65

Tested by

no test coverage detected