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

Method definesPolymorphicSupertype

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

Source from the content-addressed store, hash-verified

3240 // but defines no ≥3-impl supertype, so the named spare keeps it full.)
3241 const superMany = new Map<string, boolean>();
3242 const definesPolymorphicSupertype = (nodes: Node[]): boolean => {
3243 for (const n of nodes) {
3244 if (n.kind !== 'class' && n.kind !== 'interface' && n.kind !== 'struct'
3245 && n.kind !== 'trait' && n.kind !== 'protocol' && n.kind !== 'type_alias') continue;
3246 let many = superMany.get(n.id);
3247 if (many === undefined) {
3248 many = cg.getIncomingEdges(n.id)
3249 .filter((x) => x.kind === 'implements' || x.kind === 'extends').length >= MIN_SIBLINGS;
3250 superMany.set(n.id, many);
3251 }
3252 if (many) return true;
3253 }
3254 return false;
3255 };
3256
3257 lines.push('**Source Code**');
3258 lines.push('');

Callers

nothing calls this directly

Calls 3

getMethod · 0.65
getIncomingEdgesMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected