iain-metric_fu 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +159 -0
- data/MIT-LICENSE +22 -0
- data/Manifest +103 -0
- data/README +1 -0
- data/Rakefile +29 -0
- data/TODO +9 -0
- data/home_page/back_all.jpg +0 -0
- data/home_page/churn.gif +0 -0
- data/home_page/flay.gif +0 -0
- data/home_page/flog.gif +0 -0
- data/home_page/footer.gif +0 -0
- data/home_page/header.jpg +0 -0
- data/home_page/img09.gif +0 -0
- data/home_page/index.html +270 -0
- data/home_page/rcov.gif +0 -0
- data/home_page/reek.gif +0 -0
- data/home_page/roodi.gif +0 -0
- data/home_page/saikuro.gif +0 -0
- data/home_page/stats.gif +0 -0
- data/home_page/styles.css +245 -0
- data/home_page/title.gif +0 -0
- data/home_page/title_back.gif +0 -0
- data/lib/base/base_template.rb +146 -0
- data/lib/base/configuration.rb +187 -0
- data/lib/base/generator.rb +160 -0
- data/lib/base/graph.rb +38 -0
- data/lib/base/md5_tracker.rb +52 -0
- data/lib/base/report.rb +100 -0
- data/lib/generators/churn.rb +90 -0
- data/lib/generators/flay.rb +33 -0
- data/lib/generators/flog.rb +140 -0
- data/lib/generators/rcov.rb +87 -0
- data/lib/generators/reek.rb +37 -0
- data/lib/generators/roodi.rb +31 -0
- data/lib/generators/saikuro.rb +208 -0
- data/lib/generators/stats.rb +43 -0
- data/lib/graphs/flay_grapher.rb +35 -0
- data/lib/graphs/flog_grapher.rb +51 -0
- data/lib/graphs/grapher.rb +19 -0
- data/lib/graphs/rcov_grapher.rb +34 -0
- data/lib/graphs/reek_grapher.rb +44 -0
- data/lib/graphs/roodi_grapher.rb +34 -0
- data/lib/graphs/stats_grapher.rb +37 -0
- data/lib/metric_fu.rb +30 -0
- data/lib/templates/awesome/awesome_template.rb +30 -0
- data/lib/templates/awesome/churn.html.erb +19 -0
- data/lib/templates/awesome/css/buttons.css +82 -0
- data/lib/templates/awesome/css/default.css +81 -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 +27 -0
- data/lib/templates/awesome/flog.html.erb +47 -0
- data/lib/templates/awesome/index.html.erb +28 -0
- data/lib/templates/awesome/js/sorttable.js +492 -0
- data/lib/templates/awesome/layout.html.erb +34 -0
- data/lib/templates/awesome/rcov.html.erb +36 -0
- data/lib/templates/awesome/reek.html.erb +34 -0
- data/lib/templates/awesome/roodi.html.erb +21 -0
- data/lib/templates/awesome/saikuro.html.erb +71 -0
- data/lib/templates/awesome/stats.html.erb +46 -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 +38 -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/metric_fu.gemspec +42 -0
- data/spec/base/base_template_spec.rb +161 -0
- data/spec/base/configuration_spec.rb +300 -0
- data/spec/base/generator_spec.rb +181 -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 +152 -0
- data/spec/generators/flay_spec.rb +104 -0
- data/spec/generators/flog_spec.rb +219 -0
- data/spec/generators/reek_spec.rb +60 -0
- data/spec/generators/saikuro_spec.rb +58 -0
- data/spec/generators/stats_spec.rb +74 -0
- data/spec/graphs/flay_grapher_spec.rb +44 -0
- data/spec/graphs/flog_grapher_spec.rb +61 -0
- data/spec/graphs/grapher_spec.rb +9 -0
- data/spec/graphs/rcov_grapher_spec.rb +44 -0
- data/spec/graphs/reek_grapher_spec.rb +53 -0
- data/spec/graphs/roodi_grapher_spec.rb +44 -0
- data/spec/graphs/stats_grapher_spec.rb +60 -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/resources/yml/20090822.yml +8342 -0
- data/spec/spec.opts +8 -0
- data/spec/spec_helper.rb +6 -0
- data/tasks/metric_fu.rake +22 -0
- data/vendor/_fonts/monaco.ttf +0 -0
- data/vendor/saikuro/SAIKURO_README +142 -0
- data/vendor/saikuro/saikuro.rb +1219 -0
- metadata +251 -0
data/HISTORY
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
=== MetricFu 1.1.5 / 2009-8-13
|
2
|
+
|
3
|
+
* Previous Ruby 1.9 fix was not quite fix-y enough
|
4
|
+
|
5
|
+
=== MetricFu 1.1.4 / 2009-7-13
|
6
|
+
|
7
|
+
* Fixed another Ruby 1.9x bug
|
8
|
+
|
9
|
+
=== MetricFu 1.1.3 / 2009-7-10
|
10
|
+
|
11
|
+
* MetricFu is now Ruby 1.9x compatible
|
12
|
+
* Removed the check for deprecated ways of configuring metric_fu as the tests were causing Ruby 1.9x problems and it's been forever since they were supported.
|
13
|
+
* Removed total flog score from graph (which will always go up and so doesn't mean much) and replacing it with top_five_percent_average which is an average of the worst 5 percent of your methods.
|
14
|
+
* Sort Flog by highest score in the class which I feel is more important than the total flog flog score.
|
15
|
+
|
16
|
+
=== MetricFu 1.1.2 / 2009-7-09
|
17
|
+
|
18
|
+
* Removed dependency on gruff and rmagick (unless the user wants graphs, of course).
|
19
|
+
* New look for styling -- Edouard Brière
|
20
|
+
* Extra param in rcov call was causing problems -- Stewart Welbourne
|
21
|
+
* Preventing rake task from being run multiple times when other rake tasks switch the environment -- Matthew Van Horn
|
22
|
+
* Typo in Rcov dependency verification and fixing parsing Saikuro nested information -- Mark Wilden
|
23
|
+
|
24
|
+
=== MetricFu 1.1.1 / 2009-6-29
|
25
|
+
|
26
|
+
* Fix for empty flog files
|
27
|
+
|
28
|
+
=== MetricFu 1.1.0 / 2009-6-22
|
29
|
+
|
30
|
+
* Flog, flay, reek, roodi, and rcov reports now graph progress over time. Well done Nick Quaranto and Edouard Brière.
|
31
|
+
* 'Awesome' template has been brought in so that reports look 90% less 'ghetto.' Also done by Nick Quaranto and Edouard Brière.
|
32
|
+
* Added links to TextMate (which keep getting removed. Probably by me. Sorry.) -- David Chelimsky
|
33
|
+
* Fixed a bug for scratch files which have a size of 0 -- Kevin Hall
|
34
|
+
* Changed gem dependencies from install-time in gemspec to runtime when each of the generators is loaded. This allows use of github gems (i.e. relevance-rcov instead of rcov) and also allows you to install only the gems for the metrics you plan on using. -- Alex Rothenberg
|
35
|
+
* Empty Flog file fix -- Adam Bair
|
36
|
+
* Added a simple fix for cases where Saikuro results with nested information -- Randy Souza
|
37
|
+
* Fixed rcov configuration so it ignores library files on Linux -- Diego Carrion
|
38
|
+
* Changing churn so that it still works deeper than the git root directory -- Andrew Timberlake
|
39
|
+
* Andrew Timberlake also made some nice changes to the base template which kinda of got overshadowed by the 'awesome' template. Sorry about that Andrew.
|
40
|
+
|
41
|
+
=== MetricFu 1.0.2 / 2009-5-11
|
42
|
+
|
43
|
+
* Fixing problems with Reek new line character (thanks to all who pointed this out)
|
44
|
+
* Flog now recognizes namespaces in method names thanks to Daniel Guettler
|
45
|
+
* Saikuro now looks at multiple directories, again.
|
46
|
+
|
47
|
+
=== MetricFu 1.0.1 / 2009-5-3
|
48
|
+
|
49
|
+
* metrics:all task no longer requires a MetricFu::Configuration.run {} if you want to accept the defaults
|
50
|
+
* rcov task now reports total coverage percent
|
51
|
+
|
52
|
+
=== MetricFu 1.0.0 / 2009-4-30
|
53
|
+
|
54
|
+
* Merged in Grant McInnes' work on creating yaml output for all metrics to aid harvesting by other tools
|
55
|
+
* Supporting Flog 2.1.0
|
56
|
+
* Supporting Reek 1.0.0
|
57
|
+
* Removed dependency on Rails Env for 3.months.ago (for churn report), now using chronic gem ("3 months ago").
|
58
|
+
* Almost all code is out of Rakefiles now and so is more easily testable
|
59
|
+
* Metrics inherit from a refactored Generator now. New metrics generators just have to implement "emit", "analyze", "to_h" and inherit from Generator. They also must have a template. See the flay generator and template for a simple implementation.
|
60
|
+
* You now define the metrics you wish to run in the configuration and then run "metrics:all". No other metrics task is exposed by default.
|
61
|
+
|
62
|
+
=== MetricFu 0.9.0 / 2009-1-25
|
63
|
+
|
64
|
+
* Adding line numbers to the views so that people viewing it on cc.rb can figure out where the problems are
|
65
|
+
* Merging in changes from Jay Zeschin having to do with the railroad task -- I still have no idea how to use it (lemme know if you figure it out)
|
66
|
+
* Added totals to Flog results
|
67
|
+
* Moved rcov options to configuration
|
68
|
+
|
69
|
+
=== MetricFu 0.8.9 / 2009-1-20
|
70
|
+
|
71
|
+
* Thanks to Andre Arko and Petrik de Heus for adding the following features:
|
72
|
+
* The source control type is auto-detected for Churn
|
73
|
+
* Moved all presentation to templates
|
74
|
+
* Wrote specs for all classes
|
75
|
+
* Added flay, Reek and Roodi metrics
|
76
|
+
* There's now a configuration class (see README for details)
|
77
|
+
* Unification of metrics reports
|
78
|
+
* Metrics can be generated using one command
|
79
|
+
* Adding new metrics reports has been standardized
|
80
|
+
|
81
|
+
=== MetricFu 0.8.0 / 2008-10-06
|
82
|
+
|
83
|
+
* Source Control Churn now supports git (thanks to Erik St Martin)
|
84
|
+
* Flog Results are sorted by Highest Flog Score
|
85
|
+
* Fix for a bunch of 'already initialized constant' warnings that metric_fu caused
|
86
|
+
* Fixing bug so the flog reporter can handle methods with digits in the name (thanks to Andy Gregorowicz)
|
87
|
+
* Internal Rake task now allows metric_fu to flog/churn itself
|
88
|
+
|
89
|
+
=== MetricFu 0.7.6 / 2008-09-15
|
90
|
+
|
91
|
+
* CHURN_OPTIONS has become MetricFu::CHURN_OPTIONS
|
92
|
+
* SAIKURO_OPTIONS has become MetricFu::SAIKURO_OPTIONS
|
93
|
+
* Rcov now looks at test and specs
|
94
|
+
* Exclude gems and Library ruby code from rcov
|
95
|
+
* Fixed bug with churn start_date functionality (bad path)
|
96
|
+
|
97
|
+
=== MetricFu 0.7.5 / 2008-09-12
|
98
|
+
|
99
|
+
* Flog can now flog any set of directories you like (see README).
|
100
|
+
* Saikuro can now look at any set of directories you like (see README).
|
101
|
+
|
102
|
+
=== MetricFu 0.7.1 / 2008-09-12
|
103
|
+
|
104
|
+
* Fixed filename bugs pointed out by Bastien
|
105
|
+
|
106
|
+
=== MetricFu 0.7.0 / 2008-09-11
|
107
|
+
|
108
|
+
* Merged in Sean Soper's changes to metric_fu.
|
109
|
+
* Metric_fu is now a gem.
|
110
|
+
* Flogging now uses a MD5 hash to figure out if it should re-flog a file (if it's changed)
|
111
|
+
* Flogging also has a cool new output screen(s)
|
112
|
+
* Thanks Sean!
|
113
|
+
|
114
|
+
=== Metricks 0.4.2 / 2008-07-01
|
115
|
+
|
116
|
+
* Changed rcov output directory so that it is no longer 'coverage/unit' but just 'coverage' for better integration with CC.rb
|
117
|
+
|
118
|
+
=== Metricks 0.4.1 / 2008-06-13
|
119
|
+
|
120
|
+
* Rcov tests now extend beyond one level depth directory by using RcovTask instead of the shell
|
121
|
+
|
122
|
+
=== Metricks 0.4.0 / 2008-06-13
|
123
|
+
|
124
|
+
* Implementing functionality for use as a gem
|
125
|
+
* Added Rakefile to facilitate testing
|
126
|
+
|
127
|
+
=== Metricks 0.3.0 / 2008-06-11
|
128
|
+
|
129
|
+
* Generated reports now open on darwin automatically
|
130
|
+
* Generated reports reside under tmp/metricks unless otherwise specified by ENV['CC_BUILD_ARTIFACTS']
|
131
|
+
* MD5Tracker works with Flog reports for speed optimization
|
132
|
+
|
133
|
+
=== Metricks 0.2.0 / 2008-06-11
|
134
|
+
|
135
|
+
* Integrated use of base directory constant
|
136
|
+
* Have all reports automatically open in a browser if platform is darwin
|
137
|
+
* Namespaced under Metricks
|
138
|
+
* Dropped use of shell md5 command in favor of Ruby's Digest::MD5 libraries
|
139
|
+
|
140
|
+
=== Metricks 0.1.0 / 2008-06-10
|
141
|
+
|
142
|
+
* Initial integration of metric_fu and my enhancements to flog
|
143
|
+
* Metrics are generated but are all over the place
|
144
|
+
|
145
|
+
=== MetricFu 0.6.0 / 2008-05-11
|
146
|
+
|
147
|
+
* Add source control churn report
|
148
|
+
|
149
|
+
=== MetricFu 0.5.1 / 2008-04-25
|
150
|
+
|
151
|
+
* Fixed bug with Saikuro report generation
|
152
|
+
|
153
|
+
=== MetricFu 0.5.0 / 2008-04-25
|
154
|
+
|
155
|
+
* create MetricFu as a Rails Plugin
|
156
|
+
* Add Flog Report
|
157
|
+
* Add Coverage Report
|
158
|
+
* Add Saikuro Report
|
159
|
+
* Add Stats Report
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2008,2009 Jake Scruggs
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
HISTORY
|
2
|
+
MIT-LICENSE
|
3
|
+
README
|
4
|
+
TODO
|
5
|
+
home_page/back_all.jpg
|
6
|
+
home_page/churn.gif
|
7
|
+
home_page/flay.gif
|
8
|
+
home_page/flog.gif
|
9
|
+
home_page/footer.gif
|
10
|
+
home_page/header.jpg
|
11
|
+
home_page/img09.gif
|
12
|
+
home_page/index.html
|
13
|
+
home_page/rcov.gif
|
14
|
+
home_page/reek.gif
|
15
|
+
home_page/roodi.gif
|
16
|
+
home_page/saikuro.gif
|
17
|
+
home_page/stats.gif
|
18
|
+
home_page/styles.css
|
19
|
+
home_page/title.gif
|
20
|
+
home_page/title_back.gif
|
21
|
+
lib/base/base_template.rb
|
22
|
+
lib/base/generator.rb
|
23
|
+
lib/base/graph.rb
|
24
|
+
lib/base/md5_tracker.rb
|
25
|
+
lib/base/report.rb
|
26
|
+
lib/base/configuration.rb
|
27
|
+
lib/generators/churn.rb
|
28
|
+
lib/generators/flay.rb
|
29
|
+
lib/generators/flog.rb
|
30
|
+
lib/generators/rcov.rb
|
31
|
+
lib/generators/reek.rb
|
32
|
+
lib/generators/roodi.rb
|
33
|
+
lib/generators/saikuro.rb
|
34
|
+
lib/generators/stats.rb
|
35
|
+
lib/graphs/flay_grapher.rb
|
36
|
+
lib/graphs/flog_grapher.rb
|
37
|
+
lib/graphs/grapher.rb
|
38
|
+
lib/graphs/rcov_grapher.rb
|
39
|
+
lib/graphs/reek_grapher.rb
|
40
|
+
lib/graphs/roodi_grapher.rb
|
41
|
+
lib/graphs/stats_grapher.rb
|
42
|
+
lib/metric_fu.rb
|
43
|
+
lib/templates/awesome/awesome_template.rb
|
44
|
+
lib/templates/awesome/css/buttons.css
|
45
|
+
lib/templates/awesome/css/integrity.css
|
46
|
+
lib/templates/awesome/css/reset.css
|
47
|
+
lib/templates/awesome/css/default.css
|
48
|
+
lib/templates/awesome/index.html.erb
|
49
|
+
lib/templates/awesome/churn.html.erb
|
50
|
+
lib/templates/awesome/flay.html.erb
|
51
|
+
lib/templates/awesome/flog.html.erb
|
52
|
+
lib/templates/awesome/js/sorttable.js
|
53
|
+
lib/templates/awesome/layout.html.erb
|
54
|
+
lib/templates/awesome/rcov.html.erb
|
55
|
+
lib/templates/awesome/reek.html.erb
|
56
|
+
lib/templates/awesome/roodi.html.erb
|
57
|
+
lib/templates/awesome/saikuro.html.erb
|
58
|
+
lib/templates/awesome/stats.html.erb
|
59
|
+
lib/templates/standard/churn.html.erb
|
60
|
+
lib/templates/standard/default.css
|
61
|
+
lib/templates/standard/flay.html.erb
|
62
|
+
lib/templates/standard/flog.html.erb
|
63
|
+
lib/templates/standard/index.html.erb
|
64
|
+
lib/templates/standard/rcov.html.erb
|
65
|
+
lib/templates/standard/reek.html.erb
|
66
|
+
lib/templates/standard/roodi.html.erb
|
67
|
+
lib/templates/standard/saikuro.html.erb
|
68
|
+
lib/templates/standard/standard_template.rb
|
69
|
+
lib/templates/standard/stats.html.erb
|
70
|
+
spec/base/base_template_spec.rb
|
71
|
+
spec/base/generator_spec.rb
|
72
|
+
spec/base/graph_spec.rb
|
73
|
+
spec/base/md5_tracker_spec.rb
|
74
|
+
spec/base/report_spec.rb
|
75
|
+
spec/base/configuration_spec.rb
|
76
|
+
spec/generators/churn_spec.rb
|
77
|
+
spec/generators/flay_spec.rb
|
78
|
+
spec/generators/flog_spec.rb
|
79
|
+
spec/generators/reek_spec.rb
|
80
|
+
spec/generators/saikuro_spec.rb
|
81
|
+
spec/generators/stats_spec.rb
|
82
|
+
spec/graphs/flay_grapher_spec.rb
|
83
|
+
spec/graphs/flog_grapher_spec.rb
|
84
|
+
spec/graphs/grapher_spec.rb
|
85
|
+
spec/graphs/rcov_grapher_spec.rb
|
86
|
+
spec/graphs/reek_grapher_spec.rb
|
87
|
+
spec/graphs/roodi_grapher_spec.rb
|
88
|
+
spec/graphs/stats_grapher_spec.rb
|
89
|
+
spec/resources/saikuro/app/controllers/sessions_controller.rb_cyclo.html
|
90
|
+
spec/resources/saikuro/app/controllers/users_controller.rb_cyclo.html
|
91
|
+
spec/resources/saikuro/index_cyclo.html
|
92
|
+
spec/resources/saikuro_sfiles/thing.rb_cyclo.html
|
93
|
+
spec/resources/yml/20090630.yml
|
94
|
+
spec/resources/yml/20090822.yml
|
95
|
+
spec/spec.opts
|
96
|
+
spec/spec_helper.rb
|
97
|
+
tasks/metric_fu.rake
|
98
|
+
vendor/_fonts/monaco.ttf
|
99
|
+
vendor/saikuro/SAIKURO_README
|
100
|
+
vendor/saikuro/saikuro.rb
|
101
|
+
Rakefile
|
102
|
+
Manifest
|
103
|
+
metric_fu.gemspec
|
data/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
See http://metric-fu.rubyforge.org/ for documentation, or the HISTORY file for a change log.
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/rdoctask'
|
3
|
+
require 'spec/rake/spectask'
|
4
|
+
require 'lib/metric_fu'
|
5
|
+
|
6
|
+
desc "Run all specs in spec directory"
|
7
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
8
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
9
|
+
t.rcov = true
|
10
|
+
t.rcov_opts = ['--exclude', 'spec,config,Library,usr/lib/ruby']
|
11
|
+
t.rcov_dir = File.join(File.dirname(__FILE__), "tmp")
|
12
|
+
end
|
13
|
+
|
14
|
+
MetricFu::Configuration.run do |config|
|
15
|
+
config.template_class = AwesomeTemplate
|
16
|
+
end
|
17
|
+
|
18
|
+
task :default => [:"metrics:all"]
|
19
|
+
|
20
|
+
require 'echoe'
|
21
|
+
Echoe.new('metric_fu', '0.1.0') do |p|
|
22
|
+
p.description = "A fist of metrics for Ruby"
|
23
|
+
p.url = "http://metric-fu.rubyforge.org"
|
24
|
+
p.author = "J. Scruggs and more"
|
25
|
+
p.email = "iain@iain.nl"
|
26
|
+
p.ignore_pattern = [ "tmp/*", "script/*" ]
|
27
|
+
p.development_dependencies = []
|
28
|
+
p.runtime_dependencies = %w{flog flay rcov gruff}
|
29
|
+
end
|
data/TODO
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
== TODO list
|
2
|
+
|
3
|
+
* Color code flog results with scale from: http://jakescruggs.blogspot.com/2008/08/whats-good-flog-score.html
|
4
|
+
* Integrate Flog, Saikuro, and Coverage into one report so you can see methods that have high complexity and low coverage (this is a big one)
|
5
|
+
* Update flog specs so that they actually run flog
|
6
|
+
* Add flay specs that run flay
|
7
|
+
* Convert readme to markdown and rename to README.mkdn so github will render it
|
8
|
+
* Saikuro.rb falls over if tries to parse an empty file. Fair enough. We shouldn't feed it empty files
|
9
|
+
* Make running metric_fu on metric_fu less embarrassing
|
Binary file
|
data/home_page/churn.gif
ADDED
Binary file
|
data/home_page/flay.gif
ADDED
Binary file
|
data/home_page/flog.gif
ADDED
Binary file
|
Binary file
|
Binary file
|
data/home_page/img09.gif
ADDED
Binary file
|
@@ -0,0 +1,270 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5
|
+
<title>metric_fu: A Ruby Gem for Easy Metric Report Generation</title>
|
6
|
+
<meta name="keywords" content="metric_fu rails metrics saikuro flog flay roodi reek cyclomatic complexity rcov coverage gem" />
|
7
|
+
<meta name="description" content="Ruby Gem for Easy Metric Report Generation" />
|
8
|
+
<link href="styles.css" rel="stylesheet" type="text/css" />
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="main">
|
12
|
+
<!-- header begins -->
|
13
|
+
<div id="header">
|
14
|
+
|
15
|
+
<div id="logo"><a href="#">metric_fu</a></div>
|
16
|
+
<div id="buttons">
|
17
|
+
<ul><li>A Ruby Gem for Easy Metric Report Generation</li></ul>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
</div>
|
21
|
+
<!-- header ends -->
|
22
|
+
<!-- content begins -->
|
23
|
+
<div id="content">
|
24
|
+
<div id="right">
|
25
|
+
<div id="sidebar">
|
26
|
+
<ul>
|
27
|
+
<li>
|
28
|
+
<h2>Links</h2>
|
29
|
+
<ul>
|
30
|
+
<li><a href="http://groups.google.com/group/metric_fu">
|
31
|
+
Google Group
|
32
|
+
</a>
|
33
|
+
</li>
|
34
|
+
<li><a href="http://github.com/jscruggs/metric_fu">
|
35
|
+
SCM
|
36
|
+
</a>
|
37
|
+
</li>
|
38
|
+
<li><a href="http://jakescruggs.blogspot.com/">
|
39
|
+
Jake Scruggs' Blog (lead developer)
|
40
|
+
</a>
|
41
|
+
</li>
|
42
|
+
</ul>
|
43
|
+
</li>
|
44
|
+
</ul>
|
45
|
+
</div>
|
46
|
+
<!-- end #sidebar -->
|
47
|
+
</div>
|
48
|
+
<div id="left">
|
49
|
+
<h1>About metric_fu 1.1.5</h1>
|
50
|
+
<div>
|
51
|
+
<p><br/>
|
52
|
+
Metric_fu is a set of rake tasks that make it easy to generate metrics reports. It uses
|
53
|
+
<a href="http://saikuro.rubyforge.org/">Saikuro</a>,
|
54
|
+
<a href="http://ruby.sadi.st/Flog.html">Flog</a>,
|
55
|
+
<a href="http://ruby.sadi.st/Flay.html">Flay</a>,
|
56
|
+
<a href="http://eigenclass.org/hiki.rb?rcov">Rcov</a>,
|
57
|
+
<a href="http://github.com/kevinrutherford/reek/tree/master">Reek</a>,
|
58
|
+
<a href="http://github.com/martinjandrews/roodi/tree/master">Roodi</a>,
|
59
|
+
<a href="http://subversion.tigris.org/">Subversion</a>,
|
60
|
+
<a href="http://git.or.cz/">Git</a>, and
|
61
|
+
<a href="http://www.rubyonrails.org/">Rails</a>
|
62
|
+
built-in stats task to create a series of reports. It's designed to integrate easily with
|
63
|
+
<a href="http://cruisecontrolrb.thoughtworks.com/">CruiseControl.rb</a>
|
64
|
+
by placing files in the Custom Build Artifacts folder.
|
65
|
+
</p>
|
66
|
+
<br/>
|
67
|
+
<p>
|
68
|
+
New in metric_fu 1.1.0 is integration of the 'Awesome' template and graphs -- which graph your metric performance over time! Big thanks go to <a href="http://litanyagainstfear.com/">Nick Quaranto</a> and <a href="http://www.nanalegumene.net/">Edouard Brière</a> for their work on this feature. If you're used to the non-awesome reports then this will be quite a treat. Graphing requires the gems 'gruff' and 'rmagick' (and rmagick requires ImageMagick). If that's too much installation to bear, then see configuration section below for how to turn off graphing of the metrics.
|
69
|
+
</p>
|
70
|
+
<br/>
|
71
|
+
<p>
|
72
|
+
New in metric_fu 1.0.0 is yaml serialization of the metrics. Running metric_fu now generates, in addition to html reports, a report.yml file. You can consume this file to mash up metrics, track them, or whatever you desire. Many thanks go to <a href="http://github.com/gmcinnes">Grant McInnes</a> for his work on this feature.
|
73
|
+
</p>
|
74
|
+
<h2>Installation:</h2>
|
75
|
+
<p>If you haven't added github to your gem sources do this:</p>
|
76
|
+
<pre>sudo gem sources -a http://gems.github.com</pre>
|
77
|
+
<br/>
|
78
|
+
<p>Now install the gem:</p>
|
79
|
+
<pre>sudo gem install jscruggs-metric_fu</pre>
|
80
|
+
<br/>
|
81
|
+
<p>Then in your Rakefile:</p>
|
82
|
+
<br/>
|
83
|
+
<pre>require 'metric_fu'</pre>
|
84
|
+
<br/>
|
85
|
+
<p>
|
86
|
+
If you like to vendor gems, you can unpack metric_fu into vendor/gems and require it like so:
|
87
|
+
</p>
|
88
|
+
<br/>
|
89
|
+
<pre>require(File.join(RAILS_ROOT, 'vendor', 'gems', 'jscruggs-metric_fu-1.1.5', 'lib', 'metric_fu'))</pre>
|
90
|
+
<br/>
|
91
|
+
<p>Then you don't have to install it on every box you run it on.</p>
|
92
|
+
<br/>
|
93
|
+
<p>Later versions of Rails like to manage your gems for you, so you can put this in your test.rb file:</p>
|
94
|
+
<br/>
|
95
|
+
<pre>config.gem 'jscruggs-metric_fu', :version => '1.1.5', :lib => 'metric_fu', :source => 'http://gems.github.com'</pre>
|
96
|
+
<br/>
|
97
|
+
<p>And then issue this command:</p>
|
98
|
+
<br/>
|
99
|
+
<pre>
|
100
|
+
$ rake gems:unpack RAILS_ENV=test
|
101
|
+
</pre>
|
102
|
+
<br/>
|
103
|
+
<p>That way Rails won't yell at you every time you run a Rake task:</p>
|
104
|
+
<br/>
|
105
|
+
<pre>
|
106
|
+
config.gem: Unpacked gem jscruggs-metric_fu-1.1.5 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
|
107
|
+
</pre>
|
108
|
+
<br/>
|
109
|
+
<p>
|
110
|
+
I hate being yelled at.
|
111
|
+
</p>
|
112
|
+
|
113
|
+
<h2>Output:</h2>
|
114
|
+
<table>
|
115
|
+
<tr>
|
116
|
+
<td><a href="flog.gif"><img src="flog.gif" width="250"></a></td>
|
117
|
+
<td><a href="flay.gif"><img src="flay.gif" width="250"></a></td>
|
118
|
+
<tr>
|
119
|
+
<td><a href="churn.gif"><img src="churn.gif" width="250"></a></td>
|
120
|
+
<td><a href="saikuro.gif"><img src="saikuro.gif" width="250"></a></td>
|
121
|
+
</tr>
|
122
|
+
<tr>
|
123
|
+
<td><a href="reek.gif"><img src="reek.gif" width="250"></a></td>
|
124
|
+
<td><a href="roodi.gif"><img src="roodi.gif" width="250"></a></td>
|
125
|
+
</tr>
|
126
|
+
<tr>
|
127
|
+
<td><a href="rcov.gif"><img src="rcov.gif" width="250"></a></td>
|
128
|
+
<td><a href="stats.gif"><img src="stats.gif" width="250"></a></td>
|
129
|
+
</tr>
|
130
|
+
</table>
|
131
|
+
<p><br/>
|
132
|
+
<h2>Usage:</h2>
|
133
|
+
Out of the box metric_fu provides this tasks:
|
134
|
+
<ul>
|
135
|
+
<li>rake metrics:all # Generate coverage, cyclomatic complexity, flog, flay, reek, roodi, stats... </li>
|
136
|
+
</ul>
|
137
|
+
<br/>
|
138
|
+
I recommend using CruiseControl.rb to set up a metrics build. See the CruiseControl.rb online docs for more info on how to set up cc.rb and, once you've got that figured out, change the cruise_config.rb file inside your project to have these lines:
|
139
|
+
<br/><br/>
|
140
|
+
<pre>project.rake_task = 'metrics:all'</pre>
|
141
|
+
<pre>project.scheduler.polling_interval = 24.hours</pre>
|
142
|
+
<br/>
|
143
|
+
Which will check for updates every 24 hours and run all the metric_fu rake tasks (migrating your test db first). The output will be visible from an individual build's detail page.
|
144
|
+
</p>
|
145
|
+
<br/>
|
146
|
+
|
147
|
+
<h2>Configuration:</h2>
|
148
|
+
<p>Metric_fu can be customized to your liking by altering the defaults in your Rakefile:</p>
|
149
|
+
<pre>
|
150
|
+
MetricFu::Configuration.run do |config|
|
151
|
+
#define which metrics you want to use
|
152
|
+
config.metrics = [:churn, :saikuro, :stats, :flog, :flay, :reek, :roodi, :rcov]
|
153
|
+
config.graphs = [:flog, :flay, :reek, :roodi, :rcov]
|
154
|
+
config.flay = { :dirs_to_flay => ['app', 'lib'] }
|
155
|
+
config.flog = { :dirs_to_flog => ['app', 'lib'] }
|
156
|
+
config.reek = { :dirs_to_reek => ['app', 'lib'] }
|
157
|
+
config.roodi = { :dirs_to_roodi => ['app', 'lib'] }
|
158
|
+
config.saikuro = { :output_directory => 'scratch_directory/saikuro',
|
159
|
+
:input_directory => ['app', 'lib'],
|
160
|
+
:cyclo => "",
|
161
|
+
:filter_cyclo => "0",
|
162
|
+
:warn_cyclo => "5",
|
163
|
+
:error_cyclo => "7",
|
164
|
+
:formater => "text"} #this needs to be set to "text"
|
165
|
+
config.churn = { :start_date => "1 year ago", :minimum_churn_count => 10}
|
166
|
+
config.rcov = { :test_files => ['test/**/*_test.rb',
|
167
|
+
'spec/**/*_spec.rb'],
|
168
|
+
:rcov_opts => ["--sort coverage",
|
169
|
+
"--no-html",
|
170
|
+
"--text-coverage",
|
171
|
+
"--no-color",
|
172
|
+
"--profile",
|
173
|
+
"--rails",
|
174
|
+
"--exclude /gems/,/Library/,spec"]}
|
175
|
+
end
|
176
|
+
</pre>
|
177
|
+
Note: if you don't want one of the metrics to run (like rcov), make sure you don't try to graph it (which will explode). Set config.graphs to exactly the graphs you want. Set config.graphs to an empty array (config.graphs = []) if you want no graphing at all.
|
178
|
+
</p>
|
179
|
+
|
180
|
+
<p><br/>
|
181
|
+
<h2>Notes on metrics:coverage</h2>
|
182
|
+
When creating a coverage report, metric_fu runs all the tests in the test folder and specs in spec folder using Rcov.
|
183
|
+
</p>
|
184
|
+
<p><br/>
|
185
|
+
<h2>Notes on metrics:saikuro</h2>
|
186
|
+
Saikuro is bundled with metric_fu so you don't have to install it. Look at the SAIKURO_README (or the internet) for more documentation on Saikuro.
|
187
|
+
<br/><br/>
|
188
|
+
</p>
|
189
|
+
<p><br/>
|
190
|
+
<h2>Notes on metrics:flay</h2>
|
191
|
+
Flay analyzes ruby code for structural similarities.
|
192
|
+
You can configure which directories need to be flayed.
|
193
|
+
The defaults are 'lib' for non Rails projects and ['app', 'lib'] for Rails projects.
|
194
|
+
</p>
|
195
|
+
|
196
|
+
<p><br/>
|
197
|
+
<h2>Notes on metrics:flog</h2>
|
198
|
+
Note: Flog 2.1.2 has some issues with Ruby 1.8.6 -- try using Flog 2.1.0 (Flog 2.1.2 does, however, work fine with Ruby 1.9.1)
|
199
|
+
<br/>
|
200
|
+
Flog is another way of measuring complexity (or tortured code as the Flog authors like to put it). You should check out the awesome, and a little scary, <a href="http://ruby.sadi.st/Flog.html">Flog website</a> for more info.
|
201
|
+
</p>
|
202
|
+
<p><br/>
|
203
|
+
<h2>Notes on metrics:reek</h2>
|
204
|
+
Reek detects common code smells in ruby code.
|
205
|
+
You can configure which directories need to be checked.
|
206
|
+
The defaults are 'lib' for non Rails projects and ['app', 'lib'] for Rails projects.
|
207
|
+
</p>
|
208
|
+
|
209
|
+
<p><br/>
|
210
|
+
<h2>Notes on metrics:roodi</h2>
|
211
|
+
Roodi parses your Ruby code and warns you about design issues you have based on the checks that is has configured.
|
212
|
+
You can configure which directories need to be checked.
|
213
|
+
The defaults are 'lib' for non Rails projects and ['app', 'lib'] for Rails projects.
|
214
|
+
</p>
|
215
|
+
<p><br/>
|
216
|
+
<h2>Notes on metrics:stats</h2>
|
217
|
+
This is just 'rake stats' put into a file. On my projects I like to be able to look at CruiseControl and get stats about the app at different points in time.
|
218
|
+
</p>
|
219
|
+
<p><br/>
|
220
|
+
<h2>Notes on metrics:churn</h2>
|
221
|
+
Files that change a lot in your project may be bad a sign. This task uses svn or git's log to identify those files and put them in a report.
|
222
|
+
<br/>
|
223
|
+
<br/>
|
224
|
+
</p>
|
225
|
+
<br/>
|
226
|
+
<p>Metric_fu began its life as a plugin for Rails that generated code metrics reports. As of version 0.7.0, metric_fu is a gem (owing to the excellent work done by Sean Soper) and is hosted on GitHub at <a href="http://github.com/jscruggs/metric_fu">http://github.com/jscruggs/metric_fu</a>. </p>
|
227
|
+
<p><br/>
|
228
|
+
<h2>Questions?</h2>
|
229
|
+
<p>Use the Google Group: <a href="http://groups.google.com/group/metric_fu">http://groups.google.com/group/metric_fu</a></p>
|
230
|
+
<br/>
|
231
|
+
<h2>Thanks</h2>
|
232
|
+
I'd like to thank the authors of Saikuro, Subversion, Flog, Rcov, CruiseControl.rb, and Rails for creating such excellent open source products. Also many thanks go to
|
233
|
+
<a href="http://arko.net/">Andre Arko</a>,
|
234
|
+
<a href="http://deheus.net/petrik">Petrik de Heus</a>,
|
235
|
+
<a href="http://seansoper.com/">Sean Soper</a>,
|
236
|
+
<a href="http://www.perilled.com/">Erik St Martin</a>,
|
237
|
+
<a href="http://gregorowicz.blogspot.com/">Andy Gregorowicz</a>,
|
238
|
+
<a href="http://github.com/bastien/">Bastien</a>,
|
239
|
+
<a href="http://schubert.cx/">Michael Schubert</a>,
|
240
|
+
<a href="http://kseebaldt.blogspot.com/">Kurtis Seebaldt</a>,
|
241
|
+
<a href="http://www.workingwithrails.com/person/11263-toby-tripp">Toby Tripp</a>,
|
242
|
+
<a href="http://www.aliaghareza.com">Ali Aghareza</a>,
|
243
|
+
<a href="http://www.pgrs.net/">Paul Gross</a>, and
|
244
|
+
<a href="http://chirdeepshetty.net/">Chirdeep Shetty</a>
|
245
|
+
for their contributions to metric_fu.
|
246
|
+
</p>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
</div>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
</div>
|
253
|
+
<!-- content ends -->
|
254
|
+
<!-- footer begins -->
|
255
|
+
<div id="metamorph2"><div id="footer">
|
256
|
+
<p>Copyright © 2008. Designed by <a href="http://www.metamorphozis.com/" title="Free Web Templates">Free Web Templates</a></p>
|
257
|
+
</div></div>
|
258
|
+
<!-- footer ends -->
|
259
|
+
|
260
|
+
<script type="text/javascript">
|
261
|
+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
262
|
+
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
263
|
+
</script>
|
264
|
+
<script type="text/javascript">
|
265
|
+
var pageTracker = _gat._getTracker("UA-1908573-3");
|
266
|
+
pageTracker._initData();
|
267
|
+
pageTracker._trackPageview();
|
268
|
+
</script>
|
269
|
+
</body>
|
270
|
+
</html>
|
data/home_page/rcov.gif
ADDED
Binary file
|
data/home_page/reek.gif
ADDED
Binary file
|
data/home_page/roodi.gif
ADDED
Binary file
|
Binary file
|
data/home_page/stats.gif
ADDED
Binary file
|