MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / getNodeDisplayLabel

Function getNodeDisplayLabel

website/src/lib/parser.worker.ts:514–526  ·  view source on GitHub ↗
(nodeType: string)

Source from the content-addressed store, hash-verified

512
513// Label a definition node type as Class / Function / Interface / etc.
514function getNodeDisplayLabel(nodeType: string): string {
515 const lower = nodeType.toLowerCase();
516 if (lower.includes('class')) return 'Class';
517 if (lower.includes('interface')) return 'Interface';
518 if (lower.includes('trait')) return 'Trait';
519 if (lower.includes('enum')) return 'Enum';
520 if (lower.includes('module')) return 'Module';
521 if (lower.includes('struct')) return 'Struct';
522 if (lower.includes('variable')) return 'Variable';
523 if (lower.includes('impl')) return 'Class';
524 if (lower.includes('function') || lower.includes('method') || lower.includes('subroutine')) return 'Function';
525 return 'Function';
526}
527
528function calculateComplexity(node: any): number {
529 const complexityNodes = new Set([

Callers 1

processNextBatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected