(id: string, depth: number)
| 4049 | let opaque = false; |
| 4050 | const seen = new Set<string>(); |
| 4051 | const visit = (id: string, depth: number): boolean => { |
| 4052 | if (seen.has(id)) return false; |
| 4053 | seen.add(id); |
| 4054 | let node: Node | null = null; |
| 4055 | let edges: ReturnType<typeof cg.getOutgoingEdges> = []; |
| 4056 | try { node = cg.getNode(id); edges = cg.getOutgoingEdges(id); } catch { return false; } |
| 4057 | let own = 0; |
| 4058 | for (const e of edges) { |
| 4059 | if (e.kind !== 'contains') continue; |
| 4060 | let child: Node | null = null; |
| 4061 | try { child = cg.getNode(e.target); } catch { child = null; } |
| 4062 | if (!child) continue; |
| 4063 | if (child.name === name) return true; |
| 4064 | if (counts(child.kind)) own++; |
| 4065 | } |
| 4066 | if (own > 0) sawMembers = true; |
| 4067 | else if (node && (node.kind === 'interface' || node.kind === 'protocol' || node.kind === 'trait')) opaque = true; |
| 4068 | if (depth >= 3) return false; |
| 4069 | return edges.some((e) => (e.kind === 'extends' || e.kind === 'implements') && visit(e.target, depth + 1)); |
| 4070 | }; |
| 4071 | let root: Node | null = null; |
| 4072 | try { root = cg.getNode(typeId); } catch { root = null; } |
| 4073 | let namesakes: Node[] = []; |
nothing calls this directly
no test coverage detected