What a function's or method's `kind` edges reach, as `qualifiedName @confidence`.
(cg: CodeGraph, qualifiedName: string, kind: 'calls' | 'instantiates')
| 193 | |
| 194 | /** What a function's or method's `kind` edges reach, as `qualifiedName @confidence`. */ |
| 195 | function targets(cg: CodeGraph, qualifiedName: string, kind: 'calls' | 'instantiates'): string[] { |
| 196 | const from = [...cg.getNodesByKind('method'), ...cg.getNodesByKind('function')].find((n) => n.qualifiedName === qualifiedName)!; |
| 197 | return cg.getOutgoingEdgesFrom([from.id], [kind]) |
| 198 | .map((e) => `${cg.getNode(e.target)?.qualifiedName} @${(e.metadata as { confidence?: number } | undefined)?.confidence}`) |
| 199 | .sort(); |
| 200 | } |
| 201 | |
| 202 | describe('C++ constructions of a type a class shares its name with', () => { |
| 203 | // leveldb's db_impl.cc constructs `log::Writer`s and, as `Writer w(…)`, the |
no test coverage detected