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

Method definesPolymorphicSupertype

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

Source from the content-addressed store, hash-verified

5134 // but defines no ≥3-impl supertype, so the named spare keeps it full.)
5135 const superMany = new Map<string, boolean>();
5136 const definesPolymorphicSupertype = (nodes: Node[]): boolean => {
5137 for (const n of nodes) {
5138 if (n.kind !== 'class' && n.kind !== 'interface' && n.kind !== 'struct' && n.kind !== 'union'
5139 && n.kind !== 'trait' && n.kind !== 'protocol' && n.kind !== 'type_alias') continue;
5140 let many = superMany.get(n.id);
5141 if (many === undefined) {
5142 many = cg.getIncomingEdges(n.id)
5143 .filter((x) => x.kind === 'implements' || x.kind === 'extends').length >= MIN_SIBLINGS;
5144 superMany.set(n.id, many);
5145 }
5146 if (many) return true;
5147 }
5148 return false;
5149 };
5150
5151 lines.push('**Source Code**');
5152 lines.push('');

Callers

nothing calls this directly

Calls 3

getMethod · 0.65
getIncomingEdgesMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected