MCPcopy
hub / github.com/opentrace/opentrace / countSymbols

Function countSymbols

ui/src/components/pipeline/stages/parsing.ts:304–321  ·  view source on GitHub ↗
(symbols: CodeSymbol[])

Source from the content-addressed store, hash-verified

302
303/** Recursively count classes and functions (including methods inside classes). */
304export function countSymbols(symbols: CodeSymbol[]): {
305 classes: number;
306 functions: number;
307} {
308 let classes = 0;
309 let functions = 0;
310 for (const sym of symbols) {
311 if (sym.kind === 'class') {
312 classes++;
313 const childCounts = countSymbols(sym.children);
314 classes += childCounts.classes;
315 functions += childCounts.functions;
316 } else {
317 functions++;
318 }
319 }
320 return { classes, functions };
321}
322
323function convertSymbol(
324 sym: CodeSymbol,

Callers 1

executeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected