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

Function callerNamesOf

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

Source from the content-addressed store, hash-verified

3395 }
3396
3397 function callerNamesOf(qualifiedName: string): string[] {
3398 const target = cg.getNodesByKind('method').find((n) => n.qualifiedName === qualifiedName);
3399 if (!target) return [];
3400 const names = cg
3401 .getIncomingEdges(target.id)
3402 .filter((e) => e.kind === 'calls')
3403 .map((e) => cg.getNode(e.source)?.name)
3404 .filter((n): n is string => !!n);
3405 return [...new Set(names)].sort();
3406 }
3407
3408 it('resolves singleton chains and auto locals to the right class, never the first-sorted one', async () => {
3409 // 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