(nodes: Node[])
| 3213 | const MIN_SIBLINGS = 3; |
| 3214 | const siblingSuper = new Map<string, boolean>(); |
| 3215 | const isPolymorphicSibling = (nodes: Node[]): boolean => { |
| 3216 | for (const n of nodes) { |
| 3217 | for (const e of cg.getOutgoingEdges(n.id)) { |
| 3218 | if (e.kind !== 'implements' && e.kind !== 'extends') continue; |
| 3219 | let many = siblingSuper.get(e.target); |
| 3220 | if (many === undefined) { |
| 3221 | many = cg.getIncomingEdges(e.target) |
| 3222 | .filter((x) => x.kind === 'implements' || x.kind === 'extends').length >= MIN_SIBLINGS; |
| 3223 | siblingSuper.set(e.target, many); |
| 3224 | } |
| 3225 | if (many) return true; |
| 3226 | } |
| 3227 | } |
| 3228 | return false; |
| 3229 | }; |
| 3230 | |
| 3231 | // A file that DEFINES a polymorphic supertype (a class/interface with ≥ |
| 3232 | // MIN_SIBLINGS implementers) AND co-locates its subclasses is a redundant |
nothing calls this directly
no test coverage detected