MCPcopy Index your code
hub / github.com/tirth8205/code-review-graph / _extract_warnings

Function _extract_warnings

code_review_graph/hints.py:318–344  ·  view source on GitHub ↗

Pull warning signals from a tool result.

(result: dict[str, Any])

Source from the content-addressed store, hash-verified

316
317
318def _extract_warnings(result: dict[str, Any]) -> list[str]:
319 """Pull warning signals from a tool result."""
320 warnings: list[str] = []
321
322 # Test gaps
323 test_gaps = result.get("test_gaps")
324 if isinstance(test_gaps, list) and test_gaps:
325 names = [g.get("name", g) if isinstance(g, dict) else str(g) for g in test_gaps[:5]]
326 warnings.append(
327 f"Test coverage gaps: {', '.join(names)}"
328 )
329
330 # High risk score
331 risk = result.get("risk_score")
332 if isinstance(risk, (int, float)) and risk > 0.7:
333 warnings.append(f"High risk score ({risk:.2f}) — review carefully")
334
335 # Coupling warnings from architecture overview
336 arch_warnings = result.get("warnings")
337 if isinstance(arch_warnings, list):
338 for w in arch_warnings[:3]:
339 if isinstance(w, str):
340 warnings.append(w)
341 elif isinstance(w, dict) and "message" in w:
342 warnings.append(w["message"])
343
344 return warnings
345
346
347def _build_related(

Callers 1

generate_hintsFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected