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

Function sumCoverage

graph-ui/src/tours/tour-model.ts:80–93  ·  view source on GitHub ↗
(states: readonly (UnderstandingState | undefined)[])

Source from the content-addressed store, hash-verified

78
79/** Add up the exploration counts of the states a tour's steps resolved to. */
80export function sumCoverage(states: readonly (UnderstandingState | undefined)[]): TourCoverage {
81 let visited = 0;
82 let total = 0;
83 let symbols = 0;
84 for (const state of states) {
85 if (state === undefined) {
86 continue;
87 }
88 symbols += 1;
89 visited += state.exploration.visited;
90 total += state.exploration.total;
91 }
92 return { visited, total, percent: coveragePercent(visited, total), symbols };
93}
94
95/**
96 * The item a step's arrival marks, or undefined when there is nothing to mark.

Callers 1

tour-model.test.tsFile · 0.90

Calls 1

coveragePercentFunction · 0.85

Tested by

no test coverage detected