MCPcopy Create free account
hub / github.com/openai/plugins / parseLcov

Function parseLcov

plugins/plugin-eval/src/evaluators/coverage.js:35–47  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

33}
34
35async function parseLcov(filePath) {
36 const text = await readText(filePath);
37 let found = 0;
38 let hit = 0;
39 for (const line of text.split("\n")) {
40 if (line.startsWith("LF:")) {
41 found += Number(line.slice(3));
42 } else if (line.startsWith("LH:")) {
43 hit += Number(line.slice(3));
44 }
45 }
46 return found > 0 ? Number(((hit / found) * 100).toFixed(2)) : null;
47}
48
49async function parseCoverageXml(filePath) {
50 const text = await readText(filePath);

Callers 1

parseCoverageFileFunction · 0.85

Calls 1

readTextFunction · 0.90

Tested by

no test coverage detected