(nodes: Node[])
| 3096 | const MIN_SIBLINGS = 3; |
| 3097 | const siblingSuper = new Map<string, boolean>(); |
| 3098 | const isPolymorphicSibling = (nodes: Node[]): boolean => { |
| 3099 | for (const n of nodes) { |
| 3100 | for (const e of cg.getOutgoingEdges(n.id)) { |
| 3101 | if (e.kind !== 'implements' && e.kind !== 'extends') continue; |
| 3102 | let many = siblingSuper.get(e.target); |
| 3103 | if (many === undefined) { |
| 3104 | many = cg.getIncomingEdges(e.target) |
| 3105 | .filter((x) => x.kind === 'implements' || x.kind === 'extends').length >= MIN_SIBLINGS; |
| 3106 | siblingSuper.set(e.target, many); |
| 3107 | } |
| 3108 | if (many) return true; |
| 3109 | } |
| 3110 | } |
| 3111 | return false; |
| 3112 | }; |
| 3113 | |
| 3114 | // A file that DEFINES a polymorphic supertype (a class/interface with ≥ |
| 3115 | // MIN_SIBLINGS implementers) AND co-locates its subclasses is a redundant |
nothing calls this directly
no test coverage detected