Finding
File: src/raki/report/templates/report.html.j2:1183
Severity: Minor
Problem
An empty {% if … %}{% endif %} block evaluates a complex but broken expression on every render while producing no output. It is leftover code from an abandoned attempt to detect per-session scores, superseded by the namespace(value=false) loop immediately below (lines 1185–1191).
The expression is also semantically wrong:
session_id in <list-of-dicts> is always False
selectattr('sample_scores.' ~ session_id, 'defined') fails to resolve dotted names correctly
This is confusing for future maintainers.
Suggested Fix
Delete lines 1183–1184 entirely:
{# Remove these two lines: #}
{% if sample_result.scores and session_id in … %}
{% endif %}
The namespace-based check on lines 1185–1191 is the correct implementation and already handles this case.
Reference
Found during review of #273 (feat: structured drill-down sections in HTML report, ticket #250).
Finding
File:
src/raki/report/templates/report.html.j2:1183Severity: Minor
Problem
An empty
{% if … %}{% endif %}block evaluates a complex but broken expression on every render while producing no output. It is leftover code from an abandoned attempt to detect per-session scores, superseded by thenamespace(value=false)loop immediately below (lines 1185–1191).The expression is also semantically wrong:
session_id in <list-of-dicts>is alwaysFalseselectattr('sample_scores.' ~ session_id, 'defined')fails to resolve dotted names correctlyThis is confusing for future maintainers.
Suggested Fix
Delete lines 1183–1184 entirely:
The
namespace-based check on lines 1185–1191 is the correct implementation and already handles this case.Reference
Found during review of #273 (feat: structured drill-down sections in HTML report, ticket #250).