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

Function exact_positive_count

tests/test_coverage_children.py:273–288  ·  view source on GitHub ↗
(text, function)

Source from the content-addressed store, hash-verified

271
272
273def exact_positive_count(text, function):
274 blocks = []
275 current = None
276 for line in text.splitlines():
277 heading = re.fullmatch(r" (.+):", line)
278 if heading:
279 current = {"name": heading.group(1), "counts": []}
280 blocks.append(current)
281 elif current is not None:
282 count = re.fullmatch(r" Function count: ([0-9]+)", line)
283 if count:
284 current["counts"].append(int(count.group(1)))
285 exact = [block for block in blocks if block["name"] == function]
286 if len(exact) != 1 or len(exact[0]["counts"]) != 1 or exact[0]["counts"][0] <= 0:
287 raise Infrastructure("exact child-only function lacks one positive native count: " + function)
288 return exact[0]["counts"][0]
289
290
291def profile_controls(case, suite_dir, tool, environment, witnesses):

Callers 1

profile_controlsFunction · 0.85

Calls 1

InfrastructureClass · 0.70

Tested by

no test coverage detected