{% if sarifs | length > 1 %} {% set accordion_state = "" %} {% else %} {% set accordion_state = "show" %} {% endif %} {% for sarif in sarifs %} {% set group_name = f_metadata(sarif)[0] %} {% set url = f_metadata(sarif)[1] %} {% set branch = f_metadata(sarif)[2] %} {% set commit = f_metadata(sarif)[3] %} {% set button_text_class = "text-danger" %} {% set status_hint = "fail" %} {% if sarif.get_results() | length == 0 %} {% set button_text_class = "text-success" %} {% set status_hint = "pass" %} {% endif %} {% set item_id = f_random(16) %}

{% for r in sarif.get_results() %} {% set r_ph = r["locations"][0]["physicalLocation"] %} {% set rnd = f_random(16) %} {% endfor %}
Location Code Rule Message
{% set file = "/".join(r_ph["artifactLocation"]["uri"].split("/")[3:]) %} {% set start_line = r_ph["region"]["startLine"] %} {% set end_line = r_ph["region"]["endLine"] %} {% set start = r_ph["region"]["startColumn"] %} {% set end = r_ph["region"]["endColumn"] %} {% set location = branch %} {% if commit | length > 0 %} {% set location = commit %} {% endif %} {{ file }}
Lines: {{start_line}}.{{start}} to {{end_line}}.{{end}}
{% set code = r_ph["region"]["snippet"]["text"] %} {% if start_line == end_line %} {% set code = f_highlight(code, start-1, end-1) %} {% endif %}
{{ code }}
{{ r["ruleId"] }}

{{ r["message"]["text"] }}

{% block accordion_close %}
{% endblock %} {% endfor %}