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

Method definesPolymorphicSupertype

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

Source from the content-addressed store, hash-verified

5689 // but defines no ≥3-impl supertype, so the named spare keeps it full.)
5690 const superMany = new Map<string, boolean>();
5691 const definesPolymorphicSupertype = (nodes: Node[]): boolean => {
5692 for (const n of nodes) {
5693 if (n.kind !== 'class' && n.kind !== 'interface' && n.kind !== 'struct' && n.kind !== 'union'
5694 && n.kind !== 'trait' && n.kind !== 'protocol' && n.kind !== 'type_alias') continue;
5695 let many = superMany.get(n.id);
5696 if (many === undefined) {
5697 many = cg.getIncomingEdges(n.id)
5698 .filter((x) => x.kind === 'implements' || x.kind === 'extends').length >= MIN_SIBLINGS;
5699 superMany.set(n.id, many);
5700 }
5701 if (many) return true;
5702 }
5703 return false;
5704 };
5705
5706 lines.push('**Source Code**');
5707 lines.push('');

Callers

nothing calls this directly

Calls 3

getMethod · 0.65
getIncomingEdgesMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected