Initial commit. monorepo deps are copied in a dirty way to the vendor folder
This commit is contained in:
commit
06593ac488
53 files changed
+7692
No files matched your search
@@ -0,0 +1,182 @@
|
||||
{#
|
||||
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 %}<span class="token">{{ row.token }}</span> — {% endif %}
|
||||
{% if row.kind == "severity" %}
|
||||
<span class="sev sev-{{ row.value|lower }}">{{ row.value }}</span>
|
||||
{% elif row.kind == "mono" %}
|
||||
<span class="mono">{{ row.value }}</span>
|
||||
{% else %}
|
||||
{{ row.value }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro facts(rows, wide=false) %}
|
||||
<table class="facts{% if wide %} wide{% endif %}">
|
||||
{% for row in rows %}
|
||||
<tr{% if row.gap %} class="gap"{% endif %}>
|
||||
<td>{{ row.label }}:</td>
|
||||
<td>{{ value(row) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro card(title, rows) %}
|
||||
{# 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. #}
|
||||
<div class="block">
|
||||
<table class="card">
|
||||
<caption>{{ title }}</caption>
|
||||
{% for row in rows %}
|
||||
<tr{% if row.aside %} class="aside"{% endif %}>
|
||||
<th>{{ row.label }}</th>
|
||||
<td>{{ value(row) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% 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. #}
|
||||
<div class="block">
|
||||
<table class="bars">
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
<td{% if row.mono %} class="mono"{% endif %}>{{ row.label }}</td>
|
||||
<td class="count">{{ row.count }}</td>
|
||||
<td class="track">
|
||||
<div class="bar">
|
||||
{% for part in row.parts %}
|
||||
<span class="seg-{{ part.severity|lower }}" style="width: {{ part.share }}%"></span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<div class="legend">
|
||||
{% for item in legend.entries %}
|
||||
<span class="item"><span class="key seg-{{ item.severity|lower }}"></span>{{ item.label }}</span>
|
||||
{% endfor %}
|
||||
{% if legend.caveat %}<span class="caveat">— {{ legend.caveat }}</span>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro grid(table) %}
|
||||
<table class="grid">
|
||||
<thead>
|
||||
<tr>{% for column in table.columns %}<th>{{ column }}</th>{% endfor %}</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in table.rows %}
|
||||
<tr{% if row.total %} class="total"{% endif %}>
|
||||
{% for cell in row.cells %}
|
||||
<td>{% if cell is mapping %}{{ value(cell) }}{% else %}{{ cell }}{% endif %}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endmacro %}
|
||||
|
||||
{# ------------------------------------------------------------------------------------------ #}
|
||||
|
||||
<span class="footer-scan">Scan: {{ cover.scan_id }}</span>
|
||||
<span class="footer-date">{{ cover.footer_date }}</span>
|
||||
|
||||
<div class="cover-mark">
|
||||
<img src="{{ cover.logo }}" alt="CipherCell" />
|
||||
</div>
|
||||
|
||||
<div class="cover-title">{{ cover.title }}</div>
|
||||
|
||||
{{ facts(cover.identity) }}
|
||||
|
||||
{% if cover.severity_ledger %}
|
||||
<h2>{{ cover.severity_ledger.title }}</h2>
|
||||
<table class="ledger">
|
||||
{% for row in cover.severity_ledger.rows %}
|
||||
<tr{% if row.total %} class="total"{% endif %}>
|
||||
<td>{{ row.label }}</td>
|
||||
<td>{{ row.count }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% if scan %}
|
||||
<h1 style="break-before: page">{{ scan.title }}</h1>
|
||||
{{ facts(scan.overview, wide=true) }}
|
||||
|
||||
{% for stage in scan.stages %}
|
||||
<h3>{{ stage.title }}</h3>
|
||||
{{ facts(stage.rows, wide=true) }}
|
||||
{% if stage.table %}{{ grid(stage.table) }}{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if project %}
|
||||
<h1 style="break-before: page">{{ project.title }}</h1>
|
||||
{{ facts(project.overview, wide=true) }}
|
||||
|
||||
{% if project.languages %}
|
||||
<h2>{{ project.languages.title }}</h2>
|
||||
<table class="ledger">
|
||||
{% for row in project.languages.rows %}
|
||||
<tr{% if row.total %} class="total"{% endif %}>
|
||||
<td>{{ row.label }}</td>
|
||||
<td>{{ row.share }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if summary %}
|
||||
<h1>{{ summary.title }}</h1>
|
||||
{{ facts(summary.overview, wide=true) }}
|
||||
|
||||
{% for block in summary.distributions %}
|
||||
<h2>{{ block.title }}</h2>
|
||||
{{ distribution(block.rows, block.legend) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if critical %}
|
||||
<h2 style="break-before: page">{{ critical.title }}</h2>
|
||||
{{ grid(critical.table) }}
|
||||
{% endif %}
|
||||
|
||||
{% for section in sections %}
|
||||
<h1{% if section.new_page %} style="break-before: page"{% endif %}>{{ section.title }}</h1>
|
||||
|
||||
{% for group in section.groups %}
|
||||
<h2>{{ group.title }}</h2>
|
||||
{% if group.note %}<p class="note">{{ group.note }}</p>{% endif %}
|
||||
|
||||
{% for entry in group.cards %}
|
||||
{{ card(entry.title, entry.rows) }}
|
||||
{% endfor %}
|
||||
|
||||
{% if group.table %}
|
||||
{% if group.table.title %}<h2>{{ group.table.title }}</h2>{% endif %}
|
||||
{{ grid(group.table) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
Reference in new issue
Block a user