MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / formatCoverage

Function formatCoverage

src/formatter.ts:504–531  ·  view source on GitHub ↗
(result: ScanResult)

Source from the content-addressed store, hash-verified

502
503// --- Test Coverage ---
504function formatCoverage(result: ScanResult): string {
505 const cov = result.testCoverage;
506 if (!cov || cov.testFiles.length === 0) return "";
507
508 const lines: string[] = ["# Test Coverage", ""];
509
510 lines.push(`> **${cov.coveragePercent}%** of routes and models are covered by tests`);
511 lines.push(`> ${cov.testFiles.length} test files found`);
512 lines.push("");
513
514 if (cov.testedRoutes.length > 0) {
515 lines.push("## Covered Routes", "");
516 for (const r of cov.testedRoutes) {
517 lines.push(`- ${r}`);
518 }
519 lines.push("");
520 }
521
522 if (cov.testedModels.length > 0) {
523 lines.push("## Covered Models", "");
524 for (const m of cov.testedModels) {
525 lines.push(`- ${m}`);
526 }
527 lines.push("");
528 }
529
530 return lines.join("\n");
531}
532
533// --- CRUD group computation ---
534/**

Callers 1

writeOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected