danmayer-metric_fu 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. data/HISTORY +237 -0
  2. data/MIT-LICENSE +22 -0
  3. data/README +29 -0
  4. data/Rakefile +18 -0
  5. data/TODO +6 -0
  6. data/lib/base/base_template.rb +172 -0
  7. data/lib/base/churn_analyzer.rb +38 -0
  8. data/lib/base/code_issue.rb +97 -0
  9. data/lib/base/configuration.rb +199 -0
  10. data/lib/base/flay_analyzer.rb +50 -0
  11. data/lib/base/flog_analyzer.rb +43 -0
  12. data/lib/base/generator.rb +166 -0
  13. data/lib/base/graph.rb +44 -0
  14. data/lib/base/line_numbers.rb +74 -0
  15. data/lib/base/location.rb +85 -0
  16. data/lib/base/md5_tracker.rb +52 -0
  17. data/lib/base/metric_analyzer.rb +404 -0
  18. data/lib/base/ranking.rb +34 -0
  19. data/lib/base/rcov_analyzer.rb +43 -0
  20. data/lib/base/reek_analyzer.rb +163 -0
  21. data/lib/base/report.rb +108 -0
  22. data/lib/base/roodi_analyzer.rb +37 -0
  23. data/lib/base/saikuro_analyzer.rb +48 -0
  24. data/lib/base/scoring_strategies.rb +29 -0
  25. data/lib/base/stats_analyzer.rb +37 -0
  26. data/lib/base/table.rb +102 -0
  27. data/lib/generators/churn.rb +28 -0
  28. data/lib/generators/flay.rb +31 -0
  29. data/lib/generators/flog.rb +111 -0
  30. data/lib/generators/hotspots.rb +52 -0
  31. data/lib/generators/rails_best_practices.rb +53 -0
  32. data/lib/generators/rcov.rb +122 -0
  33. data/lib/generators/reek.rb +81 -0
  34. data/lib/generators/roodi.rb +35 -0
  35. data/lib/generators/saikuro.rb +256 -0
  36. data/lib/generators/stats.rb +58 -0
  37. data/lib/graphs/engines/bluff.rb +113 -0
  38. data/lib/graphs/engines/gchart.rb +157 -0
  39. data/lib/graphs/flay_grapher.rb +18 -0
  40. data/lib/graphs/flog_grapher.rb +57 -0
  41. data/lib/graphs/grapher.rb +11 -0
  42. data/lib/graphs/rails_best_practices_grapher.rb +19 -0
  43. data/lib/graphs/rcov_grapher.rb +18 -0
  44. data/lib/graphs/reek_grapher.rb +30 -0
  45. data/lib/graphs/roodi_grapher.rb +18 -0
  46. data/lib/graphs/stats_grapher.rb +20 -0
  47. data/lib/metric_fu.rb +40 -0
  48. data/lib/templates/awesome/awesome_template.rb +73 -0
  49. data/lib/templates/awesome/churn.html.erb +58 -0
  50. data/lib/templates/awesome/css/buttons.css +82 -0
  51. data/lib/templates/awesome/css/default.css +91 -0
  52. data/lib/templates/awesome/css/integrity.css +334 -0
  53. data/lib/templates/awesome/css/reset.css +7 -0
  54. data/lib/templates/awesome/css/syntax.css +19 -0
  55. data/lib/templates/awesome/flay.html.erb +34 -0
  56. data/lib/templates/awesome/flog.html.erb +55 -0
  57. data/lib/templates/awesome/hotspots.html.erb +62 -0
  58. data/lib/templates/awesome/index.html.erb +34 -0
  59. data/lib/templates/awesome/layout.html.erb +30 -0
  60. data/lib/templates/awesome/rails_best_practices.html.erb +27 -0
  61. data/lib/templates/awesome/rcov.html.erb +42 -0
  62. data/lib/templates/awesome/reek.html.erb +40 -0
  63. data/lib/templates/awesome/roodi.html.erb +27 -0
  64. data/lib/templates/awesome/saikuro.html.erb +71 -0
  65. data/lib/templates/awesome/stats.html.erb +51 -0
  66. data/lib/templates/javascripts/bluff-min.js +1 -0
  67. data/lib/templates/javascripts/excanvas.js +35 -0
  68. data/lib/templates/javascripts/js-class.js +1 -0
  69. data/lib/templates/standard/churn.html.erb +31 -0
  70. data/lib/templates/standard/default.css +64 -0
  71. data/lib/templates/standard/flay.html.erb +34 -0
  72. data/lib/templates/standard/flog.html.erb +57 -0
  73. data/lib/templates/standard/hotspots.html.erb +54 -0
  74. data/lib/templates/standard/index.html.erb +41 -0
  75. data/lib/templates/standard/rails_best_practices.html.erb +29 -0
  76. data/lib/templates/standard/rcov.html.erb +43 -0
  77. data/lib/templates/standard/reek.html.erb +42 -0
  78. data/lib/templates/standard/roodi.html.erb +29 -0
  79. data/lib/templates/standard/saikuro.html.erb +84 -0
  80. data/lib/templates/standard/standard_template.rb +26 -0
  81. data/lib/templates/standard/stats.html.erb +55 -0
  82. data/spec/base/base_template_spec.rb +177 -0
  83. data/spec/base/configuration_spec.rb +276 -0
  84. data/spec/base/generator_spec.rb +223 -0
  85. data/spec/base/graph_spec.rb +61 -0
  86. data/spec/base/line_numbers_spec.rb +62 -0
  87. data/spec/base/md5_tracker_spec.rb +57 -0
  88. data/spec/base/report_spec.rb +146 -0
  89. data/spec/generators/churn_spec.rb +41 -0
  90. data/spec/generators/flay_spec.rb +105 -0
  91. data/spec/generators/flog_spec.rb +70 -0
  92. data/spec/generators/rails_best_practices_spec.rb +52 -0
  93. data/spec/generators/rcov_spec.rb +180 -0
  94. data/spec/generators/reek_spec.rb +134 -0
  95. data/spec/generators/roodi_spec.rb +24 -0
  96. data/spec/generators/saikuro_spec.rb +74 -0
  97. data/spec/generators/stats_spec.rb +74 -0
  98. data/spec/graphs/engines/bluff_spec.rb +19 -0
  99. data/spec/graphs/engines/gchart_spec.rb +156 -0
  100. data/spec/graphs/flay_grapher_spec.rb +56 -0
  101. data/spec/graphs/flog_grapher_spec.rb +108 -0
  102. data/spec/graphs/rails_best_practices_grapher_spec.rb +61 -0
  103. data/spec/graphs/rcov_grapher_spec.rb +56 -0
  104. data/spec/graphs/reek_grapher_spec.rb +65 -0
  105. data/spec/graphs/roodi_grapher_spec.rb +56 -0
  106. data/spec/graphs/stats_grapher_spec.rb +68 -0
  107. data/spec/resources/line_numbers/foo.rb +33 -0
  108. data/spec/resources/line_numbers/module.rb +11 -0
  109. data/spec/resources/line_numbers/module_surrounds_class.rb +15 -0
  110. data/spec/resources/line_numbers/two_classes.rb +11 -0
  111. data/spec/resources/saikuro/app/controllers/sessions_controller.rb_cyclo.html +10 -0
  112. data/spec/resources/saikuro/app/controllers/users_controller.rb_cyclo.html +16 -0
  113. data/spec/resources/saikuro/index_cyclo.html +155 -0
  114. data/spec/resources/saikuro_sfiles/thing.rb_cyclo.html +11 -0
  115. data/spec/resources/yml/20090630.yml +7922 -0
  116. data/spec/resources/yml/metric_missing.yml +1 -0
  117. data/spec/spec.opts +6 -0
  118. data/spec/spec_helper.rb +7 -0
  119. data/tasks/metric_fu.rake +22 -0
  120. metadata +462 -0
@@ -0,0 +1,7 @@
1
+ /*
2
+ Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3
+ Code licensed under the BSD License:
4
+ http://developer.yahoo.net/yui/license.txt
5
+ version: 2.5.2
6
+ */
7
+ html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
@@ -0,0 +1,19 @@
1
+ table { background: #fff; color: #000; }
2
+ .ruby .normal { color: #000; }
3
+ .ruby .comment { color: #005; font-style: italic; }
4
+ .ruby .keyword { color: #A44; font-weight: bold; }
5
+ .ruby .method { color: #44f; }
6
+ .ruby .class { color: #b1713d; }
7
+ .ruby .module { color: #050; }
8
+ .ruby .punct { color: #668; font-weight: bold; }
9
+ .ruby .symbol { color: #00f; }
10
+ .ruby .string { color: #4a4; }
11
+ .ruby .char { color: #F07; }
12
+ .ruby .ident { color: #000; }
13
+ .ruby .constant { color: #b1713d; }
14
+ .ruby .regex { color: #B66; background: #FEF; }
15
+ .ruby .number { color: #F99; }
16
+ .ruby .attribute { color: #f84; }
17
+ .ruby .global { color: #7FB; }
18
+ .ruby .expr { color: #227; }
19
+ .ruby .escape { color: #277; }
@@ -0,0 +1,34 @@
1
+ <h3>Flay Results</h3>
2
+
3
+ <p><a href='http://ruby.sadi.st/Flay.html'>Flay</a> analyzes ruby code for structural similarities.</p>
4
+
5
+ <% graph_name = 'flay' %>
6
+ <% if MetricFu.configuration.graph_engine == :gchart %>
7
+ <img src="<%= graph_name %>.png?<%= Time.now.to_i %>" />
8
+ <% else %>
9
+ <canvas id="graph"></canvas>
10
+ <script language="javascript" src="<%= graph_name %>.js?<%= Time.now.to_i %>" type="text/javascript"></script>
11
+ <% end %>
12
+
13
+ <h4>Total Score (lower is better): <%= @flay[:total_score] %></h4>
14
+ <h5>Scores less than <%= MetricFu.flay[:minimum_score] %> are not shown or part of the total</h5>
15
+
16
+ <table>
17
+ <tr>
18
+ <th>Files</th>
19
+ <th>Matches</th>
20
+ </tr>
21
+ <% count = 0 %>
22
+ <% @flay[:matches].each do |match| %>
23
+ <tr class='<%= cycle("light", "dark", count) %>'>
24
+ <td>
25
+ <% match[:matches].each do |file| %>
26
+ <%= link_to_filename(file[:name], file[:line]) %><br/>
27
+ <% end %>
28
+ </td>
29
+ <td><%= match[:reason] %></td>
30
+ </tr>
31
+ <% count += 1 %>
32
+ <% end %>
33
+ </table>
34
+ <p>Generated on <%= Time.now.localtime %></p>
@@ -0,0 +1,55 @@
1
+ <h3>Flog Results</h3>
2
+ <p><a href='http://ruby.sadi.st/Flog.html'>Flog</a> measures code complexity.</p>
3
+
4
+ <% graph_name = 'flog' %>
5
+ <% if MetricFu.configuration.graph_engine == :gchart %>
6
+ <img src="<%= graph_name %>.png?<%= Time.now.to_i %>" />
7
+ <% else %>
8
+ <canvas id="graph"></canvas>
9
+ <script language="javascript" src="<%= graph_name %>.js?<%= Time.now.to_i %>" type="text/javascript"></script>
10
+ <% end %>
11
+
12
+ <h2>Total Flog score for all methods: <%= round_to_tenths @flog[:total]%></h2>
13
+ <h2>Average Flog score for all methods: <%= round_to_tenths @flog[:average]%></h2>
14
+
15
+ <table>
16
+ <tr>
17
+ <th>File</th>
18
+ <th>Total score</th>
19
+ <th>Methods</th>
20
+ <th>Average score</th>
21
+ <th>Highest score</th>
22
+ </tr>
23
+ <% @flog[:method_containers].each do |method_container| %>
24
+ <tr>
25
+ <td><a href="#<%= method_container[:path].gsub(/[^a-z]+/, '_') %>"><%= method_container[:path] %></a></td>
26
+ <td><%= round_to_tenths method_container[:total_score] %></td>
27
+ <td><%= method_container[:methods].size %></td>
28
+ <td><%= round_to_tenths method_container[:average_score] %></td>
29
+ <td><%= round_to_tenths method_container[:highest_score] %></td>
30
+ </tr>
31
+ <% end %>
32
+ </table>
33
+
34
+ <% @flog[:method_containers].each do |method_container| %>
35
+ <h2 id="<%= method_container[:path].gsub(/[^a-z]+/, '_') %>"><%= link_to_filename(method_container[:path]) %></h2>
36
+
37
+ <% method_container[:methods].each do |full_method_name, method_info| %>
38
+ <% path, line = method_info[:path].split(":") if method_info[:path] %>
39
+ <p><%= link_to_filename(path, line, full_method_name) %></p>
40
+ <p>Total Score: <%= round_to_tenths method_info[:score]%></p>
41
+ <table>
42
+ <tr>
43
+ <th>Score</th>
44
+ <th>Operator</th>
45
+ </tr>
46
+ <% method_info[:operators].each do |operator, score| %>
47
+ <tr>
48
+ <td><%= round_to_tenths score %></td>
49
+ <td><%= operator %></td>
50
+ </tr>
51
+ <% end %>
52
+ </table>
53
+ <% end %>
54
+ <% end %>
55
+ <p>Generated on <%= Time.now.localtime %></p>
@@ -0,0 +1,62 @@
1
+ <h3>Hotspot Results</h3>
2
+ <p>Meta analysis of your metrics to find hotspots in your code.</p>
3
+ <br/>
4
+
5
+ <% if !@hotspots || @hotspots.size == 0 %>
6
+ No Hotspots were found.
7
+ <% elsif @hotspots && @hotspots.size > 0 %>
8
+
9
+ <% granularities = [:files, :classes, :methods] %>
10
+ <table>
11
+ <tr valign="top">
12
+ <% granularities.each do |granularity| %>
13
+ <th width='33%'>
14
+ <%= granularity.to_s.capitalize %></th>
15
+ <% end %>
16
+ </tr>
17
+
18
+ <% items = [] %>
19
+ <% granularities.each_index do |index| %>
20
+ <% granularity = granularities[index] %>
21
+ <% items << @hotspots[granularity] %>
22
+ <% end %>
23
+
24
+ <% items_length = 0 %>
25
+ <% columns = [0, 1, 2] %>
26
+ <% while (items_length < items[0].length || items_length < items[1].length || items_length < items[2].length) do %>
27
+ <tr valign="top">
28
+ <% columns.each do |column| %>
29
+ <% item = items[column].length >= items_length ? items[column][items_length] : nil %>
30
+ <% if item %>
31
+ <td>
32
+ <b>
33
+ <%= display_location(item[:location], nil) %>
34
+ </b>
35
+ <% if item[:location].file_path %>
36
+ <% file, line = item[:location].file_path.split(/:/) %>
37
+ <% if per_file_data[file] %>
38
+ <small>&laquo;
39
+ <b><a href="<%= file.gsub(%r{/}, '_') %>.html<%= (line.nil? ? '' : "#line#{line}") %>">annotate</a></b>
40
+ &raquo;</small>
41
+ <% end %>
42
+ <% end %>
43
+ <br/><br/>
44
+ <!-- TODO HOTSPOTS for metric fu nice metric_link method -->
45
+ <% item[:details].each do |metric, info| %>
46
+ <%#= metric_link(@stat, metric, h(metric.to_s.capitalize)) + ": " + h(info)%><br/>
47
+ <%= "#{metric.to_s.capitalize}: #{info}" %><br/>
48
+ <% end %>
49
+ </td>
50
+ <% else %>
51
+ <td> &nbsp; </td>
52
+ <% end %>
53
+ <% end %>
54
+ <% items_length += 1 %>
55
+ </tr>
56
+ <% end %>
57
+
58
+ </table>
59
+ <% end %>
60
+
61
+
62
+ <p>Generated on <%= Time.now.localtime %></p>
@@ -0,0 +1,34 @@
1
+ <h3>Metric Fu Results</h3>
2
+ <ul id='projects'>
3
+ <% if @churn %>
4
+ <li class='even failure'><a href="churn.html">Churn</a></li>
5
+ <% end %>
6
+ <% if @flay %>
7
+ <li class='even failure'><a href="flay.html">Flay</a></li>
8
+ <% end %>
9
+ <% if @flog %>
10
+ <li class='even failure'><a href="flog.html">Flog</a></li>
11
+ <% end %>
12
+ <% if @rcov %>
13
+ <li class='even failure'><a href="rcov.html">Rcov</a></li>
14
+ <% end %>
15
+ <% if @reek %>
16
+ <li class='even failure'><a href="reek.html">Reek</a></li>
17
+ <% end %>
18
+ <% if @roodi %>
19
+ <li class='even failure'><a href="roodi.html">Roodi</a></li>
20
+ <% end %>
21
+ <% if @saikuro %>
22
+ <li class='even failure'><a href="saikuro.html">Saikuro</a></li>
23
+ <% end %>
24
+ <% if @stats %>
25
+ <li class='even failure'><a href="stats.html">Stats</a></li>
26
+ <% end %>
27
+ <% if @rails_best_practices %>
28
+ <li class='even failure'><a href="rails_best_practices.html">Rails Best Practices report</a></li>
29
+ <% end %>
30
+ <% if @hotspots %>
31
+ <li class='even failure'><a href="hotspots.html">Hotspots</a></li>
32
+ <% end %>
33
+ </ul>
34
+ <p>Generated on <%= Time.now.localtime %></p>
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
5
+ <meta content='en' http-equiv='Content-Language' />
6
+ <title>metrics</title>
7
+ <style>
8
+ <%= inline_css("css/reset.css") %>
9
+ <%= inline_css("css/buttons.css") %>
10
+ <%= inline_css("css/integrity.css") %>
11
+ <%= inline_css("css/default.css") %>
12
+ </style>
13
+ <link REL="SHORTCUT ICON" HREF="/favicon.ico">
14
+ <script language="javascript" src="js-class.js" type="text/javascript"></script>
15
+ <script language="javascript" src="bluff-min.js" type="text/javascript"></script>
16
+ <script language="javascript" src="excanvas.js" type="text/javascript"></script>
17
+ </head>
18
+ <body>
19
+ <div id='header'>
20
+ <h1><a href="/">metrics</a> | <a href="index.html"><%= @name %></a></h1>
21
+ <address class='watermark'>
22
+ built with
23
+ <a href='http://metric-fu.rubyforge.org/'>metric-fu</a>
24
+ </address>
25
+ </div>
26
+ <div id='content'>
27
+ <%= @html %>
28
+ </div>
29
+ </body>
30
+ </html>
@@ -0,0 +1,27 @@
1
+ <h3>Rails Best Practices Results</h3>
2
+
3
+ <p><a href="http://github.com/flyerhzm/rails_best_practices">rails_best_practices</a> is a code metric tool for rails projects.</p>
4
+
5
+ <% graph_name = 'rails_best_practices' %>
6
+ <% if MetricFu.configuration.graph_engine == :gchart %>
7
+ <img src="<%= graph_name %>.png?<%= Time.now.to_i %>" />
8
+ <% else %>
9
+ <canvas id="graph"></canvas>
10
+ <script language="javascript" src="<%= graph_name %>.js?<%= Time.now.to_i %>" type="text/javascript"></script>
11
+ <% end %>
12
+
13
+ <table>
14
+ <tr>
15
+ <th>File Path</th>
16
+ <th>Warning</th>
17
+ </tr>
18
+ <% count = 0 %>
19
+ <% @rails_best_practices[:problems].each do |problem| %>
20
+ <tr class='<%= cycle("light", "dark", count) %>'>
21
+ <td><%= link_to_filename(problem[:file], problem[:line]) %></td>
22
+ <td><%= problem[:problem] %></td>
23
+ </tr>
24
+ <% count += 1 %>
25
+ <% end %>
26
+ </table>
27
+ <p>Generated on <%= Time.now.localtime %></p>
@@ -0,0 +1,42 @@
1
+ <h3>Rcov Code Coverage Results</h3>
2
+
3
+ <p>C0 code coverage information.</p>
4
+
5
+ <% graph_name = 'rcov' %>
6
+ <% if MetricFu.configuration.graph_engine == :gchart %>
7
+ <img src="<%= graph_name %>.png?<%= Time.now.to_i %>" />
8
+ <% else %>
9
+ <canvas id="graph"></canvas>
10
+ <script language="javascript" src="<%= graph_name %>.js?<%= Time.now.to_i %>" type="text/javascript"></script>
11
+ <% end %>
12
+
13
+ <p>Total Coverage: <%= @rcov.delete(:global_percent_run) %>% </p>
14
+ <table>
15
+ <tr>
16
+ <th>File Path</th>
17
+ <th>Percent run</th>
18
+ </tr>
19
+ <% count = 0 %>
20
+ <% @rcov.sort_by{ |k,v| v[:percent_run] }.each do |fname, file| %>
21
+ <tr>
22
+ <td><a href="#<%= fname.gsub(/[^a-z]+/, '_') %>"><%= fname %></a></td>
23
+ <td><%= file[:percent_run] %></td>
24
+ </tr>
25
+ <% count += 1 %>
26
+ <% end %>
27
+ </table>
28
+
29
+ <% @rcov.sort_by{ |k,v| v[:percent_run] }.each do |fname, file| %>
30
+ <h2 id="<%= fname.gsub(/[^a-z]+/, '_') %>"> <%= fname %></h2>
31
+ <div class="rcov_overflow">
32
+ <table class="rcov_code">
33
+ <% file[:lines].each_with_index do |line, index| %>
34
+ <tr>
35
+ <% css_class = line[:was_run] ? "rcov_run" : "rcov_not_run" %>
36
+ <td class="<%= css_class %>"><%= link_to_filename(fname, index + 1, "<pre>#{line[:content]}</pre>") %></td>
37
+ </tr>
38
+ <% end %>
39
+ </table>
40
+ </div>
41
+ <% end %>
42
+ <p>Generated on <%= Time.now.localtime %></p>
@@ -0,0 +1,40 @@
1
+ <h3>Reek Results</h3>
2
+
3
+ <p><a href="http://reek.rubyforge.org/">Reek</a> detects common code smells in ruby code.</p>
4
+
5
+ <% graph_name = 'reek' %>
6
+ <% if MetricFu.configuration.graph_engine == :gchart %>
7
+ <img src="<%= graph_name %>.png?<%= Time.now.to_i %>" />
8
+ <% else %>
9
+ <canvas id="graph"></canvas>
10
+ <script language="javascript" src="<%= graph_name %>.js?<%= Time.now.to_i %>" type="text/javascript"></script>
11
+ <% end %>
12
+
13
+ <table>
14
+ <tr>
15
+ <th>File Path</th>
16
+ <th>Method</th>
17
+ <th>Description</th>
18
+ <th>Type</th>
19
+ </tr>
20
+ <% count = 0 %>
21
+ <% @reek[:matches].each do |match| %>
22
+ <% match[:code_smells].each do |smell| %>
23
+ <tr class='<%= cycle("light", "dark", count) %>'>
24
+ <td><%= link_to_filename(match[:file_path]) %></td>
25
+ <td>
26
+ <%= smell[:method] %>
27
+ </td>
28
+ <td>
29
+ <%= smell[:message] %>
30
+ </td>
31
+ <td>
32
+ <%= smell[:type] %>
33
+ </td>
34
+ </tr>
35
+ <% count += 1 %>
36
+ <% end %>
37
+ <% end %>
38
+
39
+ </table>
40
+ <p>Generated on <%= Time.now.localtime %></p>
@@ -0,0 +1,27 @@
1
+ <h3>Roodi Results</h3>
2
+
3
+ <p><a href="http://roodi.rubyforge.org/">Roodi</a> parses your Ruby code and warns you about design issues you have based on the checks that is has configured.</p>
4
+
5
+ <% graph_name = 'roodi' %>
6
+ <% if MetricFu.configuration.graph_engine == :gchart %>
7
+ <img src="<%= graph_name %>.png?<%= Time.now.to_i %>" />
8
+ <% else %>
9
+ <canvas id="graph"></canvas>
10
+ <script language="javascript" src="<%= graph_name %>.js?<%= Time.now.to_i %>" type="text/javascript"></script>
11
+ <% end %>
12
+
13
+ <table>
14
+ <tr>
15
+ <th>File Path</th>
16
+ <th>Warning</th>
17
+ </tr>
18
+ <% count = 0 %>
19
+ <% @roodi[:problems].each do |problem| %>
20
+ <tr class='<%= cycle("light", "dark", count) %>'>
21
+ <td><%= link_to_filename(problem[:file], problem[:line]) %></td>
22
+ <td><%= problem[:problem] %></td>
23
+ </tr>
24
+ <% count += 1 %>
25
+ <% end %>
26
+ </table>
27
+ <p>Generated on <%= Time.now.localtime %></p>
@@ -0,0 +1,71 @@
1
+ <h3>Saikuro Results</h3>
2
+ <p><a href='http://saikuro.rubyforge.org/'>Saikuro</a> analyzes ruby code for cyclomatic complexity.</p>
3
+
4
+ <h2>Analyzed Methods</h2>
5
+ <table>
6
+ <tr>
7
+ <th>Method Name</th>
8
+ <th>Complexity</th>
9
+ <th># Lines</th>
10
+ </tr>
11
+ <% @saikuro[:methods].each do |method| %>
12
+ <tr>
13
+ <td><%= method[:name] %></td>
14
+ <td><%= method[:complexity] %></td>
15
+ <td><%= method[:lines] %></td>
16
+ </tr>
17
+ <% end %>
18
+ </table>
19
+
20
+
21
+
22
+ <h2>Analyzed Classes</h2>
23
+ <table>
24
+ <tr>
25
+ <th>Class Name</th>
26
+ <th>Complexity</th>
27
+ <th># Lines</th>
28
+ </tr>
29
+ <% @saikuro[:classes].each do |klass| %>
30
+ <tr>
31
+ <td><%= klass[:name] %></td>
32
+ <td><%= klass[:complexity] %></td>
33
+ <td><%= klass[:lines] %></td>
34
+ </tr>
35
+ <% end %>
36
+ </table>
37
+
38
+
39
+ <h2>Analyzed Files</h2>
40
+ <% @saikuro[:files].each do |file| %>
41
+ <% file[:classes].each do |klass| %>
42
+ <% if !klass[:methods].empty? %>
43
+ <h3><%= file[:filename] %></h3>
44
+ <h4>Class : <%= klass[:class_name] %></h4>
45
+ <h5>Total complexity : <%= klass[:complexity] %></h5>
46
+ <h5>Total lines : <%= klass[:lines] %></h5>
47
+ <table>
48
+ <tr>
49
+ <th>Method</th>
50
+ <th>Complexity</th>
51
+ <th># Lines</th>
52
+ </tr>
53
+ <% klass[:methods].each do |method| %>
54
+ <tr>
55
+ <td>
56
+ <%= method[:name] %>
57
+ </td>
58
+ <td>
59
+ <%= method[:complexity] %>
60
+ </td>
61
+ <td>
62
+ <%= method[:lines] %>
63
+ </td>
64
+ </tr>
65
+ <% end %>
66
+ </table>
67
+ <% end %>
68
+ <% end %>
69
+ <% end %>
70
+
71
+ <p>Generated on <%= Time.now.localtime %></p>