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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76c4418ed136810a2c0ab406bedf3e681490ae89
4
- data.tar.gz: 0db14f57209fc578e3ec13de6eeca0a149485aa9
3
+ metadata.gz: 8d7810e3d4d836a4fe4be5b4433f5b43075b6eb6
4
+ data.tar.gz: a0cede3e9aee31a1a01aca32ccc8940f3399b79b
5
5
  SHA512:
6
- metadata.gz: 1e3efbb63877aa09122244d3ed87d0275b2523209d37deb060d0e74c8103966a9d38c7651da97c5ec72bc3f9f14577e5cd7fe17373ab82c48fd6b2457f219b3c
7
- data.tar.gz: 766242337983416d7760677b04efc80dfd7cc05f3b211d4fe40a1eceed8a8eb25714857c81b6b536b8d40ac2c824cbcbdd18314cd1fb93e563695f6142a499aa
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
@@ -31,6 +31,7 @@ module MetricFu
31
31
  end
32
32
  {
33
33
  total_score: total_score,
34
+ total: "Total Score #{total_score}",
34
35
  matches: target.flatten
35
36
  }
36
37
  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
 
@@ -2,7 +2,7 @@ module MetricFu
2
2
  class Version
3
3
  MAJOR = "4"
4
4
  MINOR = "14"
5
- PATCH = "2"
5
+ PATCH = "3"
6
6
  PRE = ""
7
7
  end
8
8
  VERSION = [Version::MAJOR, Version::MINOR, Version::PATCH].join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_metric_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.14.2
4
+ version: 4.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Scruggs