MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / _accumulate_health_summary

Method _accumulate_health_summary

apps/admin/services.py:509–530  ·  view source on GitHub ↗
(self, summary: dict[str, Any], item: dict[str, Any])

Source from the content-addressed store, hash-verified

507 }
508
509 def _accumulate_health_summary(self, summary: dict[str, Any], item: dict[str, Any]) -> None:
510 status_insights = item.get("statusInsights") or {}
511 reasons = status_insights.get("reasons") or []
512 severity = status_insights.get("severity")
513 state = status_insights.get("state")
514
515 if severity in {"danger", "warning"}:
516 summary["healthAttentionCount"] += 1
517 if severity == "danger":
518 summary["healthDangerCount"] += 1
519 if severity == "warning":
520 summary["healthWarningCount"] += 1
521 if severity == "success":
522 summary["healthyCount"] += 1
523 if state == "permanent":
524 summary["permanentCount"] += 1
525 if "expires_soon" in reasons:
526 summary["expiringSoonCount"] += 1
527 if "storage_metadata_incomplete" in reasons:
528 summary["storageIssueCount"] += 1
529 if "never_retrieved" in reasons:
530 summary["neverRetrievedCount"] += 1
531
532 async def build_file_health_summary(
533 self, file_codes: list[FileCodes], now: Optional[datetime] = None

Callers 2

list_filesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected