{# The SAST/SCA report, after the design sample in `sample_report_template/`. This file places content and nothing else: every dimension, colour and rule lives in `report.css`. Each section is guarded by the data it needs, so a report of a scan that ran half the pipeline is the same document with fewer sections rather than a document full of empty tables. The context this expects is described by `layout.CONTEXT`, and `sample.sample_context()` builds a complete one. #} {# A value is drawn by what it is, not by where it sits: an identifier, a path or a CVSS vector is set in the monospace face wherever it appears, and a severity carries its colour. #} {% macro value(row) %} {% if row.token %}{{ row.token }} — {% endif %} {% if row.kind == "severity" %} {{ row.value }} {% elif row.kind == "mono" %} {{ row.value }} {% else %} {{ row.value }} {% endif %} {% endmacro %} {% macro facts(rows, wide=false) %} {% for row in rows %} {% endfor %}
{{ row.label }}: {{ value(row) }}
{% endmacro %} {% macro card(title, rows, note="") %} {# Wrapped, because break-inside on the table does not hold its caption: the title would stay on one page while the rows it titles moved to the next. #}
{% for row in rows %} {% endfor %}
{{ title }}
{{ row.label }} {{ value(row) }}
{% if note %}

{{ note }}

{% endif %}
{% endmacro %} {# Scaled against the busiest row, not against the total: what is read off a row of these is which one is the outlier, and a scale set by the sum flattens all of them. #} {% macro distribution(rows, legend) %} {# The bars and the legend that decodes them are one thing; a break between them leaves a reader with coloured segments and no key. #}
{% for row in rows %} {{ row.label }} {% endfor %}
{{ row.count }}
{% for part in row.parts %} {% endfor %}
{% for item in legend.entries %} {{ item.label }} {% endfor %} {% if legend.caveat %}— {{ legend.caveat }}{% endif %}
{% endmacro %} {% macro grid(table) %} {% for column in table.columns %}{% endfor %} {% for row in table.rows %} {% for cell in row.cells %} {% endfor %} {% endfor %}
{{ column }}
{% if cell is mapping %}{{ value(cell) }}{% else %}{{ cell }}{% endif %}
{% endmacro %} {# ------------------------------------------------------------------------------------------ #} Scan: {{ cover.scan_id }} {{ cover.footer_date }}
CipherCell
{{ cover.title }}
{{ facts(cover.identity) }} {% if cover.severity_ledger %}

{{ cover.severity_ledger.title }}

{% for row in cover.severity_ledger.rows %} {% endfor %}
{{ row.label }} {{ row.count }}
{% endif %} {% if contents %}

Table of Contents

    {% for entry in contents %}
  1. {{ entry.title }}
  2. {% endfor %}
{% endif %} {% if scan %}

{{ scan.title }}

{{ facts(scan.overview, wide=true) }} {% for stage in scan.stages %}

{{ stage.title }}

{{ facts(stage.rows, wide=true) }} {% if stage.table %}{{ grid(stage.table) }}{% endif %} {% endfor %} {% endif %} {% if project %}

{{ project.title }}

{{ facts(project.overview, wide=true) }} {% if project.languages %}

{{ project.languages.title }}

{% for row in project.languages.rows %} {% endfor %}
{{ row.label }} {{ row.share }}
{% endif %} {% endif %} {% if summary %}

{{ summary.title }}

{{ facts(summary.overview, wide=true) }} {% for block in summary.distributions %}

{{ block.title }}

{{ distribution(block.rows, block.legend) }} {% endfor %} {% for metric in summary.metrics or [] %} {{ card(metric.title, metric.rows, metric.note) }} {% endfor %} {% endif %} {% if critical %}

{{ critical.title }}

{{ grid(critical.table) }} {% endif %} {% for section in sections %} {{ section.title }} {% for group in section.groups %}

{{ group.title }}

{% if group.note %}

{{ group.note }}

{% endif %} {% for entry in group.cards %} {{ card(entry.title, entry.rows) }} {% endfor %} {% if group.table %} {% if group.table.title %}

{{ group.table.title }}

{% endif %} {{ grid(group.table) }} {% endif %} {% endfor %} {% endfor %}