{# Shared Jinja macros for both HTML reports. #} {# `band` — colour bucket for "higher is better" metrics (defense scores). #} {% macro band(score) -%} {%- if score >= 70 -%}good {%- elif score >= 40 -%}warn {%- else -%}bad {%- endif -%} {%- endmacro %} {# `inv_band` — colour bucket for "higher is worse" metrics (bot completion likelihood). #} {% macro inv_band(score) -%} {%- if score >= 70 -%}bad {%- elif score >= 40 -%}warn {%- else -%}good {%- endif -%} {%- endmacro %} {# `severity_class` — Finding.severity int → CSS class name. Defaults to `low` so an unexpected int never shadows the page with stack traces. #} {% macro severity_class(s) -%} {%- if s == 3 -%}high {%- elif s == 2 -%}med {%- else -%}low {%- endif -%} {%- endmacro %} {# `copy_button_script` — vanilla-JS copy-to-clipboard helper used by the methods statement and the citation blocks. Keep small and inline. #} {% macro copy_button_script() -%} {%- endmacro %}