MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / definesPolymorphicSupertype

Method definesPolymorphicSupertype

src/mcp/tools.ts:5635–5648  ·  view source on GitHub ↗
(nodes: Node[])

Source from the content-addressed store, hash-verified

5633 // but defines no ≥3-impl supertype, so the named spare keeps it full.)
5634 const superMany = new Map<string, boolean>();
5635 const definesPolymorphicSupertype = (nodes: Node[]): boolean => {
5636 for (const n of nodes) {
5637 if (n.kind !== 'class' && n.kind !== 'interface' && n.kind !== 'struct' && n.kind !== 'union'
5638 && n.kind !== 'trait' && n.kind !== 'protocol' && n.kind !== 'type_alias') continue;
5639 let many = superMany.get(n.id);
5640 if (many === undefined) {
5641 many = cg.getIncomingEdges(n.id)
5642 .filter((x) => x.kind === 'implements' || x.kind === 'extends').length >= MIN_SIBLINGS;
5643 superMany.set(n.id, many);
5644 }
5645 if (many) return true;
5646 }
5647 return false;
5648 };
5649
5650 lines.push('**Source Code**');
5651 lines.push('');

Callers

nothing calls this directly

Calls 3

getMethod · 0.65
getIncomingEdgesMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected