<commit_before><%= render "navigation", :referrer => "stats" %>

<div class="span12">
  <div class="well">
    <h3>Statistics</h3>
    <table class="table table-striped table-bordered">
      <thead>
        <tr>
          <th>Event</th>
          <th>overall</th>
          <th>year</th>
          <th>month</th>
          <th>week</th>
          <th>day</th>
        </tr>
      </thead>
      <tbody>
        <% @event_counts_per_group.each do |event_string, group_hash| %>
          <tr>
            <td><%= link_to event_string, best_boy_admin_details_path(:event => event_string, :owner_type => current_owner_type) %></td>
            <% group_hash.each do |group, counter| %>
              <td><%= counter %></td>
            <% end %>
          </tr>
        <% end %>
      </tbody>
      <tfoot>
        <tr>
          <th>Total</th>
          <th><%= @event_counts_per_group.values.inject(0){|sum, hash| sum += hash['overall'].to_i; sum} %></th>
          <th><%= @event_counts_per_group.values.inject(0){|sum, hash| sum += hash['year'].to_i; sum} %></th>
          <th><%= @event_counts_per_group.values.inject(0){|sum, hash| sum += hash['month'].to_i; sum} %></th>
          <th><%= @event_counts_per_group.values.inject(0){|sum, hash| sum += hash['week'].to_i; sum} %></th>
          <th><%= @event_counts_per_group.values.inject(0){|sum, hash| sum += hash['day'].to_i; sum} %></th>
        </tr>
      </tfoot>
    </table>
  </div>
</div>

<div class="span12">
  <div class="well">
    <h3 class="pull-left">Statistics for <%= current_year %> per month</h3>
    <div class="pull-right">
      <%= form_tag best_boy_admin_stats_path, :method => :get do %>
        <%= hidden_field_tag :owner_type, current_owner_type %>
        <%= select_tag :year, options_for_select(available_years, :selected => current_year), :onchange => "submit();" %>
      <% end %>
    </div>
    <table class="table table-striped table-bordered">
      <thead>
        <tr>
          <th>Event</th>
          <% month_name_array.each do |month| %>
            <th><%= month %></th>
          <% end %>
        </tr>
      </thead>
      <tbody>
        <% @event_counts_per_month.each do |event_string, month_hash| %>
          <tr>
            <td><%= event_string %></td>
            <% month_hash.each do |month, counter| %>
              <td><%= counter %></td>
            <% end %>
          </tr>
        <% end %>
      </tbody>
      <tfoot>
        <tr>
          <th>Total</th>
          <% (1..12).to_a.map(&:to_s).each do |month_no| %>
            <th><%= @event_counts_per_month.values.inject(0){|sum, hash| sum += hash[month_no].to_i; sum} %></th>
          <% end %>
        </tr>
      </tfoot>
    </table><commit_msg>cite data via new instance variables<commit_after><%= render "navigation", :referrer => "stats" %>

<div class="span12">
  <div class="well">
    <h3>Statistics</h3>
    <table class="table table-striped table-bordered">
      <thead>
        <tr>
          <th>Event</th>
          <th>overall</th>
          <th>year</th>
          <th>month</th>
          <th>week</th>
          <th>day</th>
        </tr>
      </thead>
      <tbody>
        <% @occurences.keys.each do |key| %>
          <tr>
            <td><%= key.to_s %></td>
            <td><%= @occurences[key][:overall] %></td>
            <td><%= @occurences[key][:yearly] %></td>
            <td><%= @occurences[key][:monthly] %></td>
            <td><%= @occurences[key][:weekly] %> </td>
            <td><%= @occurences[key][:daily] %></td>
          </tr>
        <% end %>
      </tbody>
      <tfoot>
        <tr>
          <th>Total</th>
          <th><%= @this_year_totals[:overall] %></th>
          <th><%= @this_year_totals[:yearly] %></th>
          <th><%= @this_year_totals[:monthly] %></th>
          <th><%= @this_year_totals[:weekly] %></th>
          <th><%= @this_year_totals[:daily] %></th>
        </tr>
      </tfoot>
    </table>
  </div>
</div>
<div class="span12">
  <div class="well">
    <h3 class="pull-left">Statistics for <%= current_year %> per month</h3>
    <div class="pull-right">
      <%= form_tag best_boy_admin_stats_path, :method => :get do %>
        <%= hidden_field_tag :owner_type, current_owner_type %>
        <%= select_tag :year, options_for_select(available_years, :selected => current_year), :onchange => "submit();" %>
      <% end %>
    </div>
    <table class="table table-striped table-bordered">
      <thead>
        <tr>
          <th>Event</th>
          <% month_name_array.each do |month| %>
            <th><%= month %></th>
          <% end %>
        </tr>
      </thead>
      <tbody>
        <% @selected_year_month_reports.keys.each do |event| %>
          <tr>
            <td><%= event %></td>
            <% @selected_year_month_reports[event].keys.each do |month| %>
              <td><%= @selected_year_month_reports[event][month] %></td>
            <% end %>
          </tr>
        <% end %>
      </tbody>
      <tfoot>
        <tr>
          <td><strong>Total</strong></td>
          <% @selected_year_totals.keys.each do |month| %>
            <td><%= @selected_year_totals[month] %></td>
          <% end %>
        </tr>
      </tfoot>
    </table>
{'fraction_non_alphanumeric': 0.20363984674329502, 'fraction_numerical': 0.004789272030651341, 'mean_word_length': 2.0284222737819024, 'pattern_counts': {'":': 0, '<': 233, '<?xml version=': 0, '>': 243, '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': '4036264', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1811, 'n_words': 327}