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

Function callsFrom

__tests__/pascal-system-calls.test.ts:43–51  ·  view source on GitHub ↗

The calls a routine makes, as `line: Target::Name`.

(cg: CodeGraph, qualifiedName: string)

Source from the content-addressed store, hash-verified

41
42/** The calls a routine makes, as `line: Target::Name`. */
43function callsFrom(cg: CodeGraph, qualifiedName: string): string[] {
44 const source = cg.getNodesByKind('method').concat(cg.getNodesByKind('function')).find((n) => n.qualifiedName === qualifiedName);
45 expect(source, qualifiedName).toBeDefined();
46 return cg
47 .getOutgoingEdges(source!.id)
48 .filter((e) => e.kind === 'calls')
49 .map((e) => `${e.line}: ${cg.getNode(e.target)?.qualifiedName ?? '?'}`)
50 .sort();
51}
52
53// Namesakes of the System unit's names, elsewhere in the project.
54const LIB = `unit Lib;

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected