{% extends "base.html" %} {% set active_page = "score_explain" %} {% block title %}FaultRay - Score Breakdown{% endblock %} {% block page_title %}Resilience Score Breakdown{% endblock %} {% block page_subtitle %}Understand exactly what drives your resilience score{% endblock %} {% block top_actions %} {% endblock %} {% block content %}

Resilience Score

{% set score = decomposition.total_score if decomposition else 0 %} {% if score >= 80 %} {% set sc_class = "score-good" %} {% elif score >= 60 %} {% set sc_class = "score-warning" %} {% else %} {% set sc_class = "score-critical" %} {% endif %}
{{ "%.0f"|format(score) }}
{{ decomposition.grade if decomposition else "N/A" }}
{% if decomposition %}
Percentile: ~{{ "%.0f"|format(decomposition.percentile_estimate) }}%
{% endif %}

Score Summary

{% if decomposition %}
{{ "%.0f"|format(decomposition.base_score) }}
Base Score
-{{ "%.1f"|format(decomposition.penalties_total) }}
Total Penalties
Score {{ "%.0f"|format(decomposition.total_score) }}/{{ "%.0f"|format(decomposition.max_possible_score) }}
{% if score >= 80 %}{% set bar_color = "var(--green)" %} {% elif score >= 60 %}{% set bar_color = "var(--yellow)" %} {% else %}{% set bar_color = "var(--red)" %}{% endif %}
{% else %}

Run the analysis to see results.

{% endif %}
{% if decomposition and decomposition.factors %}

Score Waterfall

Base Score
{{ "%.0f"|format(decomposition.base_score) }}
{% set ns = namespace(running=decomposition.base_score) %} {% for factor in decomposition.factors %} {% if factor.category == "penalty" and factor.points != 0 %}
{{ factor.name }}
{% set ns.running = ns.running + factor.points %}
{{ "%+.1f"|format(factor.points) }}
{% endif %} {% endfor %}
Final Score
{% if decomposition.total_score >= 80 %}{% set final_color = "var(--green)" %} {% elif decomposition.total_score >= 60 %}{% set final_color = "var(--yellow)" %} {% else %}{% set final_color = "var(--red)" %}{% endif %}
{{ "%.0f"|format(decomposition.total_score) }}
{% endif %} {% if decomposition %} {% set penalties = [] %} {% for f in decomposition.factors %} {% if f.category == "penalty" %} {% if penalties.append(f) %}{% endif %} {% endif %} {% endfor %} {% if penalties %}

Penalty Factors

{% for f in decomposition.factors %} {% if f.category == "penalty" %} {% endif %} {% endfor %}
Factor Points Description Remediation
{{ f.name }} {{ "%+.1f"|format(f.points) }} {{ f.description[:80] }} {{ f.remediation or "N/A" }}
{% endif %} {% endif %} {% if decomposition %} {% set has_bonus = false %} {% for f in decomposition.factors %} {% if f.category in ["bonus", "neutral"] %}{% set has_bonus = true %}{% endif %} {% endfor %} {% if has_bonus %}

Positive Factors

{% for f in decomposition.factors %} {% if f.category in ["bonus", "neutral"] %} {% endif %} {% endfor %}
Factor Description
{{ f.name }} {{ f.description }}
{% endif %} {% endif %} {% if decomposition and decomposition.improvements %}

Top Improvements

Actions sorted by impact
{% for imp in decomposition.improvements[:10] %} {% endfor %}
# Action Component Impact Effort Description
{{ loop.index }} {{ imp.action }} {{ imp.component_id }} +{{ "%.1f"|format(imp.estimated_improvement) }} {% if imp.effort == "low" %} Low {% elif imp.effort == "medium" %} Medium {% else %} High {% endif %} {{ imp.description[:50] }}
{% endif %}
{% endblock %}