(nodes: Node[])
| 5606 | const MIN_SIBLINGS = 3; |
| 5607 | const siblingSuper = new Map<string, boolean>(); |
| 5608 | const isPolymorphicSibling = (nodes: Node[]): boolean => { |
| 5609 | for (const n of nodes) { |
| 5610 | for (const e of cg.getOutgoingEdges(n.id)) { |
| 5611 | if (e.kind !== 'implements' && e.kind !== 'extends') continue; |
| 5612 | let many = siblingSuper.get(e.target); |
| 5613 | if (many === undefined) { |
| 5614 | many = cg.getIncomingEdges(e.target) |
| 5615 | .filter((x) => x.kind === 'implements' || x.kind === 'extends').length >= MIN_SIBLINGS; |
| 5616 | siblingSuper.set(e.target, many); |
| 5617 | } |
| 5618 | if (many) return true; |
| 5619 | } |
| 5620 | } |
| 5621 | return false; |
| 5622 | }; |
| 5623 | |
| 5624 | // A file that DEFINES a polymorphic supertype (a class/interface with ≥ |
| 5625 | // MIN_SIBLINGS implementers) AND co-locates its subclasses is a redundant |
nothing calls this directly
no test coverage detected