MCPcopy
hub / github.com/opentrace/opentrace / process

Method process

ui/src/components/pipeline/concurrent/stages.ts:192–308  ·  view source on GitHub ↗
(node: GraphNode)

Source from the content-addressed store, hash-verified

190 }
191
192 process(node: GraphNode): StageMutation {
193 if (node.type !== 'File') {
194 return { nodes: [node], relationships: [] };
195 }
196
197 const filePath = node.properties?.path as string | undefined;
198 if (!filePath) {
199 return { nodes: [node], relationships: [] };
200 }
201
202 const ext = getExtension(filePath);
203 const language = detectLanguage(ext);
204 if (!language) {
205 return { nodes: [node], relationships: [] };
206 }
207
208 const parser = getParserForLanguage(language, ext);
209 const extractor = getExtractor(language);
210 if (!parser || !extractor) {
211 return { nodes: [node], relationships: [] };
212 }
213
214 const fileId = node.id;
215 const content = this.getContent(fileId);
216 if (content === undefined) {
217 return { nodes: [node], relationships: [] };
218 }
219
220 const nodes: GraphNode[] = [node]; // File node passes through
221 const rels: GraphRelationship[] = [];
222
223 try {
224 const tree = parser.parse(content);
225 if (!tree) {
226 return { nodes: [node], relationships: [] };
227 }
228
229 const extraction = extractor(tree.rootNode);
230
231 // Initialize file registry entry
232 this.registries.fileRegistry.set(fileId, new Map());
233
234 // Process symbols → graph nodes + registries
235 for (const sym of extraction.symbols) {
236 processSymbol(
237 sym,
238 fileId,
239 language,
240 this.registries,
241 this.allCallInfo,
242 nodes,
243 rels,
244 this.emittedNodeIds,
245 );
246 }
247
248 // Import analysis
249 const rootNode = extraction.rootNode;

Callers

nothing calls this directly

Calls 11

getExtensionFunction · 0.90
detectLanguageFunction · 0.90
getParserForLanguageFunction · 0.90
getExtractorFunction · 0.90
processSymbolFunction · 0.90
analyzeImportsFunction · 0.90
extractorFunction · 0.85
getContentMethod · 0.80
pushMethod · 0.80
getMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected