The `calls` edges out of the function with this qualified name in `file`, as `name@file`.
(file: string, qualified: string)
| 33 | |
| 34 | /** The `calls` edges out of the function with this qualified name in `file`, as `name@file`. */ |
| 35 | function callees(file: string, qualified: string): string[] { |
| 36 | const from = cg!.getNodesByKind('function').find((n) => n.filePath === file && n.qualifiedName === qualified); |
| 37 | expect(from, `${qualified} should be indexed in ${file}`).toBeDefined(); |
| 38 | return cg! |
| 39 | .getOutgoingEdges(from!.id) |
| 40 | .filter((e) => e.kind === 'calls') |
| 41 | .map((e) => cg!.getNode(e.target)) |
| 42 | .filter((n): n is NonNullable<typeof n> => !!n) |
| 43 | .map((n) => `${n.qualifiedName}@${n.filePath}`) |
| 44 | .sort(); |
| 45 | } |
| 46 | |
| 47 | const CORE = { 'pkg/__init__.py': '', 'pkg/core.py': 'def reverts(raw):\n return [raw]\n' }; |
| 48 |
no test coverage detected