(id: string, depth: number)
| 4231 | let opaque = false; |
| 4232 | const seen = new Set<string>(); |
| 4233 | const visit = (id: string, depth: number): boolean => { |
| 4234 | if (seen.has(id)) return false; |
| 4235 | seen.add(id); |
| 4236 | let node: Node | null = null; |
| 4237 | let edges: ReturnType<typeof cg.getOutgoingEdges> = []; |
| 4238 | try { node = cg.getNode(id); edges = cg.getOutgoingEdges(id); } catch { return false; } |
| 4239 | let own = 0; |
| 4240 | for (const e of edges) { |
| 4241 | if (e.kind !== 'contains') continue; |
| 4242 | let child: Node | null = null; |
| 4243 | try { child = cg.getNode(e.target); } catch { child = null; } |
| 4244 | if (!child) continue; |
| 4245 | if (child.name === name) return true; |
| 4246 | if (counts(child.kind)) own++; |
| 4247 | } |
| 4248 | if (own > 0) sawMembers = true; |
| 4249 | else if (node && (node.kind === 'interface' || node.kind === 'protocol' || node.kind === 'trait')) opaque = true; |
| 4250 | if (depth >= 3) return false; |
| 4251 | return edges.some((e) => (e.kind === 'extends' || e.kind === 'implements') && visit(e.target, depth + 1)); |
| 4252 | }; |
| 4253 | let root: Node | null = null; |
| 4254 | try { root = cg.getNode(typeId); } catch { root = null; } |
| 4255 | let namesakes: Node[] = []; |
nothing calls this directly
no test coverage detected