code_metric_fu 4.14.2 → 4.14.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metric_fu/metrics/cane/generator.rb +2 -1
- data/lib/metric_fu/metrics/flay/generator.rb +1 -0
- data/lib/metric_fu/metrics/reek/generator.rb +4 -1
- data/lib/metric_fu/metrics/reek/report.html.erb +11 -2
- data/lib/metric_fu/metrics/stats/generator.rb +5 -0
- data/lib/metric_fu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d7810e3d4d836a4fe4be5b4433f5b43075b6eb6
|
4
|
+
data.tar.gz: a0cede3e9aee31a1a01aca32ccc8940f3399b79b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb5ca2acb5f9f458c3b85ebe8ea7a135b327e7e6597ac7d8238859135aebf53448504aa7e59eb999da1ad270172020beb294df8507b0111cdce048128a20a0b4
|
7
|
+
data.tar.gz: 847e7e863623cb9b83374891c5050361fdd5fd85f270c20ea30922d525dc42968562c55c801f83d324837c5e3dd6473cd396046e4f603523ab02e9881cda1cb9
|
@@ -23,7 +23,7 @@ module MetricFu
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def to_h
|
26
|
-
{ cane: { total_violations: @total_violations, violations: @violations } }
|
26
|
+
{ cane: { total_violations: @total_violations, violations: @violations, total: @total } }
|
27
27
|
end
|
28
28
|
|
29
29
|
private
|
@@ -87,6 +87,7 @@ module MetricFu
|
|
87
87
|
def extract_total_violations
|
88
88
|
if @output =~ /Total Violations: (\d+)/
|
89
89
|
@total_violations = $1.to_i
|
90
|
+
@total = "Total Violations #{@total_violations}"
|
90
91
|
else
|
91
92
|
@total_violations = 0
|
92
93
|
end
|
@@ -28,10 +28,13 @@ module MetricFu
|
|
28
28
|
{ file_path: file_path,
|
29
29
|
code_smells: analyze_smells(smells) }
|
30
30
|
end
|
31
|
+
@total = []
|
32
|
+
@total << "Detected #{@matches.size} files"
|
33
|
+
@total << "Found #{@matches.sum { |m| m[:code_smells].size }} code smells"
|
31
34
|
end
|
32
35
|
|
33
36
|
def to_h
|
34
|
-
{ reek: { matches: @matches } }
|
37
|
+
{ reek: { matches: @matches, total: @total } }
|
35
38
|
end
|
36
39
|
|
37
40
|
def per_file_info(out)
|
@@ -1,9 +1,18 @@
|
|
1
1
|
<h3>Reek Results</h3>
|
2
2
|
|
3
|
-
<p><a href="http://github.com/troessner/reek">Reek</a> detects common code smells in ruby code.</p>
|
3
|
+
<p><a href="http://github.com/troessner/reek">Reek</a> detects common <a href="https://github.com/troessner/reek/blob/master/docs/Code-Smells.md">code smells</a> in ruby code.</p>
|
4
4
|
|
5
5
|
<%= render_partial 'graph', {:graph_name => 'reek'} %>
|
6
6
|
|
7
|
+
<%
|
8
|
+
# e.g.: https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md
|
9
|
+
def code_smell_type_url(type)
|
10
|
+
doc_url = "https://github.com/troessner/reek/blob/master/docs/%{page}.md"
|
11
|
+
page = type.titlecase.tr(" ", "-")
|
12
|
+
doc_url % {page: page}
|
13
|
+
end
|
14
|
+
%>
|
15
|
+
|
7
16
|
<table>
|
8
17
|
<tr>
|
9
18
|
<th>File Path</th>
|
@@ -23,7 +32,7 @@
|
|
23
32
|
<%= smell[:message] %>
|
24
33
|
</td>
|
25
34
|
<td>
|
26
|
-
<%= smell[:type] %>
|
35
|
+
<a href="<%= code_smell_type_url(smell[:type]) %>"><%= smell[:type] %></a>
|
27
36
|
</td>
|
28
37
|
</tr>
|
29
38
|
<% count += 1 %>
|
@@ -19,6 +19,11 @@ module MetricFu
|
|
19
19
|
set_global_stats(lines.pop)
|
20
20
|
set_granular_stats(lines)
|
21
21
|
|
22
|
+
@stats[:total] = []
|
23
|
+
@stats[:total] << "Lines of Code: #{@stats[:codeLOC]}"
|
24
|
+
@stats[:total] << "Lines of Test: #{@stats[:testLOC]}"
|
25
|
+
@stats[:total] << "Code to test ratio: #{@stats[:code_to_test_ratio]}"
|
26
|
+
|
22
27
|
@stats
|
23
28
|
end
|
24
29
|
|
data/lib/metric_fu/version.rb
CHANGED