MCPcopy Create free account
hub / github.com/code-pushup/cli / aggregateChildCoverage

Function aggregateChildCoverage

packages/utils/src/lib/coverage-tree.ts:124–138  ·  view source on GitHub ↗
(
  nodes: FileTree[],
  cache = new Map<FolderNode, CoverageStats>(),
)

Source from the content-addressed store, hash-verified

122}
123
124function aggregateChildCoverage(
125 nodes: FileTree[],
126 cache = new Map<FolderNode, CoverageStats>(),
127): CoverageStats {
128 return nodes.reduce<CoverageStats>(
129 (acc, node) => {
130 const stats = getNodeCoverageStats(node, cache);
131 return {
132 covered: acc.covered + stats.covered,
133 total: acc.total + stats.total,
134 };
135 },
136 { covered: 0, total: 0 },
137 );
138}
139
140function getNodeCoverageStats(
141 node: FileTree,

Callers 2

calculateTreeCoverageFunction · 0.85
getNodeCoverageStatsFunction · 0.85

Calls 1

getNodeCoverageStatsFunction · 0.85

Tested by

no test coverage detected