from __future__ import annotations from backend.models.issue import Category, Issue, Severity def analyze(parsed_page: dict, thresholds: dict) -> list[Issue]: issues: list[Issue] = [] t = thresholds["forms"] inputs = parsed_page.get("inputs", []) for i, inp in enumerate(inputs): input_type = inp.get("input_type", "text") label = f"Input #{i + 1} ({input_type})" elem_selector = inp.get("selector") # F1 — missing label if not inp.get("has_label", True): issues.append(Issue( rule_id="F1_missing_label", category=Category.ACCESSIBILITY, severity=Severity.CRITICAL, confidence=1.0, message=f"{label} has no associated