MCPcopy Index your code
hub / github.com/CodeGraphContext/CodeGraphContext / addNode

Function addNode

website/src/lib/parser.worker.ts:572–581  ·  view source on GitHub ↗
(name: string, type: string, file: string, val: number, extraProps: any = {})

Source from the content-addressed store, hash-verified

570};
571
572const addNode = (name: string, type: string, file: string, val: number, extraProps: any = {}) => {
573 const id = nodeIdSequence++;
574 nodes.push({ id, name, type, file, val, ...extraProps });
575 const symbolKey = `${type}:${name}`;
576 if (!nodeSymbolIndex.has(symbolKey)) nodeSymbolIndex.set(symbolKey, []);
577 nodeSymbolIndex.get(symbolKey)!.push(id);
578 if (!nodeSymbolIndex.has(name)) nodeSymbolIndex.set(name, []);
579 nodeSymbolIndex.get(name)!.push(id);
580 return id;
581};
582
583/**
584 * Resolve a symbol name to a single node ID, preferring candidates

Callers 3

getOrCreateFolderChainFunction · 0.85
parser.worker.tsFile · 0.85
processNextBatchFunction · 0.85

Calls 3

pushMethod · 0.80
hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected