Sha256: 7170418eb842fafe1165e507780433d8975ccd2eb40901805b73effc487531d9

Contents?: true

Size: 2 KB

Versions: 5

Compression:

Stored size: 2 KB

Contents

<h3>Hotspot Results</h3>
<p>Meta analysis of your metrics to find hotspots in your code.</p>
<br/>

<% if @hotspots.nil? || @hotspots.size.zero? %>
  No Hotspots were found.
<% else %>

  <% granularities = %w[files classes methods] %>
  <table>
    <tr valign="top">
    <% granularities.each do |granularity| %>
       <th width='33%'>
    <%= granularity.to_s.capitalize %></th>
    <% end %>
    </tr>

    <% hotspots = [] %>
    <% granularities.each_index do |index| %>
      <% granularity = granularities[index] %>
      <% hotspots << @hotspots[granularity] %>
    <% end %>

    <% hotspots_length = 0 %>
    <% columns = [0, 1, 2] %>
    <% while (hotspots_length < hotspots[0].length || hotspots_length < hotspots[1].length || hotspots_length < hotspots[2].length) do %>
      <tr  valign="top">
        <% columns.each do |column| %>
          <% item = hotspots[column].length >= hotspots_length ? hotspots[column][hotspots_length] : nil %>
          <% if item %>
            <% location = item.fetch('location') %>
            <% file, line =  location.fetch('file_name'), location.fetch('line_number') %>
            <td>
            <b>
              <%= display_location(location) %>
            </b>
            <% unless per_file_data[file].empty? %>
              <small>&laquo;
                <b><a href="<%= file.gsub(%r{/}, '_') %>.html<%= (line.nil? ? '' : "#line#{line}") %>">annotate</a></b>
               &raquo;</small>
            <% end %>
            <br/><br/>
            <!-- TODO HOTSPOTS for metric fu nice metric_link method -->
            <% item.fetch('details').each do |metric, info| %>
              <%#= metric_link(@stat, metric, h(metric.to_s.capitalize)) + ": " + h(info)%><br/>
              <%= "#{metric.to_s.capitalize}: #{info}" %><br/>
            <% end %>
            </td>
          <% else %>
          <td> &nbsp; </td>
          <% end %>
        <% end %>
        <% hotspots_length += 1 %>
      </tr>
    <% end %>

  </table>
<% end %>

<%= render_partial 'report_footer' %>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
metric_fu-4.11.3 lib/metric_fu/metrics/hotspots/report.html.erb
metric_fu-4.11.2 lib/metric_fu/metrics/hotspots/report.html.erb
metric_fu-4.11.1 lib/metric_fu/metrics/hotspots/report.html.erb
metric_fu-4.11.0 lib/metric_fu/metrics/hotspots/report.html.erb
metric_fu-4.10.0 lib/metric_fu/metrics/hotspots/template_awesome/hotspots.html.erb