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

Function findCoverageFiles

plugins/plugin-eval/src/evaluators/coverage.js:7–33  ·  view source on GitHub ↗
(rootPath)

Source from the content-addressed store, hash-verified

5import { pathExists, readJson, readText, relativePath } from "../lib/files.js";
6
7async function findCoverageFiles(rootPath) {
8 const results = [];
9 const ignored = new Set([".git", "node_modules", ".venv", "venv", "__pycache__"]);
10
11 async function visit(currentPath) {
12 const entries = await fs.readdir(currentPath, { withFileTypes: true });
13 for (const entry of entries) {
14 const entryPath = path.join(currentPath, entry.name);
15 if (entry.isDirectory()) {
16 if (ignored.has(entry.name)) {
17 continue;
18 }
19 await visit(entryPath);
20 continue;
21 }
22 if (
23 entry.isFile() &&
24 ["lcov.info", "coverage.xml", "coverage-final.json", "coverage-summary.json"].includes(entry.name)
25 ) {
26 results.push(entryPath);
27 }
28 }
29 }
30
31 await visit(rootPath);
32 return results.sort();
33}
34
35async function parseLcov(filePath) {
36 const text = await readText(filePath);

Callers 1

analyzeCoverageArtifactsFunction · 0.85

Calls 1

visitFunction · 0.70

Tested by

no test coverage detected