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

Function callerNamesOf

__tests__/pascal-reference-boundaries.test.ts:57–62  ·  view source on GitHub ↗

The routines that call a method, by name, once each.

(qualifiedName: string)

Source from the content-addressed store, hash-verified

55
56/** The routines that call a method, by name, once each. */
57function callerNamesOf(qualifiedName: string): string[] {
58 const target = graph!.getNodesByKind('method').find((n) => n.qualifiedName === qualifiedName);
59 if (!target) return [];
60 return [...new Set(graph!.getIncomingEdges(target.id).filter((e) => e.kind === 'calls')
61 .map((e) => graph!.getNode(e.source)?.name).filter((n): n is string => !!n))].sort();
62}
63
64describe('Pascal reference boundaries (#2550)', () => {
65 it('keeps calls to overloaded methods on their declared receiver', async () => {

Calls 4

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

Tested by

no test coverage detected