devver-metric_fu 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +182 -0
- data/MIT-LICENSE +22 -0
- data/Manifest.txt +25 -0
- data/README.textile +27 -0
- data/Rakefile +15 -0
- data/TODO +9 -0
- data/lib/base/base_template.rb +145 -0
- data/lib/base/configuration.rb +182 -0
- data/lib/base/generator.rb +167 -0
- data/lib/base/graph.rb +39 -0
- data/lib/base/md5_tracker.rb +52 -0
- data/lib/base/report.rb +100 -0
- data/lib/generators/churn.rb +34 -0
- data/lib/generators/flay.rb +35 -0
- data/lib/generators/flog.rb +167 -0
- data/lib/generators/rails_best_practices.rb +31 -0
- data/lib/generators/rcov.rb +82 -0
- data/lib/generators/reek.rb +64 -0
- data/lib/generators/roodi.rb +33 -0
- data/lib/generators/saikuro.rb +221 -0
- data/lib/generators/stats.rb +59 -0
- data/lib/graphs/engines/bluff.rb +99 -0
- data/lib/graphs/engines/gchart.rb +118 -0
- data/lib/graphs/flay_grapher.rb +20 -0
- data/lib/graphs/flog_grapher.rb +40 -0
- data/lib/graphs/grapher.rb +11 -0
- data/lib/graphs/rails_best_practices_grapher.rb +20 -0
- data/lib/graphs/rcov_grapher.rb +20 -0
- data/lib/graphs/reek_grapher.rb +32 -0
- data/lib/graphs/roodi_grapher.rb +20 -0
- data/lib/metric_fu.rb +31 -0
- data/lib/templates/awesome/awesome_template.rb +37 -0
- data/lib/templates/awesome/churn.html.erb +58 -0
- data/lib/templates/awesome/css/buttons.css +82 -0
- data/lib/templates/awesome/css/default.css +91 -0
- data/lib/templates/awesome/css/integrity.css +335 -0
- data/lib/templates/awesome/css/reset.css +7 -0
- data/lib/templates/awesome/flay.html.erb +34 -0
- data/lib/templates/awesome/flog.html.erb +53 -0
- data/lib/templates/awesome/index.html.erb +31 -0
- data/lib/templates/awesome/layout.html.erb +30 -0
- data/lib/templates/awesome/rails_best_practices.html.erb +27 -0
- data/lib/templates/awesome/rcov.html.erb +42 -0
- data/lib/templates/awesome/reek.html.erb +40 -0
- data/lib/templates/awesome/roodi.html.erb +27 -0
- data/lib/templates/awesome/saikuro.html.erb +71 -0
- data/lib/templates/awesome/stats.html.erb +41 -0
- data/lib/templates/javascripts/bluff-min.js +1 -0
- data/lib/templates/javascripts/excanvas.js +35 -0
- data/lib/templates/javascripts/js-class.js +1 -0
- data/lib/templates/standard/churn.html.erb +31 -0
- data/lib/templates/standard/default.css +64 -0
- data/lib/templates/standard/flay.html.erb +34 -0
- data/lib/templates/standard/flog.html.erb +53 -0
- data/lib/templates/standard/index.html.erb +41 -0
- data/lib/templates/standard/rails_best_practices.html.erb +29 -0
- data/lib/templates/standard/rcov.html.erb +43 -0
- data/lib/templates/standard/reek.html.erb +42 -0
- data/lib/templates/standard/roodi.html.erb +29 -0
- data/lib/templates/standard/saikuro.html.erb +84 -0
- data/lib/templates/standard/standard_template.rb +26 -0
- data/lib/templates/standard/stats.html.erb +55 -0
- data/spec/base/base_template_spec.rb +161 -0
- data/spec/base/configuration_spec.rb +270 -0
- data/spec/base/generator_spec.rb +244 -0
- data/spec/base/graph_spec.rb +24 -0
- data/spec/base/md5_tracker_spec.rb +57 -0
- data/spec/base/report_spec.rb +139 -0
- data/spec/generators/churn_spec.rb +43 -0
- data/spec/generators/flay_spec.rb +110 -0
- data/spec/generators/flog_spec.rb +238 -0
- data/spec/generators/reek_spec.rb +125 -0
- data/spec/generators/saikuro_spec.rb +58 -0
- data/spec/generators/stats_spec.rb +74 -0
- data/spec/graphs/engines/bluff_spec.rb +18 -0
- data/spec/graphs/engines/gchart_spec.rb +108 -0
- data/spec/graphs/flay_grapher_spec.rb +37 -0
- data/spec/graphs/flog_grapher_spec.rb +45 -0
- data/spec/graphs/rcov_grapher_spec.rb +37 -0
- data/spec/graphs/reek_grapher_spec.rb +46 -0
- data/spec/graphs/roodi_grapher_spec.rb +37 -0
- data/spec/resources/saikuro/app/controllers/sessions_controller.rb_cyclo.html +10 -0
- data/spec/resources/saikuro/app/controllers/users_controller.rb_cyclo.html +16 -0
- data/spec/resources/saikuro/index_cyclo.html +155 -0
- data/spec/resources/saikuro_sfiles/thing.rb_cyclo.html +11 -0
- data/spec/resources/yml/20090630.yml +7844 -0
- data/spec/spec.opts +6 -0
- data/spec/spec_helper.rb +7 -0
- data/tasks/metric_fu.rake +22 -0
- metadata +253 -0
@@ -0,0 +1 @@
|
|
1
|
+
JS={extend:function(a,b){b=b||{};for(var c in b){if(a[c]===b[c])continue;a[c]=b[c]}return a},makeFunction:function(){return function(){return this.initialize?(this.initialize.apply(this,arguments)||this):this}},makeBridge:function(a){var b=function(){};b.prototype=a.prototype;return new b},bind:function(){var a=JS.array(arguments),b=a.shift(),c=a.shift()||null;return function(){return b.apply(c,a.concat(JS.array(arguments)))}},callsSuper:function(a){return a.SUPER===undefined?a.SUPER=/\bcallSuper\b/.test(a.toString()):a.SUPER},mask:function(a){var b=a.toString().replace(/callSuper/g,'super');a.toString=function(){return b};return a},array:function(a){if(!a)return[];if(a.toArray)return a.toArray();var b=a.length,c=[];while(b--)c[b]=a[b];return c},indexOf:function(a,b){for(var c=0,d=a.length;c<d;c++){if(a[c]===b)return c}return-1},isFn:function(a){return a instanceof Function},isType:function(a,b){if(!a||!b)return false;return(b instanceof Function&&a instanceof b)||(typeof b==='string'&&typeof a===b)||(a.isA&&a.isA(b))},ignore:function(a,b){return/^(include|extend)$/.test(a)&&typeof b==='object'}};JS.Module=JS.makeFunction();JS.extend(JS.Module.prototype,{END_WITHOUT_DOT:/([^\.])$/,initialize:function(a,b,c){this.__mod__=this;this.__inc__=[];this.__fns__={};this.__dep__=[];this.__mct__={};if(typeof a==='string'){this.__nom__=this.displayName=a}else{this.__nom__=this.displayName='';c=b;b=a}c=c||{};this.__res__=c._1||null;if(b)this.include(b,false);if(JS.Module.__chainq__)JS.Module.__chainq__.push(this)},setName:function(a){this.__nom__=this.displayName=a||'';for(var b in this.__mod__.__fns__)this.__name__(b);if(a&&this.__meta__)this.__meta__.setName(a+'.')},__name__:function(a){if(!this.__nom__)return;var b=this.__mod__.__fns__[a]||{};a=this.__nom__.replace(this.END_WITHOUT_DOT,'$1#')+a;if(JS.isFn(b.setName))return b.setName(a);if(JS.isFn(b))b.displayName=a},define:function(a,b,c,d){var f=(d||{})._0||this;this.__fns__[a]=b;this.__name__(a);if(JS.Module._0&&f&&JS.isFn(b))JS.Module._0(a,f);if(c!==false)this.resolve()},instanceMethod:function(a){var b=this.lookup(a).pop();return JS.isFn(b)?b:null},instanceMethods:function(a,b){var c=this.__mod__,b=b||[],d=c.ancestors(),f=d.length,e;for(e in c.__fns__){if(c.__fns__.hasOwnProperty(e)&&JS.isFn(c.__fns__[e])&&JS.indexOf(b,e)===-1)b.push(e)}if(a===false)return b;while(f--)d[f].instanceMethods(false,b);return b},include:function(a,b,c){b=(b!==false);if(!a)return b?this.resolve():this.uncache();c=c||{};if(a.__mod__)a=a.__mod__;var d=a.include,f=a.extend,e=c._4||this,g,h,i,j;if(a.__inc__&&a.__fns__){this.__inc__.push(a);a.__dep__.push(this);if(c._2)a.extended&&a.extended(c._2);else a.included&&a.included(e)}else{if(c._5){for(h in a){if(JS.ignore(h,a[h]))continue;this.define(h,a[h],false,{_0:e||c._2||this})}}else{if(typeof d==='object'||JS.isType(d,JS.Module)){g=[].concat(d);for(i=0,j=g.length;i<j;i++)e.include(g[i],b,c)}if(typeof f==='object'||JS.isType(f,JS.Module)){g=[].concat(f);for(i=0,j=g.length;i<j;i++)e.extend(g[i],false);e.extend()}c._5=true;return e.include(a,b,c)}}b?this.resolve():this.uncache()},includes:function(a){var b=this.__mod__,c=b.__inc__.length;if(Object===a||b===a||b.__res__===a.prototype)return true;while(c--){if(b.__inc__[c].includes(a))return true}return false},match:function(a){return a.isA&&a.isA(this)},ancestors:function(a){var b=this.__mod__,c=(a===undefined),d=(b.__res__||{}).klass,f=(d&&b.__res__===d.prototype)?d:b,e,g;if(c&&b.__anc__)return b.__anc__.slice();a=a||[];for(e=0,g=b.__inc__.length;e<g;e++)b.__inc__[e].ancestors(a);if(JS.indexOf(a,f)===-1)a.push(f);if(c)b.__anc__=a.slice();return a},lookup:function(a){var b=this.__mod__,c=b.__mct__;if(c[a])return c[a].slice();var d=b.ancestors(),f=[],e,g,h;for(e=0,g=d.length;e<g;e++){h=d[e].__mod__.__fns__[a];if(h)f.push(h)}c[a]=f.slice();return f},make:function(a,b){if(!JS.isFn(b)||!JS.callsSuper(b))return b;var c=this;return function(){return c.chain(this,a,arguments)}},chain:JS.mask(function(c,d,f){var e=this.lookup(d),g=e.length-1,h=c.callSuper,i=JS.array(f),j;c.callSuper=function(){var a=arguments.length;while(a--)i[a]=arguments[a];g-=1;var b=e[g].apply(c,i);g+=1;return b};j=e.pop().apply(c,i);h?c.callSuper=h:delete c.callSuper;return j}),resolve:function(a){var b=this.__mod__,a=a||b,c=a.__res__,d,f,e,g;if(a===b){b.uncache(false);d=b.__dep__.length;while(d--)b.__dep__[d].resolve()}if(!c)return;for(d=0,f=b.__inc__.length;d<f;d++)b.__inc__[d].resolve(a);for(e in b.__fns__){g=a.make(e,b.__fns__[e]);if(c[e]!==g)c[e]=g}},uncache:function(a){var b=this.__mod__,c=b.__dep__.length;b.__anc__=null;b.__mct__={};if(a===false)return;while(c--)b.__dep__[c].uncache()}});JS.Class=JS.makeFunction();JS.extend(JS.Class.prototype=JS.makeBridge(JS.Module),{initialize:function(a,b,c){if(typeof a==='string'){this.__nom__=this.displayName=a}else{this.__nom__=this.displayName='';c=b;b=a}var d=JS.extend(JS.makeFunction(),this);d.klass=d.constructor=this.klass;if(!JS.isFn(b)){c=b;b=Object}d.inherit(b);d.include(c,false);d.resolve();do{b.inherited&&b.inherited(d)}while(b=b.superclass);return d},inherit:function(a){this.superclass=a;if(this.__eigen__&&a.__eigen__)this.extend(a.__eigen__(),true);this.subclasses=[];(a.subclasses||[]).push(this);var b=this.prototype=JS.makeBridge(a);b.klass=b.constructor=this;this.__mod__=new JS.Module(this.__nom__,{},{_1:this.prototype});this.include(JS.Kernel,false);if(a!==Object)this.include(a.__mod__||new JS.Module(a.prototype,{_1:a.prototype}),false)},include:function(a,b,c){if(!a)return;var d=this.__mod__,c=c||{};c._4=this;return d.include(a,b,c)},define:function(a,b,c,d){var f=this.__mod__;d=d||{};d._0=this;f.define(a,b,c,d)}});JS.Module=new JS.Class('Module',JS.Module.prototype);JS.Class=new JS.Class('Class',JS.Module,JS.Class.prototype);JS.Module.klass=JS.Module.constructor=JS.Class.klass=JS.Class.constructor=JS.Class;JS.extend(JS.Module,{_3:[],__chainq__:[],methodAdded:function(a,b){this._3.push([a,b])},_0:function(a,b){var c=this._3,d=c.length;while(d--)c[d][0].call(c[d][1]||null,a,b)}});JS.Kernel=JS.extend(new JS.Module('Kernel',{__eigen__:function(){if(this.__meta__)return this.__meta__;var a=this.__nom__,b=this.klass.__nom__,c=a||(b?'#<'+b+'>':''),d=this.__meta__=new JS.Module(c?c+'.':'',{},{_1:this});d.include(this.klass.__mod__,false);return d},equals:function(a){return this===a},extend:function(a,b){return this.__eigen__().include(a,b,{_2:this})},hash:function(){return this.__hashcode__=this.__hashcode__||JS.Kernel.getHashCode()},isA:function(a){return this.__eigen__().includes(a)},method:function(a){var b=this,c=b.__mcache__=b.__mcache__||{};if((c[a]||{}).fn===b[a])return c[a].bd;return(c[a]={fn:b[a],bd:JS.bind(b[a],b)}).bd},methods:function(){return this.__eigen__().instanceMethods(true)},tap:function(a,b){a.call(b||null,this);return this}}),{__hashIndex__:0,getHashCode:function(){this.__hashIndex__+=1;return(Math.floor(new Date().getTime()/1000)+this.__hashIndex__).toString(16)}});JS.Module.include(JS.Kernel);JS.extend(JS.Module,JS.Kernel.__fns__);JS.Class.include(JS.Kernel);JS.extend(JS.Class,JS.Kernel.__fns__);JS.Interface=new JS.Class({initialize:function(d){this.test=function(a,b){var c=d.length;while(c--){if(!JS.isFn(a[d[c]]))return b?d[c]:false}return true}},extend:{ensure:function(){var a=JS.array(arguments),b=a.shift(),c,d;while(c=a.shift()){d=c.test(b,true);if(d!==true)throw new Error('object does not implement '+d+'()');}}}});JS.Singleton=new JS.Class({initialize:function(a,b,c){return new(new JS.Class(a,b,c))}});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Source Control Churn Results</title>
|
4
|
+
<style>
|
5
|
+
<%= inline_css("default.css") %>
|
6
|
+
</style>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<h1>Source Control Churn Results</h1>
|
11
|
+
<a href="index.html">back to menu</a>
|
12
|
+
<p>Files that change a lot in your project may be bad a sign.
|
13
|
+
This task uses your source control log to identify those files.
|
14
|
+
</p>
|
15
|
+
<table>
|
16
|
+
<tr>
|
17
|
+
<th>File Path</th>
|
18
|
+
<th>Times Changed</th>
|
19
|
+
</tr>
|
20
|
+
<% count = 0 %>
|
21
|
+
<% @churn[:changes].each do |change| %>
|
22
|
+
<tr>
|
23
|
+
<td><%= change[:file_path] %></td>
|
24
|
+
<td><%= change[:times_changed] %></td>
|
25
|
+
</tr>
|
26
|
+
<% count += 1 %>
|
27
|
+
<% end %>
|
28
|
+
</table>
|
29
|
+
<p>Generated on <%= Time.now.localtime %></p>
|
30
|
+
</body>
|
31
|
+
</html>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #efefef;
|
3
|
+
margin: 20px;
|
4
|
+
padding: 0;
|
5
|
+
font: 12px verdana, arial, helvetica;
|
6
|
+
}
|
7
|
+
|
8
|
+
table {
|
9
|
+
border-collapse: collapse;
|
10
|
+
border: 1px solid #666;
|
11
|
+
background: #fff;
|
12
|
+
margin-bottom: 20px;
|
13
|
+
}
|
14
|
+
|
15
|
+
table tr.light {
|
16
|
+
background: #fff;
|
17
|
+
}
|
18
|
+
|
19
|
+
table tr.dark {
|
20
|
+
background: #f9f9f9;
|
21
|
+
}
|
22
|
+
|
23
|
+
table td, table th {
|
24
|
+
padding: 4px 10px;
|
25
|
+
font-size: 13px;
|
26
|
+
}
|
27
|
+
table th {
|
28
|
+
text-align: center;
|
29
|
+
color: #fc0;
|
30
|
+
background: #336;
|
31
|
+
font-weight: bold;
|
32
|
+
border: #d0d0d0 1px solid;
|
33
|
+
}
|
34
|
+
|
35
|
+
table td {
|
36
|
+
border: #d0d0d0 1px solid;
|
37
|
+
}
|
38
|
+
|
39
|
+
table td.score {
|
40
|
+
text-align: right;
|
41
|
+
}
|
42
|
+
|
43
|
+
.warning {
|
44
|
+
background: yellow;
|
45
|
+
}
|
46
|
+
.rcov_code td {
|
47
|
+
border-bottom: 1px solid #ddd ;
|
48
|
+
padding: 0;
|
49
|
+
margin: 0;
|
50
|
+
}
|
51
|
+
.rcov_code tr {
|
52
|
+
border: 0px;
|
53
|
+
padding:0px;
|
54
|
+
margin: 0px;
|
55
|
+
}
|
56
|
+
.rcov_code pre {
|
57
|
+
border: 0px;
|
58
|
+
padding: 0px;
|
59
|
+
margin: 0px;
|
60
|
+
}
|
61
|
+
.rcov_run {}
|
62
|
+
.rcov_not_run {
|
63
|
+
background-color: #d88;
|
64
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Flay Results</title>
|
4
|
+
<style>
|
5
|
+
<%= inline_css("default.css") %>
|
6
|
+
</style>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<h1>Flay Results</h1>
|
11
|
+
<a href="index.html">back to menu</a>
|
12
|
+
<h2>Total Score (lower is better): <%= @flay[:total_score] %></h2>
|
13
|
+
<p><a href='http://ruby.sadi.st/Flay.html'>Flay</a> analyzes ruby code for structural similarities.</p>
|
14
|
+
<table>
|
15
|
+
<tr>
|
16
|
+
<th>Files</th>
|
17
|
+
<th>Matches</th>
|
18
|
+
</tr>
|
19
|
+
<% count = 0 %>
|
20
|
+
<% @flay[:matches].each do |match| %>
|
21
|
+
<tr class='<%= cycle("light", "dark", count) %>'>
|
22
|
+
<td>
|
23
|
+
<% match[:matches].each do |file| %>
|
24
|
+
<%= file[:name] %>:<%= file[:line] %><br />
|
25
|
+
<% end %>
|
26
|
+
</td>
|
27
|
+
<td><%= match[:reason] %></td>
|
28
|
+
</tr>
|
29
|
+
<% count += 1 %>
|
30
|
+
<% end %>
|
31
|
+
</table>
|
32
|
+
<p>Generated on <%= Time.now.localtime %></p>
|
33
|
+
</body>
|
34
|
+
</html>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Flog Reporter</title>
|
4
|
+
<style>
|
5
|
+
<%= inline_css("default.css") %>
|
6
|
+
</style>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<h1>Flog Results</h1>
|
10
|
+
<a href="index.html">back to menu</a>
|
11
|
+
<p><a href='http://ruby.sadi.st/Flog.html'>Flog</a> measures code complexity.</p>
|
12
|
+
<h2>Total Flog score for all methods: <%= @flog[:total]%></h2>
|
13
|
+
<h2>Average Flog score for all methods: <%= @flog[:average]%></h2>
|
14
|
+
<table>
|
15
|
+
<tr>
|
16
|
+
<th>File</th>
|
17
|
+
<th>Total score</th>
|
18
|
+
<th>Methods</th>
|
19
|
+
<th>Average score</th>
|
20
|
+
<th>Highest score</th>
|
21
|
+
</tr>
|
22
|
+
<% @flog[:pages].each do |page| %>
|
23
|
+
<tr>
|
24
|
+
<td><a href="#<%= page[:path].gsub(/[^a-z]+/, '_') %>"><%= page[:path] %></a></td>
|
25
|
+
<td><%= page[:score].round %></td>
|
26
|
+
<td><%= page[:scanned_methods].length %></td>
|
27
|
+
<td><%= page[:average_score].round %></td>
|
28
|
+
<td><%= page[:highest_score].round %></td>
|
29
|
+
</tr>
|
30
|
+
<% end %>
|
31
|
+
</table>
|
32
|
+
|
33
|
+
<% @flog[:pages].each do |page| %>
|
34
|
+
<h2 id="<%= page[:path].gsub(/[^a-z]+/, '_') %>"><%= page[:path] %></h2>
|
35
|
+
<% page[:scanned_methods].each do |sm| %>
|
36
|
+
<p><%= sm[:name] %></p>
|
37
|
+
<table>
|
38
|
+
<tr>
|
39
|
+
<th>Score</th>
|
40
|
+
<th>Operator</th>
|
41
|
+
</tr>
|
42
|
+
<% sm[:operators].each do |operator| %>
|
43
|
+
<tr>
|
44
|
+
<td><%= operator[:score] %></td>
|
45
|
+
<td><%= operator[:operator] %></td>
|
46
|
+
</tr>
|
47
|
+
<% end %>
|
48
|
+
</table>
|
49
|
+
<% end %>
|
50
|
+
<% end %>
|
51
|
+
<p>Generated on <%= Time.now.localtime %></p>
|
52
|
+
</body>
|
53
|
+
</html>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Metric Fu Results</title>
|
4
|
+
<style>
|
5
|
+
<%= inline_css("default.css") %>
|
6
|
+
</style>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<h1>Metric Fu Results</h1>
|
11
|
+
<% if @churn %>
|
12
|
+
<p><a href="churn.html">Churn report</a></p>
|
13
|
+
<% end %>
|
14
|
+
<% if @flay %>
|
15
|
+
<p><a href="flay.html">Flay report</a></p>
|
16
|
+
<% end %>
|
17
|
+
<% if @flog %>
|
18
|
+
<p><a href="flog.html">Flog report</a></p>
|
19
|
+
<% end %>
|
20
|
+
<% if @rcov %>
|
21
|
+
<p><a href="rcov.html">Rcov report</a></p>
|
22
|
+
<% end %>
|
23
|
+
<% if @reek %>
|
24
|
+
<p><a href="reek.html">Reek report</a></p>
|
25
|
+
<% end %>
|
26
|
+
<% if @roodi %>
|
27
|
+
<p><a href="roodi.html">Roodi report</a></p>
|
28
|
+
<% end %>
|
29
|
+
<% if @saikuro %>
|
30
|
+
<p><a href="saikuro.html">Saikuro report</a></p>
|
31
|
+
<% end %>
|
32
|
+
<% if @stats %>
|
33
|
+
<p><a href="stats.html">Stats report</a></p>
|
34
|
+
<% end %>
|
35
|
+
<% if @rails_best_practices %>
|
36
|
+
<p><a href="rails_best_practices.html">Rails Best Practices report</a></p>
|
37
|
+
<% end %>
|
38
|
+
<p>Generated on <%= Time.now.localtime %></p>
|
39
|
+
</body>
|
40
|
+
</html>
|
41
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Rails Best Practices Results</title>
|
4
|
+
<style>
|
5
|
+
<%= inline_css("default.css") %>
|
6
|
+
</style>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<h1>Rails Best Practices Results</h1>
|
11
|
+
<a href="index.html">back to menu</a>
|
12
|
+
<p><a href="http://github.com/flyerhzm/rails_best_practices">rails_best_practices</a> checks quality of rails app files according to ihower’s presentation from Kungfu RailsConf in Shanghai China.</p>
|
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><%= 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>
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Rcov Code Coverage Results</title>
|
4
|
+
<style>
|
5
|
+
<%= inline_css("default.css") %>
|
6
|
+
</style>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<h1>Rcov Code Coverage Results</h1>
|
11
|
+
<a href="index.html">back to menu</a>
|
12
|
+
<p>C0 code coverage information.</p>
|
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 |e| %>
|
21
|
+
<tr>
|
22
|
+
<td><a href="#<%= e[0].gsub(/[^a-z]+/, '_') %>"><%= e[0] %></a></td>
|
23
|
+
<td><%= e[1][:percent_run] %></td>
|
24
|
+
</tr>
|
25
|
+
<% count += 1 %>
|
26
|
+
<% end %>
|
27
|
+
</table>
|
28
|
+
|
29
|
+
<% @rcov.each_pair do |fname, file| %>
|
30
|
+
<h2 id="<%= fname.gsub(/[^a-z]+/, '_') %>"> <%= fname %></h2>
|
31
|
+
<table class="rcov_code">
|
32
|
+
<% file[:lines].each do |line| %>
|
33
|
+
<tr>
|
34
|
+
<% css_class = line[:was_run] ? "rcov_run" : "rcov_not_run" %>
|
35
|
+
<td class="<%= css_class %>"><pre><%= line[:content] %></pre></td>
|
36
|
+
</tr>
|
37
|
+
<% end %>
|
38
|
+
</table>
|
39
|
+
<% end %>
|
40
|
+
<p>Generated on <%= Time.now.localtime %></p>
|
41
|
+
</body>
|
42
|
+
</html>
|
43
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Reek Results</title>
|
4
|
+
<style>
|
5
|
+
<%= inline_css("default.css") %>
|
6
|
+
</style>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<h1>Reek Results</h1>
|
11
|
+
<a href="index.html">back to menu</a>
|
12
|
+
<p><a href="http://reek.rubyforge.org/">Reek</a> detects common code smells in ruby code.</p>
|
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><%= 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>
|
41
|
+
</body>
|
42
|
+
</html>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Roodi Results</title>
|
4
|
+
<style>
|
5
|
+
<%= inline_css("default.css") %>
|
6
|
+
</style>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<h1>Roodi Results</h1>
|
11
|
+
<a href="index.html">back to menu</a>
|
12
|
+
<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>
|
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><%= 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>
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Saikuro Results</title>
|
4
|
+
<style>
|
5
|
+
<%= inline_css("default.css") %>
|
6
|
+
</style>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
<h1>Saikuro Results</h1>
|
11
|
+
<a href="index.html">back to menu</a>
|
12
|
+
<p><a href='http://saikuro.rubyforge.org/'>Saikuro</a> analyzes ruby code for cyclomatic complexity.</p>
|
13
|
+
|
14
|
+
<h2>Analyzed Methods</h2>
|
15
|
+
<table>
|
16
|
+
<tr>
|
17
|
+
<th>Method Name</th>
|
18
|
+
<th>Complexity</th>
|
19
|
+
<th># Lines</th>
|
20
|
+
</tr>
|
21
|
+
<% @saikuro[:methods].each do |method| %>
|
22
|
+
<tr>
|
23
|
+
<td><%= method[:name] %></td>
|
24
|
+
<td><%= method[:complexity] %></td>
|
25
|
+
<td><%= method[:lines] %></td>
|
26
|
+
</tr>
|
27
|
+
<% end %>
|
28
|
+
</table>
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
<h2>Analyzed Classes</h2>
|
33
|
+
<table>
|
34
|
+
<tr>
|
35
|
+
<th>Class Name</th>
|
36
|
+
<th>Complexity</th>
|
37
|
+
<th># Lines</th>
|
38
|
+
</tr>
|
39
|
+
<% @saikuro[:classes].each do |klass| %>
|
40
|
+
<tr>
|
41
|
+
<td><%= klass[:name] %></td>
|
42
|
+
<td><%= klass[:complexity] %></td>
|
43
|
+
<td><%= klass[:lines] %></td>
|
44
|
+
</tr>
|
45
|
+
<% end %>
|
46
|
+
</table>
|
47
|
+
|
48
|
+
|
49
|
+
<h2>Analyzed Files</h2>
|
50
|
+
<% @saikuro[:files].each do |file| %>
|
51
|
+
<% file[:classes].each do |klass| %>
|
52
|
+
<% if !klass[:methods].empty? %>
|
53
|
+
<h3><%= file[:filename] %></h3>
|
54
|
+
<h4>Class : <%= klass[:class_name] %></h4>
|
55
|
+
<h5>Total complexity : <%= klass[:complexity] %></h5>
|
56
|
+
<h5>Total lines : <%= klass[:lines] %></h5>
|
57
|
+
<table>
|
58
|
+
<tr>
|
59
|
+
<th>Method</th>
|
60
|
+
<th>Complexity</th>
|
61
|
+
<th># Lines</th>
|
62
|
+
</tr>
|
63
|
+
<% klass[:methods].each do |method| %>
|
64
|
+
<tr>
|
65
|
+
<td>
|
66
|
+
<%= method[:name] %>
|
67
|
+
</td>
|
68
|
+
<td>
|
69
|
+
<%= method[:complexity] %>
|
70
|
+
</td>
|
71
|
+
<td>
|
72
|
+
<%= method[:lines] %>
|
73
|
+
</td>
|
74
|
+
</tr>
|
75
|
+
<% end %>
|
76
|
+
</table>
|
77
|
+
<% end %>
|
78
|
+
<% end %>
|
79
|
+
<% end %>
|
80
|
+
|
81
|
+
<p>Generated on <%= Time.now.localtime %></p>
|
82
|
+
</body>
|
83
|
+
</html>
|
84
|
+
|