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

Function callsFrom

__tests__/pascal-nested-routines.test.ts:46–51  ·  view source on GitHub ↗

What a routine calls, as `file:Target`, sorted.

(cg: CodeGraph, qualifiedName: string)

Source from the content-addressed store, hash-verified

44
45/** What a routine calls, as `file:Target`, sorted. */
46function callsFrom(cg: CodeGraph, qualifiedName: string): string[] {
47 return [...new Set(cg.getOutgoingEdges(routine(cg, qualifiedName).id)
48 .filter((e) => e.kind === 'calls')
49 .map((e) => cg.getNode(e.target)!)
50 .map((n) => `${path.basename(n.filePath)}:${n.qualifiedName}`))].sort();
51}
52
53// The routines elsewhere a nested routine's name could be taken for.
54const LIB = `unit Lib;

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
routineFunction · 0.70
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected