(id: string, depth: number)
| 3638 | let opaque = false; |
| 3639 | const seen = new Set<string>(); |
| 3640 | const visit = (id: string, depth: number): boolean => { |
| 3641 | if (seen.has(id)) return false; |
| 3642 | seen.add(id); |
| 3643 | let node: Node | null = null; |
| 3644 | let edges: ReturnType<typeof cg.getOutgoingEdges> = []; |
| 3645 | try { node = cg.getNode(id); edges = cg.getOutgoingEdges(id); } catch { return false; } |
| 3646 | let own = 0; |
| 3647 | for (const e of edges) { |
| 3648 | if (e.kind !== 'contains') continue; |
| 3649 | let child: Node | null = null; |
| 3650 | try { child = cg.getNode(e.target); } catch { child = null; } |
| 3651 | if (!child) continue; |
| 3652 | if (child.name === name) return true; |
| 3653 | if (counts(child.kind)) own++; |
| 3654 | } |
| 3655 | if (own > 0) sawMembers = true; |
| 3656 | else if (node && (node.kind === 'interface' || node.kind === 'protocol' || node.kind === 'trait')) opaque = true; |
| 3657 | if (depth >= 3) return false; |
| 3658 | return edges.some((e) => (e.kind === 'extends' || e.kind === 'implements') && visit(e.target, depth + 1)); |
| 3659 | }; |
| 3660 | let root: Node | null = null; |
| 3661 | try { root = cg.getNode(typeId); } catch { root = null; } |
| 3662 | let namesakes: Node[] = []; |
nothing calls this directly
no test coverage detected