<commit_before><% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, extensions = {}) %>
<% colors = {"critical"=>"darkred", "high"=> "red", "medium"=> "orange", "low"=> "yellow", "informational"=> "blue", "observation"=> "info"} %>
<% index = SecureRandom.hex %>
<% vuln_index = SecureRandom.hex %>
<!-- move to application.js -->

<dl class="accordion updateable" data-updateable-id="<%= finding["id"] %>" data-accordion>
  <dd class="accordion-navigation">
    <a href="#accordion_<%= index %>">
      <button href="#" id="drop_<%= index %>1_button" data-dropdown="drop_<%= index %>1" aria-controls="drop_<%= index %>1" aria-expanded="false" class="severity label tiny button dropdown adjust_top <%= colors[finding["severity"].to_s.downcase].to_s %>"><%= finding["severity"].to_s.titleize %></button>
      <strong><%= finding["name"] || finding["type"] || finding["details"]  %></strong>
      <button href="#" id="drop_<%= index %>_button" data-dropdown="drop_<%= index %>" aria-controls="drop_<%= index %>" aria-expanded="false" class="status right tiny button dropdown"><%= finding["status"] %></button><br>
      <ul id="drop_<%= index %>1" data-dropdown-content class="f-dropdown" aria-hidden="true">
        <% ["Critical", "High", "Medium", "Low", "Observation", "Informational"].each do |status| %>
          <li>
            <%= link_to status, update_metadata_result_path(id: @result, "key[0]"=> "vulnerabilities.[id:#{finding["id"]}].severity", "value[0]"=> status, "target[0]"=>"#drop_#{index}1_button"), remote: true %>
          </li>
        <% end %>
      </ul>
      <ul id="drop_<%= index %>" data-dropdown-content class="f-dropdown" aria-hidden="true">
        <% if finding.try(:[],"status").match(/open/i) %>
          <% ["Remediated", "False Positive", "Ignored"].each do |status| %>
            <li>
              <%= link_to status, update_metadata_result_path(id: @result, "key[0]"=> "vulnerabilities.[id:#{finding["id"]}].status", "value[0]"=> status, "target[0]"=>"#drop_#{index}_button"), remote: true %>
            </li>
          <% end %>
        <% else %>
          <% ["Reopened"].each do |status| %>
            <li>
              <%= link_to status, update_metadata_result_path(id: @result, "key[0]"=> "vulnerabilities.[id:#{finding["id"]}].status", "value[0]"=> status, "target[0]"=>"#drop_#{index}_button"), remote: true %>
            </li>
          <% end %>
        <% end %>
      </ul>
    </a>
    <div id="accordion_<%= index %>" class="content panel">
      <div class="row">
        <div class="large-8 columns">
          <dl class="dl-horizontal" style="word-wrap: break-word">
            <% if finding["type"].present? %>
              <dt>Type</dt>
              <dd><%= finding["type"] %></dd>
            <% end %>
            <% if finding["commit_branch"].present? %>
              <dt>Commit Branch</dt>
              <dd><%= finding["commit_branch"] %></dd>
            <% end %>
            <% if finding["commit_name"].present? %>
              <dt>Commit Name</dt>
              <dd><%= finding["commit_name"] %></dd>
            <% end %>
            <% if finding["commit_email"].present? %>
              <dt>Commit Email</dt>
              <dd><%= finding["commit_email"] %></dd>
            <% end %>
            <% if finding["match_count"].present? %>
              <dt>Match Count</dt>
              <dd><%= finding["match_count"].to_s %></dd>
            <% end %>
            <dt>URL</dt>
            <dd><a href="<%= finding["url"] %>"><%= finding["url"] %></a></dd>
          </dl>
        </div>
        <div class="large-4 columns">
          <dl class="dl-horizontal">
            <dt>Identified</dt>
            <dd><%= time_ago_in_words(finding["identified"]) %> ago</dd>
            <dt>Source(s)</dt>
            <dd><%= finding["source"].join(", ") %></dd>
            <% vuln_index = SecureRandom.hex %>
            <dt>Jira ID(s)</dt>
            <dd id="jira_ids_<%= vuln_index %>" name="jira_ids_<%= vuln_index %>">
            <% if @result.metadata["vulnerabilities"][i].try(:[], "jira_ids").to_s != "" %>
            <% @result.metadata["vulnerabilities"][i].try(:[], "jira_ids").split(',').each do |jira| %>
            <a href="<%= Jiralicious.uri %>/browse/<%= jira %>" target="_blank"><%= jira %></a>
            <% end %>
            <% end %>
            </dd>
            <dt>Update Jira</dt>
            <dd>
              <%= form_tag update_metadata_result_path(id: @result, "key[0]"=> "vulnerabilities.[id:#{finding["id"]}].jira_ids", "target[0]" => "#jira_ids_" + vuln_index), remote: true do %>
                <div class="row collapse">
                  <div class="small-8 columns">
                    <%= text_field_tag "value[0]", nil, placeholder: "Jira IDs (comma separated)", id: "vulnerability_jira_field_" + vuln_index %>
                  </div>
                  <input type="hidden" name="<%= Jiralicious.uri.to_s %>" id="jira_url">
                  <div class="small-2 columns">
                    <%= submit_tag "Update", class: "button postfix tiny update_jira", remote: true, :data => {result_id: vuln_index} %><commit_msg>fixes jira link ui bug<commit_after><% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, extensions = {}) %>
<% colors = {"critical"=>"darkred", "high"=> "red", "medium"=> "orange", "low"=> "yellow", "informational"=> "blue", "observation"=> "info"} %>
<% index = SecureRandom.hex %>
<% vuln_index = SecureRandom.hex %>
<!-- move to application.js -->

<dl class="accordion updateable" data-updateable-id="<%= finding["id"] %>" data-accordion>
  <dd class="accordion-navigation">
    <a href="#accordion_<%= index %>">
      <button href="#" id="drop_<%= index %>1_button" data-dropdown="drop_<%= index %>1" aria-controls="drop_<%= index %>1" aria-expanded="false" class="severity label tiny button dropdown adjust_top <%= colors[finding["severity"].to_s.downcase].to_s %>"><%= finding["severity"].to_s.titleize %></button>
      <strong><%= finding["name"] || finding["type"] || finding["details"]  %></strong>
      <button href="#" id="drop_<%= index %>_button" data-dropdown="drop_<%= index %>" aria-controls="drop_<%= index %>" aria-expanded="false" class="status right tiny button dropdown"><%= finding["status"] %></button><br>
      <ul id="drop_<%= index %>1" data-dropdown-content class="f-dropdown" aria-hidden="true">
        <% ["Critical", "High", "Medium", "Low", "Observation", "Informational"].each do |status| %>
          <li>
            <%= link_to status, update_metadata_result_path(id: @result, "key[0]"=> "vulnerabilities.[id:#{finding["id"]}].severity", "value[0]"=> status, "target[0]"=>"#drop_#{index}1_button"), remote: true %>
          </li>
        <% end %>
      </ul>
      <ul id="drop_<%= index %>" data-dropdown-content class="f-dropdown" aria-hidden="true">
        <% if finding.try(:[],"status").match(/open/i) %>
          <% ["Remediated", "False Positive", "Ignored"].each do |status| %>
            <li>
              <%= link_to status, update_metadata_result_path(id: @result, "key[0]"=> "vulnerabilities.[id:#{finding["id"]}].status", "value[0]"=> status, "target[0]"=>"#drop_#{index}_button"), remote: true %>
            </li>
          <% end %>
        <% else %>
          <% ["Reopened"].each do |status| %>
            <li>
              <%= link_to status, update_metadata_result_path(id: @result, "key[0]"=> "vulnerabilities.[id:#{finding["id"]}].status", "value[0]"=> status, "target[0]"=>"#drop_#{index}_button"), remote: true %>
            </li>
          <% end %>
        <% end %>
      </ul>
    </a>
    <div id="accordion_<%= index %>" class="content panel">
      <div class="row">
        <div class="large-8 columns">
          <dl class="dl-horizontal" style="word-wrap: break-word">
            <% if finding["type"].present? %>
              <dt>Type</dt>
              <dd><%= finding["type"] %></dd>
            <% end %>
            <% if finding["commit_branch"].present? %>
              <dt>Commit Branch</dt>
              <dd><%= finding["commit_branch"] %></dd>
            <% end %>
            <% if finding["commit_name"].present? %>
              <dt>Commit Name</dt>
              <dd><%= finding["commit_name"] %></dd>
            <% end %>
            <% if finding["commit_email"].present? %>
              <dt>Commit Email</dt>
              <dd><%= finding["commit_email"] %></dd>
            <% end %>
            <% if finding["match_count"].present? %>
              <dt>Match Count</dt>
              <dd><%= finding["match_count"].to_s %></dd>
            <% end %>
            <dt>URL</dt>
            <dd><a href="<%= finding["url"] %>"><%= finding["url"] %></a></dd>
          </dl>
        </div>
        <div class="large-4 columns">
          <dl class="dl-horizontal">
            <dt>Identified</dt>
            <dd><%= time_ago_in_words(finding["identified"]) %> ago</dd>
            <dt>Source(s)</dt>
            <dd><%= finding["source"].join(", ") %></dd>
            <% vuln_index = SecureRandom.hex %>
            <dt>Jira ID(s)</dt>
            <dd id="jira_ids_<%= vuln_index %>" name="jira_ids_<%= vuln_index %>">

            <% if finding.try(:[], "jira_ids").to_s != "" %>
            <% byebug %>
            <% finding.try(:[], "jira_ids").split(',').each do |jira| %>
            <a href="<%= Jiralicious.uri %>/browse/<%= jira %>" target="_blank"><%= jira %></a>
            <% end %>
            <% end %>
            </dd>
            <dt>Update Jira</dt>
            <dd>
              <%= form_tag update_metadata_result_path(id: @result, "key[0]"=> "vulnerabilities.[id:#{finding["id"]}].jira_ids", "target[0]" => "#jira_ids_" + vuln_index), remote: true do %>
                <div class="row collapse">
                  <div class="small-8 columns">
                    <%= text_field_tag "value[0]", nil, placeholder: "Jira IDs (comma separated)", id: "vulnerability_jira_field_" + vuln_index %>
                  </div>
                  <input type="hidden" name="<%= Jiralicious.uri.to_s %>" id="jira_url">
                  <div class="small-2 columns">
                    <%= submit_tag "Update", class: "button postfix tiny update_jira", remote: true, :data => {result_id: vuln_index} %>
{'fraction_non_alphanumeric': 0.22166100048567267, 'fraction_numerical': 0.004079650315687227, 'mean_word_length': 2.586206896551724, 'pattern_counts': {'":': 0, '<': 288, '<?xml version=': 0, '>': 324, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5894320', 'n_tokens_mistral': 3535, 'n_tokens_neox': 3229, 'n_words': 623}