The calls a routine makes, as `line: Target::Name`.
(cg: CodeGraph, qualifiedName: string)
| 41 | |
| 42 | /** The calls a routine makes, as `line: Target::Name`. */ |
| 43 | function 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. |
| 54 | const LIB = `unit Lib; |
no test coverage detected