MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / readCoverageRows

Function readCoverageRows

graph-ui/src/app/tree-model.ts:581–616  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

579}
580
581function readCoverageRows(value: unknown): CoverageRow[] {
582 const rows: CoverageRow[] = [];
583 for (const entry of coverageArray(value)) {
584 if (!isRecord(entry)) {
585 continue;
586 }
587 const path = normalizeCoveragePath(coverageString(entry['path']));
588 if (path.length === 0) {
589 continue;
590 }
591 const row: CoverageRow = {
592 path,
593 kind: coverageString(entry['kind']),
594 detail: coverageString(entry['detail']),
595 };
596 // The current MCP encoder replaces parse_partial's stored detail with
597 // structured ranges. Preserve that source evidence in the shared join.
598 if (row.kind === 'parse_partial' && !row.detail) {
599 const ranges = coverageArray(entry['ranges']).flatMap((range) => {
600 if (!isRecord(range)) return [];
601 const start = range['start'];
602 const end = range['end'];
603 return typeof start === 'number' && typeof end === 'number'
604 && Number.isSafeInteger(start) && Number.isSafeInteger(end)
605 && start > 0 && end >= start ? [`${start}-${end}`] : [];
606 });
607 if (ranges.length > 0) row.detail = `Source lines: ${ranges.join(', ')}`;
608 }
609 const match = coverageString(entry['match']);
610 if (match.length > 0) {
611 row.match = match;
612 }
613 rows.push(row);
614 }
615 return rows;
616}
617
618/** Eine rohe `check_index_coverage`-Antwort lesen. */
619export function readCoverageAnswer(payload: unknown): CoverageAnswer {

Callers 1

readCoverageAnswerFunction · 0.85

Calls 5

coverageArrayFunction · 0.85
normalizeCoveragePathFunction · 0.85
coverageStringFunction · 0.85
isRecordFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected