seglint 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- seglint/__init__.py +29 -0
- seglint/_toml.py +12 -0
- seglint/api.py +524 -0
- seglint/calibrate.py +270 -0
- seglint/checks/__init__.py +0 -0
- seglint/checks/_limits.py +41 -0
- seglint/checks/_robust.py +30 -0
- seglint/checks/base.py +174 -0
- seglint/checks/catalog.py +306 -0
- seglint/checks/geometric.py +309 -0
- seglint/checks/leakage.py +265 -0
- seglint/checks/relative.py +185 -0
- seglint/checks/statistical.py +316 -0
- seglint/checks/structural.py +175 -0
- seglint/cli.py +715 -0
- seglint/config.py +297 -0
- seglint/demo.py +152 -0
- seglint/features.py +86 -0
- seglint/hashing.py +226 -0
- seglint/loaders/__init__.py +0 -0
- seglint/loaders/base.py +29 -0
- seglint/loaders/coco.py +158 -0
- seglint/loaders/png_masks.py +274 -0
- seglint/maskthumb.py +53 -0
- seglint/models.py +122 -0
- seglint/pipeline.py +319 -0
- seglint/profile.py +64 -0
- seglint/py.typed +0 -0
- seglint/relative.py +274 -0
- seglint/report/__init__.py +0 -0
- seglint/report/html.py +1462 -0
- seglint/report/json_out.py +83 -0
- seglint/report/templates/mask_note.j2 +1 -0
- seglint/report/templates/pair_panels.j2 +12 -0
- seglint/report/templates/panels.j2 +12 -0
- seglint/report/templates/report.html.j2 +665 -0
- seglint/report/text.py +226 -0
- seglint/review.py +380 -0
- seglint-0.2.0.dist-info/METADATA +217 -0
- seglint-0.2.0.dist-info/RECORD +43 -0
- seglint-0.2.0.dist-info/WHEEL +4 -0
- seglint-0.2.0.dist-info/entry_points.txt +2 -0
- seglint-0.2.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta name="color-scheme" content="light dark">
|
|
7
|
+
<title>{{ t.title }}: {{ dataset }}</title>
|
|
8
|
+
<style>
|
|
9
|
+
:root{--bg:#f5f6f8;--fg:#1b1f24;--card:#fff;--muted:#57606a;--border:#d0d7de;--accent:#0b5cad;--head:#1f2937;--headfg:#fff;--soft:#eef1f4;--info:#eaf2fb;--infob:#1d5fbf;--alert:#fff4e5;--alertb:#8a4b00;--why:#0b4f8a;--below:#6e7781}
|
|
10
|
+
@media (prefers-color-scheme:dark){:root{--bg:#0d1117;--fg:#e6edf3;--card:#161b22;--muted:#9da7b3;--border:#30363d;--accent:#79b8ff;--head:#010409;--headfg:#e6edf3;--soft:#1c2128;--info:#0f2236;--infob:#79b8ff;--alert:#2b1d0a;--alertb:#f0b35a;--why:#9ecbff;--below:#8b949e}}
|
|
11
|
+
*{box-sizing:border-box}
|
|
12
|
+
body{font:15px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:0;background:var(--bg);color:var(--fg)}
|
|
13
|
+
header{background:var(--head);color:var(--headfg);padding:16px 24px 10px}
|
|
14
|
+
header h1{margin:0 0 4px;font-size:21px}
|
|
15
|
+
header .meta{font-size:13px;opacity:.85;word-break:break-word}
|
|
16
|
+
main{padding:16px 24px 40px;max-width:1240px;margin:auto}
|
|
17
|
+
h2{margin:30px 0 6px;font-size:19px}
|
|
18
|
+
h3{margin:18px 0 6px;font-size:16px}
|
|
19
|
+
a{color:var(--accent)}
|
|
20
|
+
code{font:13px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace}
|
|
21
|
+
.panel-box{background:var(--card);border:1px solid var(--border);border-radius:8px;padding:14px 18px;margin:14px 0}
|
|
22
|
+
.headline{font-size:20px;font-weight:650;margin:0 0 10px}
|
|
23
|
+
.bar{display:flex;height:22px;border-radius:5px;overflow:hidden;border:1px solid var(--border);background:var(--soft)}
|
|
24
|
+
.bar span{display:block;height:100%}
|
|
25
|
+
.legend{list-style:none;padding:0;margin:8px 0 0;display:flex;flex-wrap:wrap;gap:6px 20px;font-size:14px}
|
|
26
|
+
.legend .sw{display:inline-block;width:12px;height:12px;border-radius:2px;margin-right:6px;vertical-align:-1px}
|
|
27
|
+
.ERROR{background:#b42318;color:#fff}.WARNING{background:#8a4b00;color:#fff}.INFO{background:#1d5fbf;color:#fff}.CLEAN{background:#1a7f37;color:#fff}
|
|
28
|
+
.badge{display:inline-block;border-radius:4px;padding:0 7px;font-size:12px;font-weight:650;white-space:nowrap}
|
|
29
|
+
.counters span{display:inline-block;margin-right:10px;padding:1px 9px;border-radius:10px;font-weight:600;font-size:13px}
|
|
30
|
+
.note{font-size:13px;color:var(--muted)}
|
|
31
|
+
.alert{background:var(--alert);border-left:5px solid var(--alertb);padding:10px 14px;border-radius:4px;margin:10px 0}
|
|
32
|
+
.start{margin:6px 0;padding-left:0;list-style:none}
|
|
33
|
+
.start li{display:flex;gap:10px;align-items:flex-start;padding:8px 0;border-bottom:1px solid var(--border)}
|
|
34
|
+
.start li:last-child{border-bottom:0}
|
|
35
|
+
.groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px;align-items:start}
|
|
36
|
+
.groups .panel-box{margin:0}
|
|
37
|
+
.groups ul{margin:4px 0;padding-left:20px}
|
|
38
|
+
.scroll{overflow-x:auto;margin:8px 0 14px}
|
|
39
|
+
table{border-collapse:collapse;background:var(--card);width:100%}
|
|
40
|
+
th,td{border:1px solid var(--border);padding:5px 9px;text-align:left;vertical-align:top}
|
|
41
|
+
th{background:var(--soft);font-weight:600;font-size:13px}
|
|
42
|
+
td.num,th.num{text-align:right}
|
|
43
|
+
.check-row{cursor:pointer}
|
|
44
|
+
.check-row:hover,.check-row:focus{background:var(--soft);outline:none}
|
|
45
|
+
.q{border:1px solid var(--border);background:var(--soft);color:var(--fg);border-radius:50%;width:22px;height:22px;font-weight:700;cursor:pointer;margin-left:6px;line-height:1}
|
|
46
|
+
.detail-row td{background:var(--soft)}
|
|
47
|
+
.detail-row dl{margin:2px 0;display:grid;grid-template-columns:max-content 1fr;gap:4px 14px}
|
|
48
|
+
.detail-row dt{font-weight:600}.detail-row dd{margin:0}
|
|
49
|
+
.thr{display:block;white-space:nowrap}
|
|
50
|
+
.filters{background:var(--card);border:1px solid var(--border);border-radius:6px;padding:6px 12px;margin:10px 0}
|
|
51
|
+
.filters details{margin:0}
|
|
52
|
+
.fbody{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;margin-top:6px}
|
|
53
|
+
.filters label{font-size:13px}
|
|
54
|
+
.filters [hidden]{display:none !important}
|
|
55
|
+
.filters .strength-help{flex-basis:100%;margin:-4px 0 0}
|
|
56
|
+
.filters select,.filters input{font:inherit;font-size:13px;color:var(--fg);background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:2px 4px}
|
|
57
|
+
.filters input[type=search]{min-width:200px}
|
|
58
|
+
.sid{word-break:break-all}
|
|
59
|
+
button.more{font:inherit;padding:5px 14px;border-radius:5px;border:1px solid var(--border);background:var(--soft);color:var(--fg);cursor:pointer}
|
|
60
|
+
.card{background:var(--card);border:1px solid var(--border);border-radius:6px;margin:8px 0;padding:8px 12px;scroll-margin-top:64px;min-width:0;overflow-wrap:anywhere}
|
|
61
|
+
.card .head{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;margin-bottom:6px}
|
|
62
|
+
.panels{display:flex;flex-wrap:wrap;gap:6px}
|
|
63
|
+
.panels figure{margin:0}
|
|
64
|
+
.panels figcaption{font-size:11px;color:var(--muted);max-width:256px}
|
|
65
|
+
.mkeys{display:flex;flex-wrap:wrap;gap:2px 8px;margin-top:2px}
|
|
66
|
+
.mkey{white-space:nowrap}
|
|
67
|
+
.msw{display:inline-block;width:10px;height:10px;border:1px solid var(--border);margin-right:3px;vertical-align:-1px}
|
|
68
|
+
.panels img{display:block;max-width:100%;height:auto;background:var(--soft)}
|
|
69
|
+
.missing{width:256px;height:128px;max-width:100%;background:var(--soft);display:flex;align-items:center;justify-content:center;color:var(--muted)}
|
|
70
|
+
.msg{color:var(--fg)}
|
|
71
|
+
.pairinfo{margin:2px 0 6px}
|
|
72
|
+
.why{font-size:13px;color:var(--why);margin:2px 0 4px}
|
|
73
|
+
.below{color:var(--below)}
|
|
74
|
+
.tag{display:inline-block;border-radius:3px;padding:0 6px;font-size:12px;background:var(--soft);border:1px solid var(--border);color:var(--fg)}
|
|
75
|
+
.info-panel{background:var(--info);border:1px solid var(--border);border-left:5px solid var(--infob);border-radius:6px;padding:12px 16px;margin:12px 0}
|
|
76
|
+
.info-badge{display:inline-block;border:1px solid var(--infob);color:var(--infob);border-radius:10px;padding:0 9px;font-size:12px;font-weight:600;margin-left:8px;vertical-align:2px}
|
|
77
|
+
details{margin:10px 0}
|
|
78
|
+
summary{cursor:pointer;font-weight:600}
|
|
79
|
+
pre{background:var(--soft);border:1px solid var(--border);border-radius:5px;padding:8px 10px;overflow-x:auto;white-space:pre-wrap;word-break:break-all}
|
|
80
|
+
footer{border-top:1px solid var(--border);margin-top:34px;padding-top:6px}
|
|
81
|
+
.hidden,.filters[hidden]{display:none !important}
|
|
82
|
+
.tabbar{position:sticky;top:0;z-index:20;background:var(--head);display:flex;align-items:center;gap:8px;overflow-x:auto;padding:8px 24px;border-bottom:1px solid var(--border);scrollbar-width:thin}
|
|
83
|
+
.tab{flex:none;text-decoration:none;white-space:nowrap;border-radius:6px;cursor:pointer}
|
|
84
|
+
.tab.sev{font-size:15px;font-weight:700;padding:6px 14px;border:2px solid transparent}
|
|
85
|
+
.tab.sev.zero{opacity:.5}
|
|
86
|
+
.tab.sec{font-size:13px;color:var(--headfg);padding:5px 10px;border:1px solid transparent;opacity:.85}
|
|
87
|
+
.tab.sec:hover{opacity:1;border-color:var(--headfg)}
|
|
88
|
+
.tab.first-sec{margin-left:10px}
|
|
89
|
+
.tab[aria-selected="true"].sev{border-color:var(--headfg);box-shadow:0 0 0 2px var(--head),0 0 0 4px var(--headfg)}
|
|
90
|
+
.tab[aria-selected="true"].sec{background:var(--card);color:var(--fg);opacity:1}
|
|
91
|
+
.tab:focus-visible{outline:3px solid #f5b400;outline-offset:2px}
|
|
92
|
+
.tabpanel:focus-visible{outline:2px dashed var(--accent);outline-offset:4px}
|
|
93
|
+
.js-tabs .tabpanel{display:none}
|
|
94
|
+
.js-tabs .tabpanel.active{display:block}
|
|
95
|
+
.tab-title{margin-top:18px}
|
|
96
|
+
.ok-msg{background:var(--card);border:1px solid var(--border);border-left:5px solid #1a7f37;border-radius:6px;padding:12px 16px}
|
|
97
|
+
.fgroup{border-top:1px solid var(--border);margin-top:18px}
|
|
98
|
+
.fgroup h3 .gcount{font-weight:400;color:var(--muted)}
|
|
99
|
+
.ftable-wrap>summary{font-weight:400;color:var(--accent)}
|
|
100
|
+
@keyframes flash{from{box-shadow:0 0 0 4px #f5b400}to{box-shadow:0 0 0 4px transparent}}
|
|
101
|
+
.card.flash{animation:flash 2.5s ease-out}
|
|
102
|
+
.counters a{text-decoration:none}
|
|
103
|
+
@media (max-width:700px){main{padding:10px 10px 30px}header{padding:12px 12px 8px}.tabbar{padding:6px 10px}.tab.sev{font-size:14px;padding:5px 10px}.headline{font-size:17px}.filters{position:static}.filters input[type=search]{min-width:0;width:100%}.panels{flex-direction:column}.panels figure{max-width:100%}.panels img{width:100%;max-width:256px}}
|
|
104
|
+
@media print{body{background:#fff;color:#000}header{background:#fff;color:#000;border-bottom:2px solid #000}.tabbar,.filters,button,.ftable-wrap,.no-print{display:none !important}.js-tabs .tabpanel,.tabpanel{display:block !important}.fgroup .hidden,.card.hidden{display:block !important}.detail-row{display:table-row !important}.card,.panel-box,tr{break-inside:avoid}a{color:#000}.scroll{overflow:visible}}
|
|
105
|
+
</style>
|
|
106
|
+
<noscript><style>.detail-row{display:table-row !important}.js-only{display:none !important}</style></noscript>
|
|
107
|
+
</head>
|
|
108
|
+
<body>
|
|
109
|
+
<header>
|
|
110
|
+
<h1>{{ t.title }}</h1>
|
|
111
|
+
<div class="meta">dataset: {{ dataset }} · {{ date }} · seglint {{ version }}
|
|
112
|
+
· {{ t.meta_samples.format(n=n_samples) }}
|
|
113
|
+
· {% if splits %}{{ t.meta_splits.format(splits=splits|join(", ")) }}{% else %}{{ t.meta_no_splits }}{% endif %} · {% if meta.preset %}{{ t.meta_sensitivity.format(preset=meta.preset, k=meta.k) }}{% else %}{{ t.meta_k.format(k=meta.k) }}{% endif %} · {% if meta.budget %}{{ t.meta_budget.format(budget=meta.budget) }}{% else %}{{ t.meta_no_budget }}{% endif %}{% if timing.total_s is defined %} · {{ t.meta_scanned.format(s='%.1f'|format(timing.total_s)) }}{% endif %}</div>
|
|
114
|
+
</header>
|
|
115
|
+
<nav class="tabbar" role="tablist" aria-label="{{ t.tabs_label }}">
|
|
116
|
+
{% for p in sev_panels %}<a class="tab sev {{ p.sev }}{% if not p.n %} zero{% endif %}" role="tab" id="tab-btn-{{ p.key }}" href="#tab-{{ p.key }}" data-tab="{{ p.key }}" aria-controls="tab-{{ p.key }}" aria-selected="false" tabindex="-1">{{ icons[p.sev] }} {{ p.sev }} ({{ sev[p.sev] }})</a>
|
|
117
|
+
{% endfor %}
|
|
118
|
+
{% for key, label, n in (("overview", t.tab_overview, none), ("review", t.tab_review, review_n), ("duplicates", t.tab_duplicates, none), ("normal", t.tab_normal, none), ("checks", t.tab_checks, none), ("reproduce", t.tab_reproduce, none)) %}<a class="tab sec{% if loop.first %} first-sec{% endif %}" role="tab" id="tab-btn-{{ key }}" href="#tab-{{ key }}" data-tab="{{ key }}" aria-controls="tab-{{ key }}" aria-selected="{{ 'true' if key == 'overview' else 'false' }}" tabindex="{{ '0' if key == 'overview' else '-1' }}">{{ label }}{% if n is not none %} ({{ n }}){% endif %}</a>
|
|
119
|
+
{% endfor %}
|
|
120
|
+
</nav>
|
|
121
|
+
<main id="main">
|
|
122
|
+
<div class="filters js-only" id="filters" hidden data-view="{{ t.findings_view }}" data-count="{{ t.findings_count }}" data-more="{{ t.findings_more }}">
|
|
123
|
+
<details id="f-det" open><summary>{{ t.filters_title }}</summary>
|
|
124
|
+
<div class="fbody">
|
|
125
|
+
<label>{{ t.filter_check }} <select id="f-check"><option value="">{{ t.filter_all }}</option>
|
|
126
|
+
{% for c in check_ids %}<option value="{{ c }}">{{ c }} · {{ check_name(c) }}</option>{% endfor %}</select></label>
|
|
127
|
+
<select id="f-sev" hidden aria-hidden="true"><option value="">{{ t.filter_all }}</option><option>ERROR</option><option>WARNING</option><option>INFO</option></select>
|
|
128
|
+
<label{% if splits|length < 2 %} hidden{% endif %}>{{ t.filter_split }} <select id="f-split"><option value="">{{ t.filter_all }}</option>
|
|
129
|
+
{% for sp in splits %}<option>{{ sp }}</option>{% endfor %}</select></label>
|
|
130
|
+
<label{% if classes|length < 2 %} hidden{% endif %}>{{ t.filter_class }} <select id="f-class"><option value="">{{ t.filter_all }}</option>
|
|
131
|
+
{% for c in classes %}<option>{{ c }}</option>{% endfor %}</select></label>
|
|
132
|
+
<label>{{ t.filter_search }} <input type="search" id="f-text" placeholder="{{ t.filter_placeholder }}"></label>
|
|
133
|
+
{% if slider_max %}
|
|
134
|
+
<label title="{{ t.filter_strength_title }}">{{ t.filter_strength }} <input type="range" id="f-ratio" min="1" max="{{ slider_max }}" step="0.1" value="1" aria-describedby="f-ratio-help"> <span id="f-ratio-v">1.0</span>×</label>
|
|
135
|
+
{% endif %}
|
|
136
|
+
<table hidden><thead id="ftable-head"><tr><th>{{ t.findings_col_sample }}</th><th>{{ t.findings_col_split }}</th><th>{{ t.findings_col_class }}</th><th>{{ t.findings_col_why }}</th><th>{{ t.findings_col_view }}</th></tr></thead></table>
|
|
137
|
+
<span class="note" id="f-count"></span>
|
|
138
|
+
{% if slider_max %}<p class="note strength-help" id="f-ratio-help">{{ t.filter_strength_help }}</p>{% endif %}
|
|
139
|
+
</div>
|
|
140
|
+
</details>
|
|
141
|
+
</div>
|
|
142
|
+
<script type="application/json" id="findings-data">{{ findings_json|safe }}</script>
|
|
143
|
+
<noscript><p class="note">{{ t.findings_noscript }}</p></noscript>
|
|
144
|
+
|
|
145
|
+
<section id="tab-overview" class="tabpanel active" role="tabpanel" aria-labelledby="tab-btn-overview" data-tab="overview" tabindex="0">
|
|
146
|
+
{% for n in notes %}<div class="info-panel" id="{{ n.kind|replace('_', '-') }}{% if n.files %}-{{ n.files }}{% endif %}" role="note"><strong>{{ t.note_title }}:</strong> {{ n.message }}</div>
|
|
147
|
+
{% endfor %}
|
|
148
|
+
<section id="overview" class="panel-box" aria-label="summary">
|
|
149
|
+
<p class="headline">{% if overview.flagged %}{{ t.overview_headline.format(flagged=overview.flagged, n=overview.n, pct=overview.pct) }}{% else %}{{ t.overview_none.format(n=overview.n) }}{% endif %}</p>
|
|
150
|
+
<div class="bar" role="img" aria-label="{{ t.overview_bar_label }}: {% for s in overview.segments %}{{ s.label }} {{ s.n }}{% if not loop.last %}, {% endif %}{% endfor %}">
|
|
151
|
+
{% for s in overview.segments if s.n %}<span class="{{ s.key }}" style="width:{{ s.width }}%" title="{{ s.label }}: {{ s.n }} ({{ s.pct }})"></span>{% endfor %}
|
|
152
|
+
</div>
|
|
153
|
+
<ul class="legend" id="overview-legend">
|
|
154
|
+
{% for s in overview.segments %}<li><span class="sw {{ s.key }}"></span>{{ s.icon }} <strong>{{ s.label }}</strong>: {{ s.n }} ({{ s.pct }})</li>
|
|
155
|
+
{% endfor %}</ul>
|
|
156
|
+
<p class="note">{{ t.overview_bar_help }}</p>
|
|
157
|
+
<p class="counters">{{ t.overview_findings.format(n=n_issues) }}:
|
|
158
|
+
{% for name, n in sev.items() %}<a href="#tab={{ name|lower }}"><span class="{{ name }}">{{ icons[name] }} {{ name }} {{ n }}</span></a>{% endfor %}
|
|
159
|
+
</p>
|
|
160
|
+
{% if overview.dataset_level %}<p class="note" id="dataset-level">{{ t.overview_dataset_level.format(n=overview.dataset_level) }}</p>{% endif %}
|
|
161
|
+
{% if skipped_junk %}<p class="note" id="skipped-junk">{{ skipped_junk }} hidden/junk file(s) skipped (._*, .DS_Store, __MACOSX/, Thumbs.db, desktop.ini).</p>{% endif %}
|
|
162
|
+
<p class="note">{{ t.suspicious_note }} {{ t.severity_help }}</p>
|
|
163
|
+
</section>
|
|
164
|
+
|
|
165
|
+
<section id="start">
|
|
166
|
+
<h2>{{ t.start_title }}</h2>
|
|
167
|
+
{% for w in warnings %}<div class="alert" id="majority-warning" role="note"><strong>{{ t.start_majority_title }}.</strong> {{ t.warning_prefix }} {{ w.message }}</div>
|
|
168
|
+
{% endfor %}
|
|
169
|
+
<ol class="start">
|
|
170
|
+
{% for it in start["items"] %}<li><span class="badge {{ it.level }}">{{ icons[it.level] }} {{ loop.index }}</span><span>{{ it.text }}{% if it.link %} <a href="#{{ it.link }}" class="go">{{ t.go_there }}</a>{% endif %}</span></li>
|
|
171
|
+
{% endfor %}</ol>
|
|
172
|
+
<div class="groups">
|
|
173
|
+
<div class="panel-box" id="group-definite">
|
|
174
|
+
<h3>{{ t.group_definite }} · {{ t.group_samples.format(n=start.n_definite) }}</h3>
|
|
175
|
+
<p class="note">{{ t.group_definite_help }}</p>
|
|
176
|
+
{% if start.definite %}<ul>{% for a in start.definite %}<li><code>{{ a.check }}</code> {{ a.name }}: {{ t.group_samples.format(n=a.samples) }}{% if a.check in t.definite_notes %} <span class="note definite-note">{{ t.definite_notes[a.check] }}</span>{% endif %}</li>{% endfor %}</ul>
|
|
177
|
+
{% else %}<p id="definite-clean">{{ start.definite_clean }}</p>{% endif %}
|
|
178
|
+
{% if start.definite_link %}<p><a href="#{{ start.definite_link }}" class="go">{{ t.go_there }}</a></p>{% endif %}
|
|
179
|
+
{% if absolute_kinds %}<p class="note" id="absolute-kinds">Absolute findings by kind (samples): {% for a in absolute_kinds %}{{ a.samples }} {{ a.label }} ({{ a.check }}){% if not loop.last %}, {% endif %}{% endfor %}.</p>{% endif %}
|
|
180
|
+
</div>
|
|
181
|
+
<div class="panel-box" id="group-uncertain">
|
|
182
|
+
<h3>{{ t.group_uncertain }} · {{ t.group_samples.format(n=start.n_uncertain) }}</h3>
|
|
183
|
+
<p class="note">{{ t.group_uncertain_help }}</p>
|
|
184
|
+
{% if start.uncertain %}<ul>{% for a in start.uncertain %}<li><code>{{ a.check }}</code> {{ a.name }}: {{ t.group_samples.format(n=a.samples) }}</li>{% endfor %}</ul>
|
|
185
|
+
{% else %}<p>{{ t.group_empty }}</p>{% endif %}
|
|
186
|
+
{% if start.uncertain_link %}<p><a href="#{{ start.uncertain_link }}" class="go">{{ t.go_there }}</a></p>{% endif %}
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</section>
|
|
190
|
+
</section>
|
|
191
|
+
|
|
192
|
+
<section id="tab-review" class="tabpanel" role="tabpanel" aria-labelledby="tab-btn-review" data-tab="review" tabindex="0">
|
|
193
|
+
<h2 class="tab-title">{{ t.tab_review }}{% if review_n is not none %} ({{ review_n }}){% endif %}</h2>
|
|
194
|
+
{% if not budget_view and not review_checks %}<p class="note" id="review-none">{{ t.review_none }}</p>{% endif %}
|
|
195
|
+
{% if budget_view %}
|
|
196
|
+
<section id="budget">
|
|
197
|
+
{% if budget_view.absolute_rows %}
|
|
198
|
+
<h2>Absolute findings: all {{ budget_view.absolute_rows|length }} samples (never cut by --budget)</h2>
|
|
199
|
+
<p class="note" id="budget-rule">{{ budget_view.summary }}. --budget {{ budget_view.budget }} limits only the uncertain list below.<br>
|
|
200
|
+
By kind: {% for a in budget_view.absolute_by_check %}{{ a.samples }} {{ a.label }} ({{ a.check }}){% if not loop.last %}, {% endif %}{% endfor %}.</p>
|
|
201
|
+
<div class="scroll">
|
|
202
|
+
<table id="absolute-list">
|
|
203
|
+
<tr><th>#</th><th>sample</th><th>checks</th><th>severity</th><th>message</th><th>panels</th></tr>
|
|
204
|
+
{% for b in budget_view.absolute_rows %}
|
|
205
|
+
<tr><td>{{ b.row.rank }}</td><td class="sid">{{ b.row.sample_id }}</td><td>{% for c in b.row.checks %}<code>{{ c }}</code> {{ check_name(c) }}{% if not loop.last %}, {% endif %}{% endfor %}</td><td><span class="badge {{ b.row.max_severity }}">{{ icons.get(b.row.max_severity, "") }} {{ b.row.max_severity }}</span></td><td>{{ b.row.message or '' }}</td>
|
|
206
|
+
<td>{% if b.panels %}<a href="#{{ b.anchor }}">view</a>{% else %}omitted (size budget){% endif %}</td></tr>
|
|
207
|
+
{% endfor %}
|
|
208
|
+
</table>
|
|
209
|
+
</div>
|
|
210
|
+
{% for b in budget_view.absolute_rows if b.panels %}
|
|
211
|
+
<div class="card" id="{{ b.anchor }}">
|
|
212
|
+
<div class="head"><strong>#{{ b.row.rank }} {{ b.row.sample_id }}</strong><span>{{ b.row.checks|join(", ") }} ({{ b.row.max_severity }})</span></div>
|
|
213
|
+
{% set r = b %}
|
|
214
|
+
{% include "panels.j2" %}
|
|
215
|
+
</div>
|
|
216
|
+
{% endfor %}
|
|
217
|
+
{% endif %}
|
|
218
|
+
<h2>Review list: the {{ budget_view.returned }} most suspicious samples (budget {{ budget_view.budget }})</h2>
|
|
219
|
+
<p class="note">
|
|
220
|
+
{{ budget_view.returned - budget_view.n_below }} of {{ budget_view.returned }} rows crossed a threshold;
|
|
221
|
+
{% if budget_view.n_below %}<span class="tag">below threshold</span> marks the {{ budget_view.n_below }} rows filled in by suspicion score without a finding.{% else %}none is below threshold.{% endif %}
|
|
222
|
+
{% if budget_view.overrides %}<br>--sensitivity {{ budget_view.overrides }} was ignored because --budget wins (the list has a fixed size).{% endif %}
|
|
223
|
+
</p>
|
|
224
|
+
<div class="scroll">
|
|
225
|
+
<table>
|
|
226
|
+
<tr><th>#</th><th>sample</th><th>status</th><th title="percentile rank of the finding score within its check in this dataset (max over checks)">suspicion</th><th title="distance from the dataset median divided by the threshold (1.0 = exactly at the threshold)">z/k</th><th>why</th><th>panels</th></tr>
|
|
227
|
+
{% for b in budget_view.rows %}
|
|
228
|
+
<tr class="{% if b.row.below_threshold %}below{% endif %}"><td>{{ b.row.rank }}</td><td class="sid">{{ b.row.sample_id }}</td>
|
|
229
|
+
<td>{% if b.row.below_threshold %}<span class="tag">below threshold</span>{% else %}{{ b.row.checks|join(", ") }} ({{ b.row.max_severity }}){% endif %}</td>
|
|
230
|
+
<td>{{ '%.3f'|format(b.row.suspicion or 0) }}</td><td>{{ '%.2f'|format(b.row.ratio) }}</td><td>{{ b.why or b.row.message or '' }}</td>
|
|
231
|
+
<td>{% if b.panels %}<a href="#{{ b.anchor }}">view</a>{% else %}omitted (size budget){% endif %}</td></tr>
|
|
232
|
+
{% endfor %}
|
|
233
|
+
</table>
|
|
234
|
+
</div>
|
|
235
|
+
{% for b in budget_view.rows if b.panels %}
|
|
236
|
+
<div class="card{% if b.row.below_threshold %} below{% endif %}" id="{{ b.anchor }}">
|
|
237
|
+
<div class="head"><strong>#{{ b.row.rank }} {{ b.row.sample_id }}</strong>{% if b.row.below_threshold %}<span class="tag">below threshold</span>{% endif %}<span>z/k {{ '%.2f'|format(b.row.ratio) }}</span></div>
|
|
238
|
+
{% if b.why %}<div class="why">why listed: {{ b.why }}</div>{% endif %}
|
|
239
|
+
{% set r = b %}
|
|
240
|
+
{% include "panels.j2" %}
|
|
241
|
+
</div>
|
|
242
|
+
{% endfor %}
|
|
243
|
+
</section>
|
|
244
|
+
{% endif %}
|
|
245
|
+
{% if review_checks %}
|
|
246
|
+
<section id="review">
|
|
247
|
+
<h2>Samples to verify by hand ({% if review|length < review_total %}top {{ review|length }} of {{ review_total }}{% else %}{{ review_total }}{% endif %})</h2>
|
|
248
|
+
<p class="note">Unique samples flagged by any of: {{ review_checks|join(", ") }}. One row per sample, highest severity then highest score first.{% if review|length < review_total %} Showing only the first {{ review|length }}; use --review-all for the full list.{% endif %}</p>
|
|
249
|
+
<div class="scroll">
|
|
250
|
+
<table>
|
|
251
|
+
<tr><th>#</th><th>sample</th><th>split</th><th>checks</th><th>max score</th><th>panels</th></tr>
|
|
252
|
+
{% for r in review %}
|
|
253
|
+
<tr class="item" data-badges="{% for c in r.row.checks %}{{ c }}:{{ r.row.severity.name }}{% if not loop.last %} {% endif %}{% endfor %}" data-split="{{ r.row.split or '' }}" data-text="{{ (r.row.sample_id ~ ' ' ~ r.row.messages|join(' '))|lower }}">
|
|
254
|
+
<td>{{ loop.index }}</td><td class="sid">{{ r.row.sample_id }}</td><td>{{ r.row.split or '-' }}</td>
|
|
255
|
+
<td>{{ r.row.checks|join(", ") }}</td><td>{{ '%.2f'|format(r.row.max_score) }}</td>
|
|
256
|
+
<td>{% if r.panels %}<a href="#{{ r.anchor }}">view</a>{% else %}omitted (size budget){% endif %}</td></tr>
|
|
257
|
+
{% endfor %}
|
|
258
|
+
</table>
|
|
259
|
+
</div>
|
|
260
|
+
{% for r in review if r.panels %}
|
|
261
|
+
<div class="card item" id="{{ r.anchor }}" data-badges="{% for c in r.row.checks %}{{ c }}:{{ r.row.severity.name }}{% if not loop.last %} {% endif %}{% endfor %}" data-split="{{ r.row.split or '' }}" data-text="{{ (r.row.sample_id ~ ' ' ~ r.row.messages|join(' '))|lower }}">
|
|
262
|
+
<div class="head"><span class="badge {{ r.row.severity.name }}">{{ icons[r.row.severity.name] }} {{ r.row.severity.name }}</span>
|
|
263
|
+
<strong class="sid">{{ r.row.sample_id }}</strong>{% if r.row.split %}<span>split {{ r.row.split }}</span>{% endif %}
|
|
264
|
+
<span>{{ r.row.checks|join(", ") }}</span><span>max score {{ '%.2f'|format(r.row.max_score) }}</span></div>
|
|
265
|
+
<div class="msg">{% for m in r.row.messages %}{{ m }}{% if not loop.last %}<br>{% endif %}{% endfor %}</div>
|
|
266
|
+
{% include "panels.j2" %}
|
|
267
|
+
</div>
|
|
268
|
+
{% endfor %}
|
|
269
|
+
</section>
|
|
270
|
+
{% endif %}
|
|
271
|
+
</section>
|
|
272
|
+
|
|
273
|
+
{% for p in sev_panels %}
|
|
274
|
+
<section id="tab-{{ p.key }}" class="tabpanel sevpanel" role="tabpanel" aria-labelledby="tab-btn-{{ p.key }}" data-tab="{{ p.key }}" data-sev="{{ p.sev }}" tabindex="0">
|
|
275
|
+
<h2 class="tab-title"><span class="badge {{ p.sev }}">{{ icons[p.sev] }} {{ p.sev }}</span> {{ t.sev_tab_title.format(sev=p.sev, n=p.n) }}</h2>
|
|
276
|
+
{% if p.empty %}
|
|
277
|
+
<p class="ok-msg" id="empty-{{ p.key }}">{{ icons.CLEAN }} {{ p.empty }}</p>
|
|
278
|
+
{% else %}
|
|
279
|
+
<p class="note images-note">{{ t.sev_tab_help }} {{ t.images_note.format(n=p.n_images, m=p.n) }}</p>
|
|
280
|
+
<div class="filter-slot"></div>
|
|
281
|
+
{% for g in p.groups %}
|
|
282
|
+
<section class="fgroup" id="{{ g.anchor }}" data-key="{{ p.sev }}:{{ g.id }}" data-n="{{ g.n }}">
|
|
283
|
+
<h3><code>{{ g.id }}</code> {{ g.name }} <span class="gcount">— {{ t.group_count.format(n=g.n, s="" if g.n == 1 else "s", m=g.cards|length) }}<span class="gshown"></span></span></h3>
|
|
284
|
+
<p class="note">{{ g.means }}</p>
|
|
285
|
+
{% if g.pair %}<p class="note">{{ t.group_pair_images }} <a href="#pairs">{{ t.go_there }}</a></p>
|
|
286
|
+
{% elif g.shown < g.total %}<p class="note">{{ t.group_images.format(shown=g.shown, total=g.total) }}</p>
|
|
287
|
+
{% endif %}
|
|
288
|
+
{% for c in g.cards %}
|
|
289
|
+
<div class="card item finding" id="{{ c.anchor }}" data-badges="{{ c.issue.check_id }}:{{ c.issue.severity.name }}" data-split="{{ c.issue.split or '' }}" data-cls="{{ c.cls }}"{% if c.ratio is not none %} data-ratio="{{ '%.3f'|format(c.ratio) }}"{% endif %} data-text="{{ (c.issue.sample_id ~ ' ' ~ c.issue.message)|lower }}">
|
|
290
|
+
<div class="head"><span class="badge {{ c.issue.severity.name }}">{{ icons[c.issue.severity.name] }} {{ c.issue.severity.name }}</span>
|
|
291
|
+
<strong><code>{{ c.issue.check_id }}</code> {{ c.name }}</strong><strong class="sid">{{ c.issue.sample_id }}</strong>
|
|
292
|
+
{% if c.issue.split %}<span>split {{ c.issue.split }}</span>{% endif %}{% if c.cls %}<span>class {{ c.cls }}</span>{% endif %}<span>score {{ '%.2f'|format(c.issue.score) }}</span></div>
|
|
293
|
+
<div class="msg">{{ c.issue.message }}</div>
|
|
294
|
+
{% if c.why %}<div class="why">why flagged: {{ c.why }}</div>{% endif %}
|
|
295
|
+
{% set r = c %}
|
|
296
|
+
{% include "panels.j2" %}
|
|
297
|
+
</div>
|
|
298
|
+
{% endfor %}
|
|
299
|
+
<p class="js-only"><button type="button" class="more cmore" hidden></button></p>
|
|
300
|
+
<details class="ftable-wrap js-only"><summary>{{ t.group_table.format(n=g.n) }}</summary>
|
|
301
|
+
<div class="scroll"><table class="ftable"><tbody></tbody></table></div>
|
|
302
|
+
<p><button type="button" class="more gmore" hidden></button></p>
|
|
303
|
+
</details>
|
|
304
|
+
</section>
|
|
305
|
+
{% endfor %}
|
|
306
|
+
{% endif %}
|
|
307
|
+
</section>
|
|
308
|
+
{% endfor %}
|
|
309
|
+
|
|
310
|
+
<section id="tab-duplicates" class="tabpanel" role="tabpanel" aria-labelledby="tab-btn-duplicates" data-tab="duplicates" tabindex="0">
|
|
311
|
+
{% if not (pair_cards or dup.l001) %}<h2 class="tab-title">{{ t.dup_title }}</h2>
|
|
312
|
+
<p class="ok-msg" id="dup-none">{{ t.dup_empty }}</p>
|
|
313
|
+
{% endif %}
|
|
314
|
+
{% if pair_cards or dup.l001 %}
|
|
315
|
+
<section id="pairs">
|
|
316
|
+
<h2>{{ t.dup_title }} ({{ pair_checks|join(", ") or "L001" }}){% if pair_cards %} — {{ pair_cards|length }} pairs shown, one card per pair{% endif %}</h2>
|
|
317
|
+
{% if dup.leak_pairs %}<div class="alert" id="leak-alert"><span class="badge {{ dup.leak_level }}">{{ icons[dup.leak_level] }} {{ dup.leak_level }}</span> {{ t.dup_leak.format(n=dup.leak_pairs) }}</div>
|
|
318
|
+
{% else %}<p class="note">{{ t.dup_none_across }}</p>{% endif %}
|
|
319
|
+
<p class="note">{{ t.dup_tiers }}</p>
|
|
320
|
+
{% if dup.l001 %}<p class="note">{{ t.dup_l001.format(n=dup.l001) }}</p>{% endif %}
|
|
321
|
+
{% for c in pair_cards %}
|
|
322
|
+
{% set g = c.group %}
|
|
323
|
+
{% set p = g.primary %}
|
|
324
|
+
<div class="card item finding pair-card" id="{{ c.anchor }}" data-badges="{{ g.badges }}" data-split="{{ p.data.split_a or '' }}{% if p.data.split_b %} {{ p.data.split_b }}{% endif %}" data-text="{{ (g.a ~ ' ' ~ g.b ~ ' ' ~ g.issues|map(attribute='message')|join(' '))|lower }}">
|
|
325
|
+
<div class="head">
|
|
326
|
+
{% for i in g.issues %}<span class="badge {{ i.severity.name }}">{{ icons[i.severity.name] }} {{ i.check_id }} {{ i.severity.name }}{% if tier_label(i) %} {{ tier_label(i) }}{% endif %}{% if i.data.iou is defined %} IoU {{ '%.2f'|format(i.data.iou) }}{% endif %}</span>{% endfor %}
|
|
327
|
+
<strong class="sid">{{ g.a }}</strong><span class="sid">+ {{ g.b }}</span>
|
|
328
|
+
{% if p.data.split_a or p.data.split_b %}<span>split {{ p.data.split_a or '-' }} / {{ p.data.split_b or '-' }}</span>{% endif %}<span>score {{ '%.2f'|format(g.max_score) }}</span></div>
|
|
329
|
+
{% for i in g.issues %}<div class="msg">{{ i.message }}</div>
|
|
330
|
+
{% endfor %}
|
|
331
|
+
<div class="pairinfo note">pHash distance {{ p.data.phash_distance }}, dHash distance {{ p.data.dhash_distance }}{% if p.data.transform != 'identity' %}, transform of B: {{ p.data.transform }}{% endif %}{% if g.iou_issue %}, mask IoU {{ '%.2f'|format(g.iou_issue.data.iou) }} (threshold {{ g.iou_issue.data.iou_threshold }}){% endif %}{% if p.data.exact %}, byte-identical{% endif %}</div>
|
|
332
|
+
{% set r = {'panels': c.panels, 'issue': p} %}
|
|
333
|
+
{% include "pair_panels.j2" %}
|
|
334
|
+
</div>
|
|
335
|
+
{% endfor %}
|
|
336
|
+
</section>
|
|
337
|
+
{% endif %}
|
|
338
|
+
</section>
|
|
339
|
+
|
|
340
|
+
<section id="tab-normal" class="tabpanel" role="tabpanel" aria-labelledby="tab-btn-normal" data-tab="normal" tabindex="0">
|
|
341
|
+
{% if not normal %}<h2 class="tab-title">{{ t.normal_title }}</h2>
|
|
342
|
+
<p class="note" id="normal-none">{{ t.normal_empty }}</p>
|
|
343
|
+
{% endif %}
|
|
344
|
+
{% if normal %}
|
|
345
|
+
<section id="normal" class="info-panel">
|
|
346
|
+
<h2>What is normal in this dataset <span class="info-badge">{{ t.normal_badge }}</span></h2>
|
|
347
|
+
<p class="note">{{ t.normal_help }}</p>
|
|
348
|
+
<p class="note">
|
|
349
|
+
{% if normal.frozen %}Judged against frozen calibration statistics ({{ normal.frozen }} reference samples), not against this dataset.
|
|
350
|
+
{% else %}Statistics computed from this dataset ({{ normal.n_valid }} usable samples).
|
|
351
|
+
{% endif %}
|
|
352
|
+
Relative checks flag a mask that is further than k = {{ normal.k }} robust deviations from the median
|
|
353
|
+
({% if normal.preset %}{{ normal.preset }} sensitivity, {% endif %}k set by: {{ normal.k_source }}).
|
|
354
|
+
{% if normal.budget %}Budget: the {{ normal.budget }} most suspicious samples are listed below; thresholds stay as configured.{% endif %}
|
|
355
|
+
</p>
|
|
356
|
+
{% if normal.skipped %}
|
|
357
|
+
<p class="note"><strong>Relative checks were skipped:</strong> {{ normal.skipped }}</p>
|
|
358
|
+
{% elif normal.rows %}
|
|
359
|
+
<div class="scroll">
|
|
360
|
+
<table class="normal">
|
|
361
|
+
<tr><th>measure</th><th>class</th><th class="num">samples</th><th class="num">median</th><th class="num">normal range</th><th>stats of</th><th>{{ t.col_meaning }}</th></tr>
|
|
362
|
+
{% for r in normal.rows %}
|
|
363
|
+
<tr><td>{{ r.label }}</td><td>{{ r.class }}</td><td class="num">{{ r.n }}</td><td class="num">{{ r.median }}</td><td class="num">{{ r.range }}</td><td>{{ r.source }}</td><td class="note">{{ r.meaning }}</td></tr>
|
|
364
|
+
{% endfor %}
|
|
365
|
+
</table>
|
|
366
|
+
</div>
|
|
367
|
+
{% endif %}
|
|
368
|
+
{% if normal.profile %}
|
|
369
|
+
<h3>Dataset profile</h3>
|
|
370
|
+
<p class="note">Facts about the dataset, not mask-quality findings (border contact and image size are not counted as suspicious; <code>--include-profile-checks</code> turns G004/T003 back on).</p>
|
|
371
|
+
<ul id="profile">
|
|
372
|
+
{% for line in normal.profile %}<li>{{ line }}</li>
|
|
373
|
+
{% endfor %}</ul>
|
|
374
|
+
{% endif %}
|
|
375
|
+
</section>
|
|
376
|
+
{% endif %}
|
|
377
|
+
</section>
|
|
378
|
+
|
|
379
|
+
<section id="tab-checks" class="tabpanel" role="tabpanel" aria-labelledby="tab-btn-checks" data-tab="checks" tabindex="0">
|
|
380
|
+
<section id="checks">
|
|
381
|
+
<h2>{{ t.checks_title }}</h2>
|
|
382
|
+
<p class="note">{{ t.checks_help }}</p>
|
|
383
|
+
<div class="scroll">
|
|
384
|
+
<table id="summary">
|
|
385
|
+
<thead><tr><th>{{ t.col_check }}</th><th>{{ t.col_name }}</th><th>{{ t.col_kind }}</th><th class="num">{{ t.col_samples }}</th><th>{{ t.col_severity }}</th><th>{{ t.col_threshold }}</th><th class="num">{{ t.col_examples }}</th></tr></thead>
|
|
386
|
+
<tbody>
|
|
387
|
+
{% for s in check_rows %}
|
|
388
|
+
<tr class="check-row" data-detail="d-{{ s.id }}" tabindex="0">
|
|
389
|
+
<td>{% if s.has_section %}<a href="#{{ s.anchor }}"><code>{{ s.id }}</code></a>{% else %}<code>{{ s.id }}</code>{% endif %}</td>
|
|
390
|
+
<td>{{ s.info.name if s.info else s.id }}{% if s.info %}<button type="button" class="q js-only" aria-expanded="false" aria-controls="d-{{ s.id }}" title="What does {{ s.id }} mean?">?</button>{% endif %}</td>
|
|
391
|
+
<td>{{ s.kind }}</td>
|
|
392
|
+
<td class="num">{{ s.samples_text }}</td>
|
|
393
|
+
<td>{% for k, v in s.severities.items() %}<span class="badge {{ k }}">{{ icons[k] }} {{ k }} {{ v }}</span> {% else %}-{% endfor %}</td>
|
|
394
|
+
<td>{% for th in s.thresholds %}<span class="thr"><code>{{ th.key }}</code> = {{ th.value }} <span class="note">· {{ th.source }}{% if th.per_class %}{{ t.per_class_note }}{% endif %}</span></span>{% else %}-{% endfor %}</td>
|
|
395
|
+
<td class="num">{{ s.shown }}</td>
|
|
396
|
+
</tr>
|
|
397
|
+
{% if s.info %}
|
|
398
|
+
<tr class="detail-row" id="d-{{ s.id }}" hidden><td colspan="7"><dl>
|
|
399
|
+
<dt>{{ t.detail_looks_for }}</dt><dd>{{ s.info.looks_for }}</dd>
|
|
400
|
+
<dt>{{ t.detail_means }}</dt><dd>{{ s.info.means }}</dd>
|
|
401
|
+
<dt>{{ t.detail_settings }}</dt><dd>{% if s.info.settings %}{{ t.detail_toml.format(keys=s.info.settings|join(", ")) }}{% else %}{{ t.detail_no_settings }}{% endif %}</dd>
|
|
402
|
+
<dt>{{ t.detail_weakness }}</dt><dd>{{ s.info.weakness }}</dd>
|
|
403
|
+
</dl></td></tr>
|
|
404
|
+
{% endif %}
|
|
405
|
+
{% else %}
|
|
406
|
+
<tr><td colspan="7">{{ t.no_findings_row }}</td></tr>
|
|
407
|
+
{% endfor %}
|
|
408
|
+
</tbody>
|
|
409
|
+
</table>
|
|
410
|
+
</div>
|
|
411
|
+
</section>
|
|
412
|
+
</section>
|
|
413
|
+
|
|
414
|
+
<section id="tab-reproduce" class="tabpanel" role="tabpanel" aria-labelledby="tab-btn-reproduce" data-tab="reproduce" tabindex="0">
|
|
415
|
+
<footer id="footer">
|
|
416
|
+
<h2>{{ t.footer_title }}</h2>
|
|
417
|
+
<p><strong>{{ t.footer_command }}</strong></p>
|
|
418
|
+
<pre><code id="command">{{ command }}</code></pre>
|
|
419
|
+
<p>{{ t.footer_adjust }}</p>
|
|
420
|
+
{% if provenance %}
|
|
421
|
+
<details id="provenance"><summary>Config provenance ({{ provenance|length }} values: value → source)</summary>
|
|
422
|
+
<div class="scroll">
|
|
423
|
+
<table>
|
|
424
|
+
<tr><th>key</th><th>value</th><th>source</th></tr>
|
|
425
|
+
{% for k, v, src in provenance %}
|
|
426
|
+
<tr><td>{{ k }}</td><td>{{ v }}</td><td>{{ src }}</td></tr>
|
|
427
|
+
{% endfor %}
|
|
428
|
+
</table>
|
|
429
|
+
</div>
|
|
430
|
+
</details>
|
|
431
|
+
{% endif %}
|
|
432
|
+
{% if timing.total_s is defined %}
|
|
433
|
+
<h3 id="timing">{{ t.timing_title }}</h3>
|
|
434
|
+
<p class="note">{{ t.timing_help }}</p>
|
|
435
|
+
<table class="timing" style="width:auto">
|
|
436
|
+
{% for key, label in t.timing_rows %}{% if timing[key] is defined %}<tr><td>{{ label }}</td><td class="num">{{ '%.2f'|format(timing[key]) }} s</td></tr>
|
|
437
|
+
{% endif %}{% endfor %}<tr><td>{{ t.timing_workers }}</td><td class="num">{{ timing.workers }}</td></tr>
|
|
438
|
+
<tr><td>{{ t.timing_samples }}</td><td class="num">{{ timing.n_samples }}</td></tr>
|
|
439
|
+
</table>
|
|
440
|
+
{% endif %}
|
|
441
|
+
{% if clean_checks %}
|
|
442
|
+
<p class="note" id="clean-checks">{{ t.clean_checks }}{{ clean_checks|join(", ") }}</p>
|
|
443
|
+
{% endif %}
|
|
444
|
+
{% if omitted %}
|
|
445
|
+
<p class="note">{{ omitted }} examples were left out to keep the file size under budget; use --max-examples to lower the count.</p>
|
|
446
|
+
{% endif %}
|
|
447
|
+
<p class="note" id="limits"><strong>Limits.</strong> {{ t.footer_limits }}</p>
|
|
448
|
+
</footer>
|
|
449
|
+
</section>
|
|
450
|
+
</main>
|
|
451
|
+
<script>
|
|
452
|
+
(function () {
|
|
453
|
+
function byId(x) { return document.getElementById(x); }
|
|
454
|
+
function all(sel, root) { return Array.prototype.slice.call((root || document).querySelectorAll(sel)); }
|
|
455
|
+
function fill(tpl, values) {
|
|
456
|
+
return tpl.replace(/\{(\w+)\}/g, function (m, k) { return values[k]; });
|
|
457
|
+
}
|
|
458
|
+
all(".check-row").forEach(function (row) {
|
|
459
|
+
var det = byId(row.dataset.detail);
|
|
460
|
+
if (!det) return;
|
|
461
|
+
var btn = row.querySelector(".q");
|
|
462
|
+
function toggle() {
|
|
463
|
+
det.hidden = !det.hidden;
|
|
464
|
+
if (btn) btn.setAttribute("aria-expanded", det.hidden ? "false" : "true");
|
|
465
|
+
}
|
|
466
|
+
row.addEventListener("click", function (e) { if (!e.target.closest("a")) toggle(); });
|
|
467
|
+
row.addEventListener("keydown", function (e) {
|
|
468
|
+
if (e.key === "Enter" || e.key === " ") { e.preventDefault(); toggle(); }
|
|
469
|
+
});
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
var bar = byId("filters"), fc = byId("f-check"), fs = byId("f-sev"), fp = byId("f-split"),
|
|
473
|
+
fk = byId("f-class"), ft = byId("f-text"), cnt = byId("f-count"), fr = byId("f-ratio");
|
|
474
|
+
var blob = JSON.parse(byId("findings-data").textContent);
|
|
475
|
+
var data = blob.rows.map(function (a) {
|
|
476
|
+
var r = {};
|
|
477
|
+
blob.fields.forEach(function (f, k) { r[f] = a[k]; });
|
|
478
|
+
r.n = blob.names[r.c] || r.c;
|
|
479
|
+
return r;
|
|
480
|
+
});
|
|
481
|
+
var PAGE = 30, groups = {}, items = [], findings = [];
|
|
482
|
+
var head = byId("ftable-head");
|
|
483
|
+
all(".fgroup").forEach(function (el) {
|
|
484
|
+
var table = el.querySelector(".ftable");
|
|
485
|
+
table.insertBefore(head.cloneNode(true), table.firstChild).removeAttribute("id");
|
|
486
|
+
groups[el.dataset.key] = {
|
|
487
|
+
el: el, body: el.querySelector("tbody"), more: el.querySelector(".gmore"),
|
|
488
|
+
cmore: el.querySelector(".cmore"), wrap: el.querySelector(".ftable-wrap"),
|
|
489
|
+
shownEl: el.querySelector(".gshown"), total: +el.dataset.n,
|
|
490
|
+
cards: all(".card.finding", el), rows: [], ok: [], limit: PAGE, climit: PAGE
|
|
491
|
+
};
|
|
492
|
+
});
|
|
493
|
+
function cell(tr, text) {
|
|
494
|
+
var td = document.createElement("td");
|
|
495
|
+
td.textContent = text;
|
|
496
|
+
tr.appendChild(td);
|
|
497
|
+
return td;
|
|
498
|
+
}
|
|
499
|
+
function draw(g) {
|
|
500
|
+
g.body.textContent = "";
|
|
501
|
+
var n = Math.min(g.limit, g.rows.length), frag = document.createDocumentFragment();
|
|
502
|
+
for (var k = 0; k < n; k++) {
|
|
503
|
+
var r = g.rows[k], tr = document.createElement("tr"), td;
|
|
504
|
+
cell(tr, r.b ? r.id + " + " + r.b : r.id).className = "sid";
|
|
505
|
+
cell(tr, r.sp || "-");
|
|
506
|
+
cell(tr, r.cl || "-");
|
|
507
|
+
td = cell(tr, r.m);
|
|
508
|
+
if (r.w) {
|
|
509
|
+
var w = document.createElement("div");
|
|
510
|
+
w.className = "why";
|
|
511
|
+
w.textContent = r.w;
|
|
512
|
+
td.appendChild(w);
|
|
513
|
+
}
|
|
514
|
+
td = cell(tr, "");
|
|
515
|
+
if (r.a) {
|
|
516
|
+
var a = document.createElement("a");
|
|
517
|
+
a.setAttribute("href", "#" + r.a);
|
|
518
|
+
a.textContent = bar.dataset.view;
|
|
519
|
+
td.appendChild(a);
|
|
520
|
+
}
|
|
521
|
+
frag.appendChild(tr);
|
|
522
|
+
}
|
|
523
|
+
g.body.appendChild(frag);
|
|
524
|
+
g.wrap.classList.toggle("hidden", !g.rows.length);
|
|
525
|
+
g.cards.forEach(function (el) { var k = g.ok.indexOf(el); el.classList.toggle("hidden", k < 0 || k >= g.climit); });
|
|
526
|
+
[[g.more, g.rows.length - g.limit], [g.cmore, g.ok.length - g.climit]].forEach(function (b) {
|
|
527
|
+
b[0].hidden = b[1] <= 0;
|
|
528
|
+
b[0].textContent = fill(bar.dataset.more, {n: Math.min(PAGE, b[1])});
|
|
529
|
+
});
|
|
530
|
+
g.shownEl.textContent = g.rows.length < g.total ? " · " + fill(bar.dataset.count, {shown: g.rows.length, total: g.total}) : "";
|
|
531
|
+
g.el.classList.toggle("hidden", !g.rows.length && !g.ok.length);
|
|
532
|
+
}
|
|
533
|
+
function apply() {
|
|
534
|
+
var sev = fs.value, c = fc.value, p = fp.value, cl = fk.value,
|
|
535
|
+
t = ft.value.trim().toLowerCase(), shown = 0, tr = fr ? parseFloat(fr.value) : 1;
|
|
536
|
+
if (fr) byId("f-ratio-v").textContent = tr.toFixed(1);
|
|
537
|
+
var panel = sev ? byId("tab-" + sev.toLowerCase()) : null;
|
|
538
|
+
items = panel ? all(".card.item", panel) : [];
|
|
539
|
+
findings = items.filter(function (el) { return el.classList.contains("finding"); });
|
|
540
|
+
items.forEach(function (el) {
|
|
541
|
+
var badges = (el.dataset.badges || "").split(" "), hit = false;
|
|
542
|
+
for (var k = 0; k < badges.length; k++) {
|
|
543
|
+
var parts = badges[k].split(":");
|
|
544
|
+
if ((!c || parts[0] === c) && (!sev || parts[1] === sev)) { hit = true; break; }
|
|
545
|
+
}
|
|
546
|
+
var ok = hit && (!el.dataset.ratio || parseFloat(el.dataset.ratio) >= tr) &&
|
|
547
|
+
(!p || (" " + el.dataset.split + " ").indexOf(" " + p + " ") >= 0) &&
|
|
548
|
+
(!cl || el.dataset.cls === cl) &&
|
|
549
|
+
(!t || el.dataset.text.indexOf(t) >= 0);
|
|
550
|
+
el.dataset.ok = ok ? "1" : "";
|
|
551
|
+
if (ok && el.classList.contains("finding")) shown++;
|
|
552
|
+
});
|
|
553
|
+
cnt.textContent = shown + " of " + findings.length + " examples shown";
|
|
554
|
+
Object.keys(groups).forEach(function (k) { groups[k].rows = []; groups[k].limit = groups[k].climit = PAGE; });
|
|
555
|
+
data.forEach(function (r) {
|
|
556
|
+
if (r.s !== sev) return;
|
|
557
|
+
if ((!c || r.c === c) && (!cl || r.cl === cl) && (r.r === null || r.r >= tr) &&
|
|
558
|
+
(!p || (" " + r.sp + " ").indexOf(" " + p + " ") >= 0) &&
|
|
559
|
+
(!t || (r.id + " " + r.b + " " + r.m + " " + r.w).toLowerCase().indexOf(t) >= 0)) {
|
|
560
|
+
var g = groups[r.s + ":" + r.c];
|
|
561
|
+
if (g) g.rows.push(r);
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
Object.keys(groups).forEach(function (k) {
|
|
565
|
+
var g = groups[k];
|
|
566
|
+
if (k.indexOf(sev + ":") !== 0) return;
|
|
567
|
+
g.ok = g.cards.filter(function (el) { return el.dataset.ok === "1"; });
|
|
568
|
+
draw(g);
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
Object.keys(groups).forEach(function (k) {
|
|
572
|
+
var g = groups[k];
|
|
573
|
+
g.more.addEventListener("click", function () { g.limit += PAGE; draw(g); });
|
|
574
|
+
g.cmore.addEventListener("click", function () { g.climit += PAGE; draw(g); });
|
|
575
|
+
g.body.addEventListener("click", function (e) {
|
|
576
|
+
var a = e.target.closest("a");
|
|
577
|
+
if (!a) return;
|
|
578
|
+
e.preventDefault();
|
|
579
|
+
if (location.hash === a.getAttribute("href")) fromHash(); else location.hash = a.getAttribute("href");
|
|
580
|
+
});
|
|
581
|
+
});
|
|
582
|
+
[fc, fp, fk].forEach(function (e) { e.addEventListener("change", apply); });
|
|
583
|
+
ft.addEventListener("input", apply);
|
|
584
|
+
if (fr) fr.addEventListener("input", apply);
|
|
585
|
+
|
|
586
|
+
if (window.matchMedia && window.matchMedia("(max-width:700px)").matches) byId("f-det").open = false;
|
|
587
|
+
var tabs = all('[role="tab"]'), current = null;
|
|
588
|
+
document.documentElement.classList.add("js-tabs");
|
|
589
|
+
function panelOf(name) { return byId("tab-" + name); }
|
|
590
|
+
function select(name) {
|
|
591
|
+
if (!panelOf(name)) name = "overview";
|
|
592
|
+
current = name;
|
|
593
|
+
tabs.forEach(function (tb) {
|
|
594
|
+
var on = tb.dataset.tab === name;
|
|
595
|
+
tb.setAttribute("aria-selected", on ? "true" : "false");
|
|
596
|
+
tb.tabIndex = on ? 0 : -1;
|
|
597
|
+
panelOf(tb.dataset.tab).classList.toggle("active", on);
|
|
598
|
+
if (on && tb.scrollIntoView) tb.scrollIntoView({block: "nearest", inline: "nearest"});
|
|
599
|
+
});
|
|
600
|
+
var panel = panelOf(name), slot = panel.querySelector(".filter-slot");
|
|
601
|
+
if (slot) {
|
|
602
|
+
slot.appendChild(bar);
|
|
603
|
+
bar.hidden = false;
|
|
604
|
+
fs.value = panel.dataset.sev;
|
|
605
|
+
apply();
|
|
606
|
+
} else {
|
|
607
|
+
bar.hidden = true;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
function reveal(el) {
|
|
611
|
+
var gEl = el.closest(".fgroup");
|
|
612
|
+
if (gEl && el.classList.contains("hidden")) {
|
|
613
|
+
var g = groups[gEl.dataset.key], k = g.ok.indexOf(el);
|
|
614
|
+
if (k < 0) {
|
|
615
|
+
[fc, fp, fk].forEach(function (e) { e.value = ""; });
|
|
616
|
+
ft.value = "";
|
|
617
|
+
if (fr) fr.value = 1;
|
|
618
|
+
apply();
|
|
619
|
+
k = g.ok.indexOf(el);
|
|
620
|
+
}
|
|
621
|
+
if (k >= g.climit) { g.climit = Math.ceil((k + 1) / PAGE) * PAGE; draw(g); }
|
|
622
|
+
}
|
|
623
|
+
el.classList.remove("flash");
|
|
624
|
+
void el.offsetWidth;
|
|
625
|
+
el.classList.add("flash");
|
|
626
|
+
setTimeout(function () { el.classList.remove("flash"); }, 2600);
|
|
627
|
+
}
|
|
628
|
+
function fromHash() {
|
|
629
|
+
var h = decodeURIComponent(location.hash.slice(1));
|
|
630
|
+
if (h.indexOf("tab=") === 0) {
|
|
631
|
+
select(h.slice(4));
|
|
632
|
+
var top = byId("main").offsetTop;
|
|
633
|
+
if (window.scrollY > top) window.scrollTo(0, top);
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
var el = h ? byId(h) : null, panel = el ? el.closest(".tabpanel") : null;
|
|
637
|
+
if (panel) {
|
|
638
|
+
select(panel.dataset.tab);
|
|
639
|
+
reveal(el);
|
|
640
|
+
el.scrollIntoView();
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
select(current || "overview");
|
|
644
|
+
}
|
|
645
|
+
tabs.forEach(function (tb, k) {
|
|
646
|
+
tb.addEventListener("click", function (e) {
|
|
647
|
+
e.preventDefault();
|
|
648
|
+
var target = "#tab=" + tb.dataset.tab;
|
|
649
|
+
if (location.hash === target) fromHash(); else location.hash = target;
|
|
650
|
+
});
|
|
651
|
+
tb.addEventListener("keydown", function (e) {
|
|
652
|
+
var d = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0, n = null;
|
|
653
|
+
if (d) n = tabs[(k + d + tabs.length) % tabs.length];
|
|
654
|
+
else if (e.key === "Home") n = tabs[0];
|
|
655
|
+
else if (e.key === "End") n = tabs[tabs.length - 1];
|
|
656
|
+
else if (e.key === " ") { e.preventDefault(); tb.click(); }
|
|
657
|
+
if (n) { e.preventDefault(); n.focus(); }
|
|
658
|
+
});
|
|
659
|
+
});
|
|
660
|
+
window.addEventListener("hashchange", fromHash);
|
|
661
|
+
fromHash();
|
|
662
|
+
})();
|
|
663
|
+
</script>
|
|
664
|
+
</body>
|
|
665
|
+
</html>
|