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

Function coverageProblems

graph-ui/tools/smoke-w12.mjs:1148–1197  ·  view source on GitHub ↗
(want, coverage)

Source from the content-addressed store, hash-verified

1146});
1147
1148function coverageProblems(want, coverage) {
1149 const problems = [];
1150 const direct = [
1151 'file', 'symbol', 'twinView', 'readerLevel', 'help', 'settings', 'entry', 'why',
1152 'explainOpen', 'explainTab', 'galaxy', 'graphMode', 'legend', 'llm', 'agents',
1153 'agentFilter', 'agentTrails', 'agentTrailWindow',
1154 'agentTimelineMode', 'agentTimelineWindow',
1155 'flowStep', 'youActor', 'foreignActor', 'impactMode', 'layoutDefault',
1156 'walkIndex', 'walkRootName', 'walkRootPath',
1157 ];
1158 for (const key of direct) {
1159 if (want[key] !== undefined && coverage[key] !== want[key]) {
1160 problems.push(`${key}=${JSON.stringify(coverage[key])}, erwartet ${JSON.stringify(want[key])}`);
1161 }
1162 }
1163 if ((want.symbol ?? '') !== '' && coverage.twinStatus !== 'ready') {
1164 problems.push(`twinStatus=${JSON.stringify(coverage.twinStatus)}, erwartet "ready"`);
1165 }
1166 if (want.fullscreen !== undefined && coverage.agentFullscreen !== want.fullscreen) {
1167 problems.push(`fullscreen=${JSON.stringify(coverage.agentFullscreen)}, erwartet ${JSON.stringify(want.fullscreen)}`);
1168 }
1169 if (want.walk === true && coverage.walk <= 0) problems.push('walk=0, erwartet laufende Fuehrung');
1170 if (want.walk === true && coverage.walkId.length === 0) problems.push('walkId leer, erwartet dieselbe konkrete Fuehrung');
1171 if (want.walk === false && coverage.walk !== 0) problems.push(`walk=${coverage.walk}, erwartet 0`);
1172 if (want.pseudocodeBase === true && coverage.pseudocodeLines < 1) {
1173 problems.push(`pseudocodeLines=${coverage.pseudocodeLines}, erwartet mindestens 1`);
1174 }
1175 if ((want.search ?? '') !== '' && coverage.searchRows < 1) {
1176 problems.push(`searchRows=${coverage.searchRows}, erwartet mindestens 1`);
1177 }
1178 if ((want.search ?? '') === '' && coverage.command !== '') {
1179 problems.push(`command=${JSON.stringify(coverage.command)}, erwartet leere Kommandozeile`);
1180 }
1181 if (want.allKinds === true && coverage.hiddenKinds.length > 0) {
1182 problems.push(`hiddenKinds=${JSON.stringify(coverage.hiddenKinds)}, erwartet []`);
1183 }
1184 if (want.defaultFacets === true) {
1185 const expected = { logic: true, calls: true, data: true, errors: true, tests: true, runtime: false, changes: false };
1186 const actual = Object.fromEntries(coverage.facets.map((entry) => entry.split('=').map((part, index) =>
1187 index === 1 ? part === 'true' : part)));
1188 for (const [name, value] of Object.entries(expected)) {
1189 /* Nicht jede optionale, ausgeschaltete Linse wird gerendert. Ihre
1190 * Abwesenheit ist damit dieselbe wirksame Lage wie data-on=false;
1191 * eine erforderliche aktive Linse muss dagegen sichtbar sein. */
1192 const matches = value === true ? actual[name] === true : actual[name] !== true;
1193 if (!matches) problems.push(`facet ${name}=${JSON.stringify(actual[name])}, erwartet ${value}`);
1194 }
1195 }
1196 return problems;
1197}
1198
1199async function requireCoverage(page, state, record) {
1200 const coverage = await coverageOf(page);

Callers 1

requireCoverageFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected