Scan Quality Report
{{ project_label or scope_label | default('All Projects') }} — Scan Coverage & Quality Analysis
Staleness Legend:
FRESH = scanned within {{ thresholds.fresh }} days |
AGING = {{ thresholds.fresh + 1 }}–{{ thresholds.aging }} days |
STALE = {{ thresholds.aging + 1 }}–{{ thresholds.stale }} days |
DORMANT = over {{ thresholds.stale }} days
{% endif %}
{# Charts — 2-column row (staleness + scan_type_coverage) then
unpack rating full-width below (if present). The outer panel only
renders when at least one of the two charts has non-empty labels —
prevents an empty bordered chart region in standalone HTML
(round-1 B.1 PR review M1-4). #}
{# Chart-render gates require at least one positive value, not just
non-empty labels — prevents the server-side doughnut from
falling back to a `chart-unavailable` placeholder when every
bucket is zero (round-2 B.1 PR review M2-1). Use subscript
syntax (`['values']`) because Jinja's dot access resolves
`.values` to the dict's `.values()` METHOD, not the dict's
`"values"` key. #}
{% set has_staleness_chart = charts.staleness_distribution and (charts.staleness_distribution['values'] | default([]) | sum > 0) %}
{% set has_scan_type_chart = charts.scan_type_coverage and (charts.scan_type_coverage['values'] | default([]) | sum > 0) %}
{% if has_staleness_chart or has_scan_type_chart %}
{# Per-slot gates use the same values | sum > 0 derived locals
as the outer panel — prevents an all-zero staleness slot
from rendering when scan_type_coverage opens the panel
(round-3 B.1 PR review M1-1). #}
{% if has_staleness_chart %}
{{ fs.panel_head("Staleness distribution", meta="project recency") }}
{% if render_mode == 'fragment' and not fragment_scripts_enabled %}
{% endif %}
{% if has_scan_type_chart %}
{{ server_svgs.get('staleness_distribution', '') | safe }}
{% else %}
{% endif %}
{{ fs.panel_head("Scan type coverage", meta="projects per scan type") }}
{% if render_mode == 'fragment' and not fragment_scripts_enabled %}
{% endif %}
{{ server_svgs.get('scan_type_coverage', '') | safe }}
{% else %}
{% endif %}
{{ fs.panel_head("Unpack rating distribution", meta="binary scan unpack quality") }}
{% if render_mode == 'fragment' and not fragment_scripts_enabled %}
{% endif %}
{# Summary Table (per-project, latest-version snapshot). #}
{{ server_svgs.get('unpack_rating_distribution', '') | safe }}
{% else %}
{% endif %}
{{ fs.panel_head("Project summary", meta="latest version per project") }}
{# Detail Table (per project-version). #}
{% if summary_table and summary_table | length > 0 %}
{% set ns = namespace(has_unpack=false) %}
{% for row in summary_table %}
{% if row.unpack_rating is defined and row.unpack_rating %}
{% set ns.has_unpack = true %}
{% endif %}
{% endfor %}
{% else %}
| Project | Folder | Versions | Latest Version | Last Scan | {% if ns.has_unpack %}Unpack Rating | {% endif %}Staleness | Coverage | Reachability | Critical | High | Total |
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ row.project_name | default('') }} | {{ row.folder_name | default('') }} | {{ row.version_count | default(0) }} | {{ row.latest_version | default('') }} | {{ row.last_scan_date | default('') }} | {% if ns.has_unpack %}
{% set ur = row.unpack_rating | default('') %}
{% if ur == 'Excellent' %}Excellent
{% elif ur == 'Good' %}Good
{% elif ur == 'Fair' %}Fair
{% elif ur == 'Poor' %}Poor
{% elif ur == 'Not Applicable' %}N/A
{% else %}—{% endif %}
{% if row.unpack_short_summary is defined and row.unpack_short_summary %}
{{ row.unpack_short_summary }}
{% endif %}
|
{% endif %}
{% if staleness_lc %} {{ row.staleness }} {% else %}—{% endif %} | {% set cs = row.coverage_score | default(0) %} {{ cs }} | {% set reach = row.has_reachability | default('') %} {% if reach == 'Yes' %}Yes {% elif reach == 'No' %}No {% else %}N/A{% endif %} | {{ row.critical_findings | default(0) }} | {{ row.high_findings | default(0) }} | {{ row.total_findings | default(0) }} |
No project data available.
{% endif %}
{{ fs.panel_head("Version detail", meta="one row per project-version") }}
{% if detail_table and detail_table | length > 0 %}
{% set dns = namespace(has_unpack=false) %}
{% for row in detail_table %}
{% if row.unpack_rating is defined and row.unpack_rating %}
{% set dns.has_unpack = true %}
{% endif %}
{% endfor %}
{% else %}
| Project | Folder | Version | Scans | Last Scan | {% if dns.has_unpack %}Unpack Rating | {% endif %}Staleness | Coverage | Reachability | Critical | High | Total |
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ row.project_name | default('') }} | {{ row.folder_name | default('') }} | {{ row.version_name | default('') }} | {{ row.scan_count | default(0) }} | {{ row.last_scan_date | default('') }} | {% if dns.has_unpack %}
{% set ur = row.unpack_rating | default('') %}
{% if ur == 'Excellent' %}Excellent
{% elif ur == 'Good' %}Good
{% elif ur == 'Fair' %}Fair
{% elif ur == 'Poor' %}Poor
{% elif ur == 'Not Applicable' %}N/A
{% else %}—{% endif %}
{% if row.unpack_short_summary is defined and row.unpack_short_summary %}
{{ row.unpack_short_summary }}
{% endif %}
|
{% endif %}
{% if staleness_lc %} {{ row.staleness }} {% else %}—{% endif %} | {% set cs = row.coverage_score | default(0) %} {{ cs }} | {% set reach = row.has_reachability | default('') %} {% if reach == 'Yes' %}Yes {% elif reach == 'No' %}No {% else %}N/A{% endif %} | {{ row.critical_findings | default(0) }} | {{ row.high_findings | default(0) }} | {{ row.total_findings | default(0) }} |
No version detail data available.
{% endif %}