metric_fu 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +13 -5
- data/README +2 -2
- data/Rakefile +1 -1
- data/TODO +3 -1
- data/lib/base/base_template.rb +16 -16
- data/lib/base/churn_analyzer.rb +3 -3
- data/lib/base/code_issue.rb +8 -8
- data/lib/base/configuration.rb +24 -22
- data/lib/base/flay_analyzer.rb +2 -2
- data/lib/base/flog_analyzer.rb +4 -4
- data/lib/base/generator.rb +21 -21
- data/lib/base/graph.rb +15 -10
- data/lib/base/line_numbers.rb +56 -55
- data/lib/base/location.rb +68 -66
- data/lib/base/metric_analyzer.rb +21 -21
- data/lib/base/ranking.rb +23 -22
- data/lib/base/rcov_analyzer.rb +3 -3
- data/lib/base/reek_analyzer.rb +12 -10
- data/lib/base/report.rb +9 -9
- data/lib/base/roodi_analyzer.rb +2 -2
- data/lib/base/saikuro_analyzer.rb +4 -4
- data/lib/base/scoring_strategies.rb +5 -5
- data/lib/base/stats_analyzer.rb +2 -2
- data/lib/base/table.rb +4 -4
- data/lib/generators/churn.rb +1 -1
- data/lib/generators/flay.rb +1 -1
- data/lib/generators/hotspots.rb +4 -4
- data/lib/generators/rails_best_practices.rb +1 -1
- data/lib/generators/rcov.rb +17 -17
- data/lib/generators/reek.rb +2 -2
- data/lib/generators/saikuro.rb +42 -42
- data/lib/generators/stats.rb +6 -6
- data/lib/graphs/engines/bluff.rb +1 -1
- data/lib/graphs/engines/gchart.rb +7 -7
- data/lib/graphs/flog_grapher.rb +3 -3
- data/lib/graphs/grapher.rb +1 -1
- data/lib/metric_fu.rb +2 -2
- data/lib/templates/awesome/churn.html.erb +1 -1
- data/lib/templates/awesome/css/integrity.css +0 -1
- data/lib/templates/awesome/flay.html.erb +2 -2
- data/lib/templates/awesome/flog.html.erb +2 -2
- data/lib/templates/awesome/hotspots.html.erb +4 -4
- data/lib/templates/awesome/index.html.erb +2 -2
- data/lib/templates/awesome/rails_best_practices.html.erb +1 -1
- data/lib/templates/awesome/rcov.html.erb +1 -1
- data/lib/templates/awesome/roodi.html.erb +1 -1
- data/lib/templates/awesome/saikuro.html.erb +3 -3
- data/lib/templates/awesome/stats.html.erb +1 -1
- data/lib/templates/standard/churn.html.erb +2 -2
- data/lib/templates/standard/default.css +4 -4
- data/lib/templates/standard/flay.html.erb +4 -4
- data/lib/templates/standard/flog.html.erb +1 -1
- data/lib/templates/standard/hotspots.html.erb +4 -4
- data/lib/templates/standard/index.html.erb +2 -2
- data/lib/templates/standard/rails_best_practices.html.erb +2 -2
- data/lib/templates/standard/rcov.html.erb +2 -2
- data/lib/templates/standard/reek.html.erb +1 -1
- data/lib/templates/standard/roodi.html.erb +2 -2
- data/lib/templates/standard/saikuro.html.erb +4 -4
- data/lib/templates/standard/stats.html.erb +2 -2
- data/spec/base/base_template_spec.rb +1 -1
- data/spec/base/configuration_spec.rb +36 -36
- data/spec/base/generator_spec.rb +10 -10
- data/spec/base/graph_spec.rb +41 -4
- data/spec/base/line_numbers_spec.rb +22 -22
- data/spec/base/report_spec.rb +9 -9
- data/spec/generators/churn_spec.rb +4 -4
- data/spec/generators/flay_spec.rb +31 -31
- data/spec/generators/flog_spec.rb +18 -18
- data/spec/generators/rails_best_practices_spec.rb +6 -6
- data/spec/generators/rcov_spec.rb +18 -18
- data/spec/generators/reek_spec.rb +10 -10
- data/spec/generators/roodi_spec.rb +2 -2
- data/spec/generators/saikuro_spec.rb +7 -7
- data/spec/generators/stats_spec.rb +6 -6
- data/spec/graphs/engines/gchart_spec.rb +8 -8
- data/spec/graphs/flog_grapher_spec.rb +8 -8
- data/spec/resources/line_numbers/foo.rb +7 -7
- data/spec/resources/line_numbers/module.rb +2 -2
- data/spec/resources/line_numbers/module_surrounds_class.rb +6 -6
- data/spec/resources/saikuro/index_cyclo.html +2 -2
- data/spec/resources/yml/20090630.yml +349 -349
- data/spec/resources/yml/metric_missing.yml +1 -1
- data/tasks/metric_fu.rake +4 -4
- metadata +4 -4
data/HISTORY
CHANGED
@@ -1,9 +1,17 @@
|
|
1
|
+
=== MetricFu 2.0.1 / 2010-11-13
|
2
|
+
|
3
|
+
* Delete trailing whitespaces - Delwyn de Villiers
|
4
|
+
* Stop Ubuntu choking on invalid multibyte char (US-ASCII) - Delwyn de Villiers
|
5
|
+
* Fix invalid next in lib/base/metric_analyzer.rb - Delwyn de Villiers
|
6
|
+
* Don't load Saikuro for Ruby 1.9.2 - Delwyn de Villiers
|
7
|
+
* Fixed a bug reported by Andrew Davis on the mailing list where configuring the data directory causes dates to be 0/0 - Joshua Cronemeyer
|
8
|
+
|
1
9
|
=== MetricFu 2.0.0 / 2010-11-10
|
2
10
|
|
3
11
|
* Hotspots - Dan Mayer, Ben Brinckerhoff, Jake Scruggs
|
4
12
|
* Rcov integration with Hotspots - Jake Scruggs, Tony Castiglione, Rob Meyer
|
5
13
|
|
6
|
-
=== MetricFu 1.5.1 / 2010-7-28
|
14
|
+
=== MetricFu 1.5.1 / 2010-7-28
|
7
15
|
|
8
16
|
* Patch that allows graphers to skip dates that didn't generate metrics for that graph (GitHub Issue #20). - Chris Griego
|
9
17
|
* Fixed bug where if you try and use the gchart grapher with the rails_best_practices metric, it blows up (GitHub Issue #23). - Chris Griego
|
@@ -11,8 +19,8 @@
|
|
11
19
|
|
12
20
|
=== MetricFu 1.5.0 / 2010-7-27
|
13
21
|
|
14
|
-
* Fixed bug where Flay results were not being reported. Had to remove the ability to remove selected files from flay processing (undocumented feature that may go away soon if it keeps causing problems).
|
15
|
-
* Rewrote Flog parsing/processing to use Flog programmatically. Note: the yaml output for Flog has changed significantly - Pages have now become MethodContainers. This probably doesn't matter to you if you are not consuming the metric_fu yaml output.
|
22
|
+
* Fixed bug where Flay results were not being reported. Had to remove the ability to remove selected files from flay processing (undocumented feature that may go away soon if it keeps causing problems).
|
23
|
+
* Rewrote Flog parsing/processing to use Flog programmatically. Note: the yaml output for Flog has changed significantly - Pages have now become MethodContainers. This probably doesn't matter to you if you are not consuming the metric_fu yaml output.
|
16
24
|
* Added support for using config files in Reek and Roodi (roodi support was already there but undocumented).
|
17
25
|
* Removed verify_dependencies! as it caused too much confusion to justify the limited set of problems it solved. In the post Bundler world it just didn't seem necessary to limit metric_fu dependencies.
|
18
26
|
* Deal with Rails 3 activesupport vs active_support problems. - jinzhu
|
@@ -159,7 +167,7 @@
|
|
159
167
|
|
160
168
|
=== MetricFu 0.7.0 / 2008-09-11
|
161
169
|
|
162
|
-
* Merged in Sean Soper's changes to metric_fu.
|
170
|
+
* Merged in Sean Soper's changes to metric_fu.
|
163
171
|
* Metric_fu is now a gem.
|
164
172
|
* Flogging now uses a MD5 hash to figure out if it should re-flog a file (if it's changed)
|
165
173
|
* Flogging also has a cool new output screen(s)
|
@@ -194,7 +202,7 @@
|
|
194
202
|
=== Metricks 0.1.0 / 2008-06-10
|
195
203
|
|
196
204
|
* Initial integration of metric_fu and my enhancements to flog
|
197
|
-
* Metrics are generated but are all over the place
|
205
|
+
* Metrics are generated but are all over the place
|
198
206
|
|
199
207
|
=== MetricFu 0.6.0 / 2008-05-11
|
200
208
|
|
data/README
CHANGED
@@ -11,9 +11,9 @@ How to contribute:
|
|
11
11
|
7. Make sure two important rake tests still run ('rake' and 'rake metrics:all')
|
12
12
|
8. Commit and send me a pull request with details as to what has been changed.
|
13
13
|
|
14
|
-
Extra Credit:
|
14
|
+
Extra Credit:
|
15
15
|
1. Make sure your changes work in 1.8.7, Ruby Enterprise Edition, and 1.9.1 (Hint use 'rvm' to help install multiple rubies)
|
16
|
-
2. Post to the Google group explaining what you did and why you did it (I don't merge things in immediately so others might want to use what you've done).
|
16
|
+
2. Post to the Google group explaining what you did and why you did it (I don't merge things in immediately so others might want to use what you've done).
|
17
17
|
3. Update the documentation (web page inside the 'home_page' folder)
|
18
18
|
4. Update the History and give yourself credit.
|
19
19
|
|
data/Rakefile
CHANGED
data/TODO
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
== TODO list
|
2
2
|
|
3
3
|
* Color code flog results with scale from: http://jakescruggs.blogspot.com/2008/08/whats-good-flog-score.html
|
4
|
-
* Make running metric_fu on metric_fu less embarrassing
|
4
|
+
* Make running metric_fu on metric_fu less embarrassing
|
5
|
+
* Load all gems at config time so you fail fast if one is missing
|
6
|
+
|
data/lib/base/base_template.rb
CHANGED
@@ -9,12 +9,12 @@ module MetricFu
|
|
9
9
|
# example.
|
10
10
|
class Template
|
11
11
|
attr_accessor :report
|
12
|
-
|
12
|
+
|
13
13
|
private
|
14
14
|
# Creates a new erb evaluated result from the passed in section.
|
15
15
|
#
|
16
16
|
# @param section String
|
17
|
-
# The section name of
|
17
|
+
# The section name of
|
18
18
|
#
|
19
19
|
# @return String
|
20
20
|
# The erb evaluated string
|
@@ -35,10 +35,10 @@ module MetricFu
|
|
35
35
|
def template_exists?(section)
|
36
36
|
File.exist?(template(section))
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
# Copies an instance variable mimicing the name of the section
|
40
|
-
# we are trying to render, with a value equal to the passed in
|
41
|
-
# constant. Allows the concrete template classes to refer to
|
40
|
+
# we are trying to render, with a value equal to the passed in
|
41
|
+
# constant. Allows the concrete template classes to refer to
|
42
42
|
# that instance variable from their ERB rendering
|
43
43
|
#
|
44
44
|
# @param section String
|
@@ -48,10 +48,10 @@ module MetricFu
|
|
48
48
|
# The value to set as the value of the created instance
|
49
49
|
# variable
|
50
50
|
def create_instance_var(section, contents)
|
51
|
-
instance_variable_set("@#{section}", contents)
|
51
|
+
instance_variable_set("@#{section}", contents)
|
52
52
|
end
|
53
53
|
|
54
|
-
# Generates the filename of the template file to load and
|
54
|
+
# Generates the filename of the template file to load and
|
55
55
|
# evaluate. In this case, the path to the template directory +
|
56
56
|
# the section name + .html.erb
|
57
57
|
#
|
@@ -76,7 +76,7 @@ module MetricFu
|
|
76
76
|
section.to_s + ".html"
|
77
77
|
end
|
78
78
|
|
79
|
-
# Returns the contents of a given css file in order to
|
79
|
+
# Returns the contents of a given css file in order to
|
80
80
|
# render it inline into a template.
|
81
81
|
#
|
82
82
|
# @param css String
|
@@ -85,14 +85,14 @@ module MetricFu
|
|
85
85
|
# @return String
|
86
86
|
# The contents of the css file
|
87
87
|
def inline_css(css)
|
88
|
-
open(File.join(this_directory, css)) { |f| f.read }
|
88
|
+
open(File.join(this_directory, css)) { |f| f.read }
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
# Provides a link to open a file through the textmate protocol
|
92
92
|
# on Darwin, or otherwise, a simple file link.
|
93
93
|
#
|
94
94
|
# @param name String
|
95
|
-
#
|
95
|
+
#
|
96
96
|
# @param line Integer
|
97
97
|
# The line number to link to, if textmate is available. Defaults
|
98
98
|
# to nil
|
@@ -102,12 +102,12 @@ module MetricFu
|
|
102
102
|
def link_to_filename(name, line = nil, link_content = nil)
|
103
103
|
"<a href='#{file_url(name, line)}'>#{link_content(name, line, link_content)}</a>"
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
def round_to_tenths(decimal)
|
107
107
|
decimal = 0.0 if decimal.to_s.eql?('NaN')
|
108
|
-
(decimal * 10).round / 10.0
|
108
|
+
(decimal * 10).round / 10.0
|
109
109
|
end
|
110
|
-
|
110
|
+
|
111
111
|
def link_content(name, line=nil, link_content=nil) # :nodoc:
|
112
112
|
if link_content
|
113
113
|
link_content
|
@@ -133,13 +133,13 @@ module MetricFu
|
|
133
133
|
end
|
134
134
|
str
|
135
135
|
end
|
136
|
-
|
136
|
+
|
137
137
|
def file_url(name, line) # :nodoc:
|
138
138
|
return '' unless name
|
139
139
|
filename = File.expand_path(name.gsub(/^\//, ''))
|
140
140
|
if MetricFu.configuration.platform.include?('darwin')
|
141
141
|
"txmt://open/?url=file://#{filename}" << (line ? "&line=#{line}" : "")
|
142
|
-
else
|
142
|
+
else
|
143
143
|
"file://#{filename}"
|
144
144
|
end
|
145
145
|
end
|
data/lib/base/churn_analyzer.rb
CHANGED
@@ -6,7 +6,7 @@ class ChurnAnalyzer
|
|
6
6
|
def columns
|
7
7
|
COLUMNS
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def name
|
11
11
|
:churn
|
12
12
|
end
|
@@ -23,7 +23,7 @@ class ChurnAnalyzer
|
|
23
23
|
flat_churn_score = 0.50
|
24
24
|
metric_ranking.scored?(item) ? flat_churn_score : 0
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def generate_records(data, table)
|
28
28
|
return if data==nil
|
29
29
|
Array(data[:changes]).each do |change|
|
@@ -35,7 +35,7 @@ class ChurnAnalyzer
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
private
|
38
|
+
private
|
39
39
|
|
40
40
|
def self.update_changes(total, changed)
|
41
41
|
changed.each do |change|
|
data/lib/base/code_issue.rb
CHANGED
@@ -19,17 +19,17 @@ end
|
|
19
19
|
class CodeIssue < DelegateClass(Record) #DelegateClass(Ruport::Data::Record)
|
20
20
|
include Comparable
|
21
21
|
|
22
|
-
# TODO: Yuck! 'stat_value' is a column for StatAnalyzer
|
22
|
+
# TODO: Yuck! 'stat_value' is a column for StatAnalyzer
|
23
23
|
EXCLUDED_COLUMNS = FlogAnalyzer::COLUMNS + SaikuroAnalyzer::COLUMNS + ['stat_value'] + ChurnAnalyzer::COLUMNS + ReekAnalyzer.new.columns.extend(CarefulArray).carefully_remove(['reek__type_name', 'reek__comparable_message']) + FlayAnalyzer.new.columns.extend(CarefulArray).carefully_remove(['flay_matching_reason'])
|
24
24
|
|
25
25
|
def <=>(other)
|
26
26
|
spaceship_for_columns(self.attributes, other)
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def ===(other)
|
30
30
|
self.hash_for(included_columns_hash, included_columns) == other.hash_for(included_columns_hash, included_columns)
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def spaceship_for_columns(columns, other)
|
34
34
|
columns.each do |column|
|
35
35
|
equality = self[column].to_s <=> other[column].to_s
|
@@ -41,7 +41,7 @@ class CodeIssue < DelegateClass(Record) #DelegateClass(Ruport::Data::Record)
|
|
41
41
|
def hash_for(column_hash, columns)
|
42
42
|
@hashes ||= {}
|
43
43
|
# fetch would be cleaner, but slower
|
44
|
-
if @hashes.has_key?(column_hash)
|
44
|
+
if @hashes.has_key?(column_hash)
|
45
45
|
@hashes[column_hash]
|
46
46
|
else
|
47
47
|
values = columns.map {|column| self[column]}
|
@@ -54,7 +54,7 @@ class CodeIssue < DelegateClass(Record) #DelegateClass(Ruport::Data::Record)
|
|
54
54
|
def included_columns_hash
|
55
55
|
@included_columns_hash ||= included_columns.hash
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
def included_columns
|
59
59
|
@included_columns ||= self.attributes.extend(CarefulArray).carefully_remove(EXCLUDED_COLUMNS)
|
60
60
|
end
|
@@ -78,10 +78,10 @@ class CodeIssue < DelegateClass(Record) #DelegateClass(Ruport::Data::Record)
|
|
78
78
|
self.reek__value != other.reek__value
|
79
79
|
when :flog
|
80
80
|
self.score != other.score
|
81
|
-
when :saikuro
|
81
|
+
when :saikuro
|
82
82
|
self.complexity != other.complexity
|
83
83
|
when :stats
|
84
|
-
self.stat_value != other.stat_value
|
84
|
+
self.stat_value != other.stat_value
|
85
85
|
when :churn
|
86
86
|
self.times_changed != other.times_changed
|
87
87
|
when :flay
|
@@ -93,5 +93,5 @@ class CodeIssue < DelegateClass(Record) #DelegateClass(Ruport::Data::Record)
|
|
93
93
|
raise ArgumentError, "Invalid metric type #{self.metric}"
|
94
94
|
end
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
end
|
data/lib/base/configuration.rb
CHANGED
@@ -5,10 +5,12 @@ module MetricFu
|
|
5
5
|
# These are metrics which have been developed for the system. Of
|
6
6
|
# course, in order to use these metrics, their respective gems must
|
7
7
|
# be installed on the system.
|
8
|
-
AVAILABLE_METRICS = [:churn, :flog, :flay, :reek,
|
9
|
-
:roodi, :
|
8
|
+
AVAILABLE_METRICS = [:churn, :flog, :flay, :reek,
|
9
|
+
:roodi, :rcov,
|
10
10
|
:hotspots]
|
11
|
-
|
11
|
+
|
12
|
+
AVAILABLE_METRICS << :saikuro unless RUBY_VERSION == '1.9.2'
|
13
|
+
|
12
14
|
AVAILABLE_GRAPHS = [:flog, :flay, :reek, :roodi, :rcov, :rails_best_practices]
|
13
15
|
AVAILABLE_GRAPH_ENGINES = [:gchart, :bluff]
|
14
16
|
|
@@ -36,7 +38,7 @@ module MetricFu
|
|
36
38
|
#
|
37
39
|
# == Customization for CruiseControl.rb
|
38
40
|
#
|
39
|
-
# The Configuration class checks for the presence of a
|
41
|
+
# The Configuration class checks for the presence of a
|
40
42
|
# 'CC_BUILD_ARTIFACTS' environment variable. If it's found
|
41
43
|
# it will change the default output directory from the default
|
42
44
|
# "tmp/metric_fu to the directory represented by 'CC_BUILD_ARTIFACTS'
|
@@ -45,7 +47,7 @@ module MetricFu
|
|
45
47
|
#
|
46
48
|
# The Configuration class checks for several deprecated constants
|
47
49
|
# that were previously used to configure MetricFu. These include
|
48
|
-
# CHURN_OPTIONS, DIRECTORIES_TO_FLOG, SAIKURO_OPTIONS,
|
50
|
+
# CHURN_OPTIONS, DIRECTORIES_TO_FLOG, SAIKURO_OPTIONS,
|
49
51
|
# and MetricFu::SAIKURO_OPTIONS.
|
50
52
|
#
|
51
53
|
# These have been replaced by config.churn, config.flog and
|
@@ -57,7 +59,7 @@ module MetricFu
|
|
57
59
|
add_attr_accessors_to_self
|
58
60
|
add_class_methods_to_metric_fu
|
59
61
|
end
|
60
|
-
|
62
|
+
|
61
63
|
# Searches through the instance variables of the class and
|
62
64
|
# creates a class method on the MetricFu module to read the value
|
63
65
|
# of the instance variable from the Configuration class.
|
@@ -72,9 +74,9 @@ module MetricFu
|
|
72
74
|
MetricFu.module_eval(method)
|
73
75
|
end
|
74
76
|
end
|
75
|
-
|
77
|
+
|
76
78
|
# Searches through the instance variables of the class and creates
|
77
|
-
# an attribute accessor on this instance of the Configuration
|
79
|
+
# an attribute accessor on this instance of the Configuration
|
78
80
|
# class for each instance variable.
|
79
81
|
def add_attr_accessors_to_self
|
80
82
|
instance_variables.each do |name|
|
@@ -93,7 +95,7 @@ module MetricFu
|
|
93
95
|
def self.run
|
94
96
|
yield MetricFu.configuration
|
95
97
|
end
|
96
|
-
|
98
|
+
|
97
99
|
# This does the real work of the Configuration class, by setting
|
98
100
|
# up a bunch of instance variables to represent the configuration
|
99
101
|
# of the MetricFu app.
|
@@ -102,23 +104,23 @@ module MetricFu
|
|
102
104
|
@scratch_directory = File.join(@base_directory, 'scratch')
|
103
105
|
@output_directory = File.join(@base_directory, 'output')
|
104
106
|
@data_directory = File.join('tmp/metric_fu', '_data')
|
105
|
-
@metric_fu_root_directory = File.join(File.dirname(__FILE__),
|
107
|
+
@metric_fu_root_directory = File.join(File.dirname(__FILE__),
|
106
108
|
'..', '..')
|
107
|
-
@template_directory = File.join(@metric_fu_root_directory,
|
108
|
-
'lib', 'templates')
|
109
|
+
@template_directory = File.join(@metric_fu_root_directory,
|
110
|
+
'lib', 'templates')
|
109
111
|
@template_class = AwesomeTemplate
|
110
112
|
set_metrics
|
111
113
|
set_graphs
|
112
114
|
set_code_dirs
|
113
115
|
@flay = { :dirs_to_flay => @code_dirs,
|
114
116
|
:minimum_score => 100,
|
115
|
-
:filetypes => ['rb'] }
|
117
|
+
:filetypes => ['rb'] }
|
116
118
|
@flog = { :dirs_to_flog => @code_dirs }
|
117
119
|
@reek = { :dirs_to_reek => @code_dirs,
|
118
120
|
:config_file_pattern => nil}
|
119
121
|
@roodi = { :dirs_to_roodi => @code_dirs,
|
120
122
|
:roodi_config => nil}
|
121
|
-
@saikuro = { :output_directory => @scratch_directory + '/saikuro',
|
123
|
+
@saikuro = { :output_directory => @scratch_directory + '/saikuro',
|
122
124
|
:input_directory => @code_dirs,
|
123
125
|
:cyclo => "",
|
124
126
|
:filter_cyclo => "0",
|
@@ -128,10 +130,10 @@ module MetricFu
|
|
128
130
|
@churn = {}
|
129
131
|
@stats = {}
|
130
132
|
@rcov = { :environment => 'test',
|
131
|
-
:test_files => ['test/**/*_test.rb',
|
133
|
+
:test_files => ['test/**/*_test.rb',
|
132
134
|
'spec/**/*_spec.rb'],
|
133
|
-
:rcov_opts => ["--sort coverage",
|
134
|
-
"--no-html",
|
135
|
+
:rcov_opts => ["--sort coverage",
|
136
|
+
"--no-html",
|
135
137
|
"--text-coverage",
|
136
138
|
"--no-color",
|
137
139
|
"--profile",
|
@@ -142,7 +144,7 @@ module MetricFu
|
|
142
144
|
@rails_best_practices = {}
|
143
145
|
@hotspots = {}
|
144
146
|
@file_globs_to_ignore = []
|
145
|
-
|
147
|
+
|
146
148
|
@graph_engine = :bluff # can be :bluff or :gchart
|
147
149
|
end
|
148
150
|
|
@@ -163,12 +165,12 @@ module MetricFu
|
|
163
165
|
@metrics = MetricFu::AVAILABLE_METRICS
|
164
166
|
end
|
165
167
|
end
|
166
|
-
|
168
|
+
|
167
169
|
def set_graphs
|
168
170
|
if rails?
|
169
171
|
@graphs = MetricFu::AVAILABLE_GRAPHS + [:stats]
|
170
172
|
else
|
171
|
-
@graphs = MetricFu::AVAILABLE_GRAPHS
|
173
|
+
@graphs = MetricFu::AVAILABLE_GRAPHS
|
172
174
|
end
|
173
175
|
end
|
174
176
|
|
@@ -180,11 +182,11 @@ module MetricFu
|
|
180
182
|
@code_dirs = ['lib']
|
181
183
|
end
|
182
184
|
end
|
183
|
-
|
185
|
+
|
184
186
|
def platform #:nodoc:
|
185
187
|
return RUBY_PLATFORM
|
186
188
|
end
|
187
|
-
|
189
|
+
|
188
190
|
def is_cruise_control_rb?
|
189
191
|
!!ENV['CC_BUILD_ARTIFACTS']
|
190
192
|
end
|
data/lib/base/flay_analyzer.rb
CHANGED
@@ -6,7 +6,7 @@ class FlayAnalyzer
|
|
6
6
|
def columns
|
7
7
|
COLUMNS
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def name
|
11
11
|
:flay
|
12
12
|
end
|
@@ -22,7 +22,7 @@ class FlayAnalyzer
|
|
22
22
|
def score(metric_ranking, item)
|
23
23
|
ScoringStrategies.percentile(metric_ranking, item)
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def generate_records(data, table)
|
27
27
|
return if data==nil
|
28
28
|
Array(data[:matches]).each do |match|
|
data/lib/base/flog_analyzer.rb
CHANGED
@@ -6,11 +6,11 @@ class FlogAnalyzer
|
|
6
6
|
def columns
|
7
7
|
COLUMNS
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def name
|
11
11
|
:flog
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def map(row)
|
15
15
|
row.score
|
16
16
|
end
|
@@ -22,13 +22,13 @@ class FlogAnalyzer
|
|
22
22
|
def score(metric_ranking, item)
|
23
23
|
ScoringStrategies.identity(metric_ranking, item)
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def generate_records(data, table)
|
27
27
|
return if data==nil
|
28
28
|
Array(data[:method_containers]).each do |method_container|
|
29
29
|
Array(method_container[:methods]).each do |entry|
|
30
30
|
file_path = entry[1][:path].sub(%r{^/},'') if entry[1][:path]
|
31
|
-
location = Location.for(entry.first)
|
31
|
+
location = MetricFu::Location.for(entry.first)
|
32
32
|
table << {
|
33
33
|
"metric" => name,
|
34
34
|
"score" => entry[1][:score],
|