(nodes: Node[])
| 5662 | const MIN_SIBLINGS = 3; |
| 5663 | const siblingSuper = new Map<string, boolean>(); |
| 5664 | const isPolymorphicSibling = (nodes: Node[]): boolean => { |
| 5665 | for (const n of nodes) { |
| 5666 | for (const e of cg.getOutgoingEdges(n.id)) { |
| 5667 | if (e.kind !== 'implements' && e.kind !== 'extends') continue; |
| 5668 | let many = siblingSuper.get(e.target); |
| 5669 | if (many === undefined) { |
| 5670 | many = cg.getIncomingEdges(e.target) |
| 5671 | .filter((x) => x.kind === 'implements' || x.kind === 'extends').length >= MIN_SIBLINGS; |
| 5672 | siblingSuper.set(e.target, many); |
| 5673 | } |
| 5674 | if (many) return true; |
| 5675 | } |
| 5676 | } |
| 5677 | return false; |
| 5678 | }; |
| 5679 | |
| 5680 | // A file that DEFINES a polymorphic supertype (a class/interface with ≥ |
| 5681 | // MIN_SIBLINGS implementers) AND co-locates its subclasses is a redundant |
nothing calls this directly
no test coverage detected