Every `calls` edge out of `file`'s nodes, as ` -> @ : `.
(file: string)
| 30 | |
| 31 | /** Every `calls` edge out of `file`'s nodes, as `<line> -> <qualifiedName>@<file>:<line>`. */ |
| 32 | function callsIn(file: string): string[] { |
| 33 | const out: string[] = []; |
| 34 | for (const n of cg!.getNodesInFile(file)) { |
| 35 | for (const e of cg!.getOutgoingEdges(n.id)) { |
| 36 | if (e.kind !== 'calls') continue; |
| 37 | const t = cg!.getNode(e.target)!; |
| 38 | out.push(`${e.line} -> ${t.qualifiedName}@${t.filePath}:${t.startLine}`); |
| 39 | } |
| 40 | } |
| 41 | return out.sort((a, b) => parseInt(a, 10) - parseInt(b, 10) || a.localeCompare(b)); |
| 42 | } |
| 43 | |
| 44 | afterEach(() => { |
| 45 | cg?.close(); |
no test coverage detected