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

Function cmd_map

scripts/sanitizer-coverage-map.py:249–280  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

247
248
249def cmd_map(args) -> int:
250 data = json.load(open(MAP_FILE))
251 platforms = data["platforms"]
252 bad = []
253 for cls in data["classes"]:
254 cells = cls["cells"]
255 for plat in platforms:
256 cell = cells.get(plat)
257 if not cell:
258 bad.append(f"{cls['name']} / {plat}: missing")
259 elif cell.get("status") not in ("covered", "partial", "limit"):
260 bad.append(f"{cls['name']} / {plat}: status must be covered, partial or limit")
261 elif cell["status"] != "covered" and not cell.get("why"):
262 bad.append(f"{cls['name']} / {plat}: {cell['status']} needs a why")
263 if not args.quiet:
264 width = max(len(c["name"]) for c in data["classes"])
265 print(f"{'defect class':<{width}} " + " ".join(f"{p:<14}" for p in platforms))
266 for cls in data["classes"]:
267 row = []
268 for plat in platforms:
269 cell = cls["cells"].get(plat, {})
270 row.append(f"{cell.get('status', '?') + ':' + cell.get('lane', ''):<14}"[:14])
271 print(f"{cls['name']:<{width}} " + " ".join(row))
272 print()
273 for cls in data["classes"]:
274 for plat in platforms:
275 cell = cls["cells"].get(plat, {})
276 if cell.get("status") in ("partial", "limit"):
277 print(f" {cell['status']:<7} {cls['name']} / {plat}: {cell.get('why', '')}")
278 for b in bad:
279 print(f"MAP DEFECT: {b}", file=sys.stderr)
280 return 1 if bad else 0
281
282
283def main() -> int:

Callers

nothing calls this directly

Calls 3

loadMethod · 0.80
getMethod · 0.65
openFunction · 0.50

Tested by

no test coverage detected