MCPcopy
hub / github.com/qazbnm456/awesome-web-security / clamp_dim

Function clamp_dim

scripts/ci/pr_review.py:407–413  ·  view source on GitHub ↗

Coerce an LLM-supplied score to the 0..3 range.

(value)

Source from the content-addressed store, hash-verified

405
406
407def clamp_dim(value) -> int:
408 """Coerce an LLM-supplied score to the 0..3 range."""
409 try:
410 n = int(value)
411 except (TypeError, ValueError):
412 return 0
413 return max(0, min(3, n))
414
415
416def sanitize_reason(text) -> str:

Callers 1

render_commentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected