lib/templates/flog.html.erb in p8-metric_fu-0.8.0.16 vs lib/templates/flog.html.erb in p8-metric_fu-0.8.2
- old
+ new
@@ -1,31 +1,26 @@
<html>
<head>
<title>Flog Reporter</title>
<style>
- <%= inline_css("default.css") %>
+ <%= open(File.join(MetricFu::TEMPLATE_DIR, "#{template_name}.css")) { |f| f.read } %>
</style>
</head>
<body>
- <h1>Flog Results</h1>
- <p><a href='http://ruby.sadi.st/Flog.html'>Flog</a> measures code complexity.</p>
- <table>
- <tr>
- <th>File</th>
- <th>Total score</th>
- <th>Methods</th>
- <th>Average score</th>
- <th>Highest score</th>
+ <h1>Flogged files</h1>
+ <p>Generated on <%= Time.now.localtime %> with <a href='http://ruby.sadi.st/Flog.html'>flog</a></p>
+ <table class='report'>
+ <tr><th>File</th><th>Total score</th><th>Methods</th><th>Average score</th><th>Highest score</th></tr>
+ <% count = 0 %>
+ <% flog_hashes.sort {|x,y| y[:page].highest_score <=> x[:page].highest_score }.each do |flog_hash| %>
+ <tr class='<%= Base.cycle("light", "dark", count) %>'>
+ <td><a href='<%= flog_hash[:path]%>'><%= flog_hash[:path].sub('.html', '.rb') %></a></td>
+ <td class='score'><%= sprintf(SCORE_FORMAT, flog_hash[:page].score) %></td>
+ <td class='score'><%= flog_hash[:page].scanned_methods.length %></td>
+ <td class='score'><%= sprintf(SCORE_FORMAT, flog_hash[:page].average_score) %></td>
+ <td class='score'><%= sprintf(SCORE_FORMAT, flog_hash[:page].highest_score) %></td>
</tr>
- <% pages.sort {|x,y| y.highest_score <=> x.highest_score }.each_with_index do |page, count| %>
- <tr class='<%= cycle("light", "dark", count) %>'>
- <td><a href='<%= page.path %>'><%= page.path.sub('.html', '.rb') %></a></td>
- <td class='score'><%= sprintf(SCORE_FORMAT, page.score) %></td>
- <td class='score'><%= page.scanned_methods.length %></td>
- <td class='score'><%= sprintf(SCORE_FORMAT, page.average_score) %></td>
- <td class='score'><%= sprintf(SCORE_FORMAT, page.highest_score) %></td>
- </tr>
+ <% count += 1 %>
<% end %>
</table>
- <p>Generated on <%= Time.now.localtime %></p>
</body>
</html>
\ No newline at end of file