metric_fu 4.4.4 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +14 -6
- checksums.yaml.gz.sig +3 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +1 -0
- data/.metrics +0 -3
- data/.travis.yml +1 -1
- data/.yardopts +0 -1
- data/CONTRIBUTING.md +1 -0
- data/CONTRIBUTORS +61 -2
- data/Gemfile +14 -11
- data/Gemfile.devtools +40 -0
- data/Guardfile +30 -0
- data/HISTORY.md +54 -1
- data/README.md +86 -56
- data/bin/mf-cane +8 -6
- data/bin/mf-churn +8 -7
- data/bin/mf-flay +8 -7
- data/bin/mf-reek +8 -7
- data/bin/mf-roodi +8 -7
- data/bin/mf-saikuro +8 -6
- data/certs/bf4.pem +22 -0
- data/checksum/metric_fu-4.4.4.gem.sha512 +1 -0
- data/checksum/metric_fu-4.5.0.gem.sha512 +1 -0
- data/etc/README.md +16 -0
- data/etc/erd.dot +173 -0
- data/etc/erd.png +0 -0
- data/lib/metric_fu.rb +56 -12
- data/lib/metric_fu/cli/helper.rb +8 -2
- data/lib/metric_fu/cli/parser.rb +86 -50
- data/lib/metric_fu/configuration.rb +4 -31
- data/lib/metric_fu/environment.rb +1 -1
- data/lib/metric_fu/formatter/html.rb +5 -5
- data/lib/metric_fu/gem_run.rb +68 -0
- data/lib/metric_fu/gem_version.rb +57 -0
- data/lib/metric_fu/io.rb +1 -1
- data/lib/metric_fu/load_files.rb +3 -5
- data/lib/metric_fu/loader.rb +31 -2
- data/lib/metric_fu/logging/mf_debugger.rb +1 -0
- data/lib/metric_fu/metric.rb +23 -1
- data/lib/metric_fu/metrics/cane/cane.rb +7 -3
- data/lib/metric_fu/metrics/cane/cane_grapher.rb +19 -0
- data/lib/metric_fu/metrics/cane/template_awesome/cane.html.erb +0 -4
- data/lib/metric_fu/metrics/churn/churn.rb +6 -7
- data/lib/metric_fu/metrics/flay/flay.rb +2 -4
- data/lib/metric_fu/metrics/flay/flay_grapher.rb +19 -0
- data/lib/metric_fu/metrics/flay/template_awesome/flay.html.erb +0 -4
- data/lib/metric_fu/metrics/flog/flog.rb +0 -2
- data/lib/metric_fu/metrics/flog/flog_grapher.rb +19 -0
- data/lib/metric_fu/metrics/flog/template_awesome/flog.html.erb +0 -4
- data/lib/metric_fu/metrics/generator.rb +34 -24
- data/lib/metric_fu/metrics/graph.rb +8 -14
- data/lib/metric_fu/metrics/hotspots/hotspot.rb +7 -5
- data/lib/metric_fu/metrics/hotspots/template_awesome/hotspots.html.erb +4 -6
- data/lib/metric_fu/metrics/rails_best_practices/rails_best_practices.rb +0 -2
- data/lib/metric_fu/metrics/rails_best_practices/rails_best_practices_grapher.rb +19 -0
- data/lib/metric_fu/metrics/rails_best_practices/template_awesome/rails_best_practices.html.erb +0 -4
- data/lib/metric_fu/metrics/rcov/rcov_grapher.rb +19 -0
- data/lib/metric_fu/metrics/rcov/template_awesome/rcov.html.erb +0 -4
- data/lib/metric_fu/metrics/reek/init.rb +1 -1
- data/lib/metric_fu/metrics/reek/reek.rb +12 -8
- data/lib/metric_fu/metrics/reek/reek_grapher.rb +19 -0
- data/lib/metric_fu/metrics/reek/template_awesome/reek.html.erb +0 -4
- data/lib/metric_fu/metrics/roodi/roodi.rb +2 -3
- data/lib/metric_fu/metrics/roodi/roodi_grapher.rb +19 -0
- data/lib/metric_fu/metrics/roodi/template_awesome/roodi.html.erb +0 -4
- data/lib/metric_fu/metrics/saikuro/saikuro.rb +69 -33
- data/lib/metric_fu/metrics/saikuro/scratch_file.rb +8 -9
- data/lib/metric_fu/metrics/stats/stats_grapher.rb +20 -0
- data/lib/metric_fu/metrics/stats/template_awesome/stats.html.erb +0 -4
- data/lib/metric_fu/reporting/graphs/grapher.rb +69 -3
- data/lib/metric_fu/reporting/result.rb +5 -1
- data/lib/metric_fu/reporting/templates/awesome/awesome_template.rb +7 -3
- data/lib/metric_fu/run.rb +13 -7
- data/lib/metric_fu/tasks/metric_fu.rake +50 -3
- data/lib/metric_fu/utility.rb +10 -0
- data/lib/metric_fu/version.rb +1 -1
- data/metric_fu.gemspec +7 -4
- data/spec/dummy/.gitignore +1 -0
- data/spec/dummy/.gitkeep +0 -0
- data/spec/dummy/.metrics +4 -0
- data/spec/dummy/lib/.gitkeep +0 -0
- data/spec/dummy/spec/.gitkeep +0 -0
- data/spec/{resources/yml → fixtures}/20090630.yml +1 -1
- data/spec/{resources/yml → fixtures}/hotspots/flog.yml +0 -0
- data/spec/{resources/yml → fixtures}/hotspots/generator.yml +0 -0
- data/spec/{resources/yml → fixtures}/hotspots/generator_analysis.yml +0 -0
- data/spec/{resources/yml → fixtures}/hotspots/reek.yml +0 -0
- data/spec/{resources/yml → fixtures}/hotspots/roodi.yml +0 -0
- data/spec/{resources/yml → fixtures}/hotspots/saikuro.yml +0 -0
- data/spec/{resources/yml → fixtures}/hotspots/several_metrics.yml +0 -0
- data/spec/{resources/yml → fixtures}/hotspots/stats.yml +0 -0
- data/spec/{resources/yml → fixtures}/hotspots/three_metrics_on_same_file.yml +0 -0
- data/spec/{resources → fixtures}/line_numbers/foo.rb +0 -0
- data/spec/{resources → fixtures}/line_numbers/module.rb +0 -0
- data/spec/{resources → fixtures}/line_numbers/module_surrounds_class.rb +0 -0
- data/spec/{resources → fixtures}/line_numbers/two_classes.rb +0 -0
- data/spec/{resources/yml → fixtures}/metric_missing.yml +0 -0
- data/spec/{resources → fixtures}/saikuro/app/controllers/sessions_controller.rb_cyclo.html +0 -0
- data/spec/{resources → fixtures}/saikuro/app/controllers/users_controller.rb_cyclo.html +0 -0
- data/spec/{resources → fixtures}/saikuro/index_cyclo.html +0 -0
- data/spec/{resources → fixtures}/saikuro_sfiles/thing.rb_cyclo.html +0 -0
- data/spec/metric_fu/configuration_spec.rb +1 -1
- data/spec/metric_fu/data_structures/line_numbers_spec.rb +13 -11
- data/spec/metric_fu/formatter/html_spec.rb +2 -2
- data/spec/metric_fu/gem_version_spec.rb +14 -0
- data/spec/metric_fu/loader_spec.rb +12 -0
- data/spec/metric_fu/metrics/base_template_spec.rb +9 -7
- data/spec/metric_fu/metrics/cane/cane_spec.rb +7 -7
- data/spec/metric_fu/metrics/churn/churn_spec.rb +1 -1
- data/spec/metric_fu/metrics/flay/flay_grapher_spec.rb +2 -2
- data/spec/metric_fu/metrics/flay/flay_spec.rb +2 -2
- data/spec/metric_fu/metrics/flog/flog_grapher_spec.rb +3 -3
- data/spec/metric_fu/metrics/generator_spec.rb +1 -35
- data/spec/metric_fu/metrics/graph_spec.rb +7 -24
- data/spec/metric_fu/metrics/hotspots/analysis/analyzed_problems_spec.rb +2 -2
- data/spec/metric_fu/metrics/hotspots/analysis/analyzer_tables_spec.rb +2 -2
- data/spec/metric_fu/metrics/hotspots/analysis/rankings_spec.rb +5 -5
- data/spec/metric_fu/metrics/hotspots/hotspots_spec.rb +2 -3
- data/spec/metric_fu/metrics/rails_best_practices/rails_best_practices_grapher_spec.rb +2 -2
- data/spec/metric_fu/metrics/rails_best_practices/rails_best_practices_spec.rb +1 -1
- data/spec/metric_fu/metrics/rcov/rcov_grapher_spec.rb +2 -2
- data/spec/metric_fu/metrics/rcov/rcov_spec.rb +1 -4
- data/spec/metric_fu/metrics/reek/reek_grapher_spec.rb +2 -2
- data/spec/metric_fu/metrics/reek/reek_spec.rb +1 -1
- data/spec/metric_fu/metrics/roodi/roodi_grapher_spec.rb +2 -2
- data/spec/metric_fu/metrics/roodi/roodi_spec.rb +3 -3
- data/spec/metric_fu/metrics/saikuro/saikuro_spec.rb +14 -10
- data/spec/metric_fu/metrics/stats/stats_grapher_spec.rb +2 -2
- data/spec/metric_fu/reporting/graphs/{engines/bluff_spec.rb → grapher_spec.rb} +8 -2
- data/spec/{run_spec.rb → metric_fu/run_spec.rb} +8 -13
- data/spec/spec_helper.rb +30 -5
- data/spec/support/deferred_garbaged_collection.rb +34 -0
- data/spec/support/helper_methods.rb +1 -15
- data/spec/support/suite.rb +4 -24
- data/spec/support/test_fixtures.rb +39 -0
- data/spec/support/timeout.rb +7 -0
- metadata +129 -104
- metadata.gz.sig +1 -0
- data/lib/metric_fu/metrics/cane/cane_bluff_grapher.rb +0 -16
- data/lib/metric_fu/metrics/cane/cane_gchart_grapher.rb +0 -25
- data/lib/metric_fu/metrics/flay/flay_bluff_grapher.rb +0 -16
- data/lib/metric_fu/metrics/flay/flay_gchart_grapher.rb +0 -20
- data/lib/metric_fu/metrics/flog/flog_bluff_grapher.rb +0 -17
- data/lib/metric_fu/metrics/flog/flog_gchart_grapher.rb +0 -28
- data/lib/metric_fu/metrics/rails_best_practices/rails_best_practices_bluff_grapher.rb +0 -16
- data/lib/metric_fu/metrics/rails_best_practices/rails_best_practices_gchart_grapher.rb +0 -27
- data/lib/metric_fu/metrics/rcov/rcov_bluff_grapher.rb +0 -16
- data/lib/metric_fu/metrics/rcov/rcov_gchart_grapher.rb +0 -22
- data/lib/metric_fu/metrics/reek/reek_bluff_grapher.rb +0 -16
- data/lib/metric_fu/metrics/reek/reek_gchart_grapher.rb +0 -30
- data/lib/metric_fu/metrics/roodi/roodi_bluff_grapher.rb +0 -16
- data/lib/metric_fu/metrics/roodi/roodi_gchart_grapher.rb +0 -20
- data/lib/metric_fu/metrics/stats/stats_bluff_grapher.rb +0 -17
- data/lib/metric_fu/metrics/stats/stats_gchart_grapher.rb +0 -27
- data/lib/metric_fu/reporting/graphs/engines/bluff.rb +0 -33
- data/lib/metric_fu/reporting/graphs/engines/gchart.rb +0 -72
- data/lib/metric_fu/reporting/graphs/engines/init.rb +0 -19
- data/lib/metric_fu_requires.rb +0 -63
- data/spec/metric_fu/reporting/graphs/engines/gchart_spec.rb +0 -161
checksums.yaml
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
OGFmOWRmZTljYTI4ZGNjMDZmNTk4ZGU3ZWUzMjlmMjc0M2ZhMDI1Yw==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
NWM3YjY3MDk2MDFkZmQ1MjYzODM0NDkxZGFhOTE1NjQ1OTYxMDNkZg==
|
|
7
|
+
!binary "U0hBNTEy":
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
NjdlNzUyN2YyMzI4NzU2NDU3ODJkOWQxNWEyM2IyN2NkZmRjODRlZDk4ZjA0
|
|
10
|
+
ODQ4NjdmMzEyMzI2MzkyYjRmMTE2ZjY0ZWM0NTBlZjJmYzY2ZTFiNjcxZGQ2
|
|
11
|
+
NTk0MzJhMTA3NjM5MzkxOTM5YzJkODc0MmNmMGMxMWI5YWEyMDE=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
OTI2NGFkMzZjYzAzYTljYTBlNmUyZDBjMDQ4ZTlkY2UyZjQ4NTdiMWUwMDYz
|
|
14
|
+
NzI4ZTZhYzA0Y2ViOTUxOGUyN2MxNTAzNTQ2YWE4MGQ3YjFiNDVlMGY4Zjdi
|
|
15
|
+
NTBmNjJhNDk0MmU0ZTVlYTg4ZmZjZTc3MmMzZjZiOTYwZGZiMDA=
|
checksums.yaml.gz.sig
ADDED
data.tar.gz.sig
ADDED
|
Binary file
|
data/.gitignore
CHANGED
data/.metrics
CHANGED
data/.travis.yml
CHANGED
data/.yardopts
CHANGED
data/CONTRIBUTING.md
CHANGED
|
@@ -4,6 +4,7 @@ How to contribute:
|
|
|
4
4
|
|
|
5
5
|
* Is something broken or not working as expected? Check for an existing issue or [create a new one](https://github.com/metricfu/metric_fu/issues/new)
|
|
6
6
|
* See [Quick guide to writing good bug reports](https://github.com/metricfu/metric_fu/wiki/Issues:-Quick-guide-to-writing-good-bug-reports)
|
|
7
|
+
* IMPORTANT: Include the output of `metric_fu --debug-info`
|
|
7
8
|
|
|
8
9
|
## Code
|
|
9
10
|
|
data/CONTRIBUTORS
CHANGED
|
@@ -1,2 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Benjamin Fleischer
|
|
2
|
+
Jake Scruggs
|
|
3
|
+
Édouard Brière
|
|
4
|
+
Richard Huang
|
|
5
|
+
Grant McInnes
|
|
6
|
+
Petrik
|
|
7
|
+
Dan Mayer
|
|
8
|
+
Robin Curry
|
|
9
|
+
Sean Soper
|
|
10
|
+
Delwyn de Villiers
|
|
11
|
+
Carl Youngblood
|
|
12
|
+
Andre Arko
|
|
13
|
+
Chris Griego
|
|
14
|
+
Sathish
|
|
15
|
+
Nick Quaranto
|
|
16
|
+
Michael Stark
|
|
17
|
+
dan sinclair
|
|
18
|
+
joshuacronemeyer
|
|
19
|
+
jscruggs
|
|
20
|
+
David Chelimsky
|
|
21
|
+
Jay Zeschin
|
|
22
|
+
Alex Rothenberg
|
|
23
|
+
calveto
|
|
24
|
+
Avdi Grimm
|
|
25
|
+
Kevin Rutherford
|
|
26
|
+
Randy Souza
|
|
27
|
+
GeorgeErickson
|
|
28
|
+
Andy Gregorowicz
|
|
29
|
+
Tarsoly András
|
|
30
|
+
unknown
|
|
31
|
+
Extrovert
|
|
32
|
+
Andrew Timberlake
|
|
33
|
+
KAKUTANI Shintaro
|
|
34
|
+
Guilherme Souza
|
|
35
|
+
carlost
|
|
36
|
+
David Barri
|
|
37
|
+
Beau Fabry
|
|
38
|
+
Chris Mason
|
|
39
|
+
Andrew Selder
|
|
40
|
+
iain
|
|
41
|
+
Mark Wilden
|
|
42
|
+
Lars E. Hoeg
|
|
43
|
+
Eric Wollesen
|
|
44
|
+
Adam Bair
|
|
45
|
+
Jinzhu
|
|
46
|
+
Matthew Van Horn
|
|
47
|
+
Diego Carrion
|
|
48
|
+
Martin Gotink
|
|
49
|
+
benlovell
|
|
50
|
+
khall
|
|
51
|
+
adrien
|
|
52
|
+
Stefan Huber
|
|
53
|
+
Todd A. Jacobs
|
|
54
|
+
Hans Hasselberg
|
|
55
|
+
jayzes
|
|
56
|
+
Scyllinice
|
|
57
|
+
Matthew Gordon
|
|
58
|
+
Chris Ian Fiel
|
|
59
|
+
factorylabs
|
|
60
|
+
Joel Nimety
|
|
61
|
+
Paul Elliott
|
data/Gemfile
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
|
-
gem 'rake'
|
|
4
|
-
# alternative graphing gem
|
|
5
|
-
gem "googlecharts"
|
|
6
|
-
group :development do
|
|
7
3
|
|
|
4
|
+
group :test, :coverage do
|
|
5
|
+
# https://github.com/kina/simplecov-rcov-text
|
|
6
|
+
gem 'simplecov-rcov-text'
|
|
8
7
|
end
|
|
8
|
+
|
|
9
9
|
group :test do
|
|
10
|
-
gem "rspec", '>2'
|
|
11
10
|
gem 'test-construct'
|
|
12
|
-
if ENV['COVERAGE']
|
|
13
|
-
gem 'simplecov'
|
|
14
|
-
# https://github.com/kina/simplecov-rcov-text
|
|
15
|
-
gem 'simplecov-rcov-text'
|
|
16
|
-
end
|
|
17
|
-
gem "fakefs", :require => "fakefs/safe", :platform => :ruby
|
|
18
11
|
gem 'json'
|
|
12
|
+
gem 'pry'
|
|
13
|
+
gem 'pry-nav'
|
|
19
14
|
end
|
|
15
|
+
|
|
20
16
|
gemspec :path => File.expand_path('..', __FILE__)
|
|
17
|
+
|
|
18
|
+
# group :development, :test do
|
|
19
|
+
# gem 'devtools', git: 'https://github.com/rom-rb/devtools.git'
|
|
20
|
+
# end
|
|
21
|
+
|
|
22
|
+
# Added by devtools
|
|
23
|
+
eval_gemfile File.expand_path('Gemfile.devtools', File.dirname(__FILE__))
|
data/Gemfile.devtools
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
group :development do
|
|
4
|
+
gem 'rake', '~> 10.1.0'
|
|
5
|
+
gem 'rspec', '~> 2.14.1'
|
|
6
|
+
gem 'yard', '~> 0.8.7'
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
group :yard do
|
|
10
|
+
gem 'kramdown', '~> 1.2.0'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
group :guard do
|
|
14
|
+
gem 'guard', '~> 1.8.1'
|
|
15
|
+
gem 'guard-bundler', '~> 1.0.0'
|
|
16
|
+
gem 'guard-rspec', '~> 3.0.2'
|
|
17
|
+
# gem 'guard-rubocop', '~> 0.2.0'
|
|
18
|
+
|
|
19
|
+
# file system change event handling
|
|
20
|
+
gem 'listen', '~> 1.3.0'
|
|
21
|
+
gem 'rb-fchange', '~> 0.0.6', require: false
|
|
22
|
+
gem 'rb-fsevent', '~> 0.9.3', require: false
|
|
23
|
+
gem 'rb-inotify', '~> 0.9.0', require: false
|
|
24
|
+
|
|
25
|
+
# notification handling
|
|
26
|
+
gem 'libnotify', '~> 0.8.0', require: false
|
|
27
|
+
gem 'rb-notifu', '~> 0.0.4', require: false
|
|
28
|
+
gem 'terminal-notifier-guard', '~> 1.5.3', require: false
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
group :metrics do
|
|
32
|
+
# gem 'rubocop', '~> 0.14.1'
|
|
33
|
+
gem 'simplecov', '~> 0.7.1'
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
platform :jruby do
|
|
37
|
+
group :jruby do
|
|
38
|
+
gem 'jruby-openssl', '~> 0.8.5'
|
|
39
|
+
end
|
|
40
|
+
end
|
data/Guardfile
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
guard :bundler do
|
|
2
|
+
watch('Gemfile')
|
|
3
|
+
watch('Gemfile.lock')
|
|
4
|
+
watch(%w{.+.gemspec\z})
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
guard :rspec, cli: File.read('.rspec').split.push('--fail-fast').join(' '), keep_failed: false do
|
|
8
|
+
# Run all specs if configuration is modified
|
|
9
|
+
watch('.rspec') { 'spec' }
|
|
10
|
+
watch('Guardfile') { 'spec' }
|
|
11
|
+
watch('Gemfile.lock') { 'spec' }
|
|
12
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
|
13
|
+
|
|
14
|
+
# Run all specs if supporting files are modified
|
|
15
|
+
watch(%r{\Aspec/(?:fixtures|lib|support|shared)/.+\.rb\z}) { 'spec' }
|
|
16
|
+
|
|
17
|
+
# Run unit specs if associated lib code is modified
|
|
18
|
+
watch(%r{\Alib/(.+)\.rb\z}) { |m| "spec/#{m[1]}_spec.rb" }
|
|
19
|
+
watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec' }
|
|
20
|
+
|
|
21
|
+
# Run a spec if it is modified
|
|
22
|
+
watch(%r{\Aspec/.+_spec\.rb$\z})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# TODO enable once we're ready to handle all the violations :)
|
|
26
|
+
# guard :rubocop, cli: %w[--config config/rubocop.yml] do
|
|
27
|
+
# watch(%r{.+\.(?:rb|rake)\z})
|
|
28
|
+
# watch(%r{\Aconfig/rubocop\.yml\z}) { |m| File.dirname(m[0]) }
|
|
29
|
+
# watch(%r{(?:.+/)?\.rubocop\.yml\z}) { |m| File.dirname(m[0]) }
|
|
30
|
+
# end
|
data/HISTORY.md
CHANGED
|
@@ -10,6 +10,59 @@ As such, a _Feature_ would map to either major or minor. A _bug fix_ to a patch.
|
|
|
10
10
|
* Fixes
|
|
11
11
|
* Misc
|
|
12
12
|
|
|
13
|
+
### MetricFu [4.5.1 / 2013-11-07](https://github.com/metricfu/metric_fu/compare/v4.4.4...v4.5.1)
|
|
14
|
+
|
|
15
|
+
* Features
|
|
16
|
+
* Fixes
|
|
17
|
+
* Misc
|
|
18
|
+
* Releasing the signed gem didn't work. See ed2f96d8
|
|
19
|
+
|
|
20
|
+
### MetricFu [4.5.0 / 2013-11-07](https://github.com/metricfu/metric_fu/compare/v4.4.4...v4.5.0)
|
|
21
|
+
|
|
22
|
+
* Features
|
|
23
|
+
* Signed gem; added certs/bf4.pem
|
|
24
|
+
* Run metrics without shelling out; use Open3.popen3 (Benjamin Fleischer, #157)
|
|
25
|
+
- GemRun runs external libraries, outputs nice error messages
|
|
26
|
+
- GemVersion returns version requirements for a gem dependency; replaces metric_fu_requires
|
|
27
|
+
- Consolidate code that runs external metrics to the generator
|
|
28
|
+
- `--debug-info` now outputs metric dependencies
|
|
29
|
+
* Add new MetricFu.run_dir that defaults to Pathname.pwd, but can be set (Benjamin Fleischer, #160)
|
|
30
|
+
- Used in dummy app for testing 9fcc085
|
|
31
|
+
* User config (.metrics) now loaded when metric_fu required (Benjamin Fleischer, #158)
|
|
32
|
+
* Consolidate grapher code; remove gchart grapher (Benjamin Fleischer, 5fd8f4)
|
|
33
|
+
- Remove bluff gem; bluff grapher is a js library. (Benjamin Fleischer, 8b534c7)
|
|
34
|
+
* Better rake tasks: can set options form the task (Benjamin Fleischer, 11ac27)
|
|
35
|
+
- Add ::run(options) and ::run_only(metric_name) to MetricFu namespace
|
|
36
|
+
* Fixes
|
|
37
|
+
* Churn hotspot no longer tries to read directories as if they were files (Adrien Montfort, #169)
|
|
38
|
+
* Set default Reek config to config/*.reek, per Reek docs (Benjamin Fleischer, #165)
|
|
39
|
+
- Ensure .reek still loaded, for backwards-compatibility
|
|
40
|
+
* Bump reek patch version due to change in meaning in reek config (Benjamin Fleischer, #166)
|
|
41
|
+
* Cleanup scratch files Saikuro leaves behind; else they are re-used! (Benjamin Fleischer, 91ac9af)
|
|
42
|
+
* Various IO-related fixes
|
|
43
|
+
- Close read pipe when capturing output, per @eclubb, Earle Clubb (6696d42)
|
|
44
|
+
- Stop leaving files open everywhere, even though 'everyone does it'. (Benjamin Fleischer, #159)
|
|
45
|
+
- Isolate file-system interactions in specs; rbx specs can pass (Benjamin Fleischer, #161)
|
|
46
|
+
* Remove unused before/after generator methods; standardize not_implemented message (Benjamin Fleischer, 5842d83)
|
|
47
|
+
* Misc
|
|
48
|
+
* Update README, and how to contribute (Benjamin Fleischer, #114)
|
|
49
|
+
* Set sane defaults for generator per_file_data hash (Benjamin Fleischer, d991fb8)
|
|
50
|
+
* Ensure gemspec reads AUTHORS from relative path (Benjamin Fleischer, ee0274f)
|
|
51
|
+
* Configure SimpleCov to run with the html and rcov text formatters (Benjamin Fleischer, d372d00)
|
|
52
|
+
* Extract CLI option parsing methods (Benjamin Fleischer, a54d018)
|
|
53
|
+
* Test improvements
|
|
54
|
+
- Update setup, add pry (Benjamin Fleischer)
|
|
55
|
+
- Add rspec FAIL_FAST option (bd2745a)
|
|
56
|
+
- Update spec_helper, add filters, defer gc (3db59d7)
|
|
57
|
+
- Configure tests not to manage GC under JRuby (000200b)
|
|
58
|
+
- Remove FakeFS; doesn't seem to be speeding up the tests, but it does break them (afc5518)
|
|
59
|
+
- Cache test fixtures. (And rename from resources to fixtures.) (Benjamin Fleischer, #164)
|
|
60
|
+
- Set timeout on each test (Benjamin Fleischer, f1d5f20)
|
|
61
|
+
- Add devtools-derived guardfile and configs (Benjamin Fleischer, e2463de)
|
|
62
|
+
- Ensure RailsBestPractices test runs when available (Benjamin Fleischer, #150)
|
|
63
|
+
|
|
64
|
+
add all contriubtors
|
|
65
|
+
|
|
13
66
|
### MetricFu [4.4.4 / 2013-09-27](https://github.com/metricfu/metric_fu/compare/v4.4.3...v4.4.4)
|
|
14
67
|
|
|
15
68
|
* Features
|
|
@@ -44,7 +97,7 @@ As such, a _Feature_ would map to either major or minor. A _bug fix_ to a patch.
|
|
|
44
97
|
|
|
45
98
|
* Features
|
|
46
99
|
* Fixes
|
|
47
|
-
* No longer consider an
|
|
100
|
+
* No longer consider an empty sexp in LineNumbers an error. A file with only comments is empty of code. (Benjamin Fleischer)
|
|
48
101
|
* Prevent encoding errors when using syntax highlighting via coderay (Benjamin Fleischer #120, #131)
|
|
49
102
|
* Misc
|
|
50
103
|
* Update dependencies: cane, flay, flog, reek; switch from metric_fu-roodi to revived roodi (Benjamin Fleischer #130)
|
data/README.md
CHANGED
|
@@ -1,78 +1,81 @@
|
|
|
1
|
-
# MetricFu [](http://badge.fury.io/rb/metric_fu) [](http://travis-ci.org/metricfu/metric_fu)
|
|
1
|
+
# MetricFu [](http://badge.fury.io/rb/metric_fu) [](http://travis-ci.org/metricfu/metric_fu)
|
|
2
2
|
|
|
3
3
|
[](https://codeclimate.com/github/metricfu/metric_fu) [](https://gemnasium.com/metricfu/metric_fu)
|
|
4
4
|
|
|
5
5
|
[Rdoc](http://rdoc.info/github/metricfu/metric_fu/)
|
|
6
6
|
|
|
7
|
-
## Metrics
|
|
8
|
-
|
|
9
|
-
* [Cane](https://rubygems.org/gems/cane), [Source](http://github.com/square/cane)
|
|
10
|
-
* [Churn](https://rubygems.org/gems/churn), [Source](http://github.com/danmayer/churn)
|
|
11
|
-
* [Flog](https://rubygems.org/gems/flog), [Source](https://github.com/seattlerb/flog)
|
|
12
|
-
* [Flay](https://rubygems.org/gems/flay), [Source](https://github.com/seattlerb/flay)
|
|
13
|
-
* [Reek](https://rubygems.org/gems/reek) [Source](https://github.com/troessner/reek)
|
|
14
|
-
* [Roodi](https://rubygems.org/gems/metric_fu-roodi), [Source](https://github.com/metricfu/roodi)
|
|
15
|
-
* [Saikuro](https://rubygems.org/gems/metric_fu-Saikuro), [Source](https://github.com/metricfu/Saikuro)
|
|
16
|
-
[Code Statistics](https://rubygems.org/gems/code_metrics), [Source](https://github.com/bf4/code_metrics) )
|
|
17
|
-
* Rails-only
|
|
18
|
-
* [Rails Best Practices](https://rubygems.org/gems/rails_best_practices), [Source](https://github.com/railsbp/rails_best_practices)
|
|
19
|
-
* Test Coverage
|
|
20
|
-
* 1.9: [SimpleCov](http://rubygems.org/gems/simplecov) and [SimpleCov-Rcov-Text](http://rubygems.org/gems/simplecov-rcov-text)
|
|
21
|
-
* 1.8: [Rcov](http://rubygems.org/gems/rcov)
|
|
22
|
-
* Hotspots (a meta-metric of the above)
|
|
23
|
-
|
|
24
7
|
## Installation
|
|
25
8
|
|
|
26
9
|
gem install metric_fu
|
|
27
10
|
|
|
28
|
-
If you have trouble installing the gem
|
|
11
|
+
If you have trouble installing the gem
|
|
12
|
+
- try adding metric_fu to your Gemfile and bundling.
|
|
13
|
+
- file a ticket on the issues page.
|
|
29
14
|
|
|
30
|
-
|
|
15
|
+
MetricFu is cryptographically signed. To be sure the gem you install hasn't been tampered with:
|
|
16
|
+
- Add my public key (if you haven't already) as a trusted certificate `gem cert --add <(curl -Ls https://raw.github.com/metricfu/metric_fu/master/certs/bf4.pem)`
|
|
17
|
+
- `gem install metric_fu -P HighSecurity`
|
|
18
|
+
- This may cause installation to fail if non-signed dependent gems are also being installed.
|
|
31
19
|
|
|
32
20
|
## Usage
|
|
33
21
|
|
|
34
|
-
|
|
22
|
+
From your application root. Running via Rake is still supported.
|
|
35
23
|
|
|
36
|
-
|
|
24
|
+
```sh
|
|
25
|
+
metric_fu
|
|
26
|
+
```
|
|
37
27
|
|
|
38
|
-
|
|
28
|
+
See:
|
|
29
|
+
- `metric_fu --help` for more options
|
|
30
|
+
- the [.metrics file](https://github.com/metricfu/metric_fu/blob/master/.metrics)
|
|
31
|
+
- Documentation and Compatibility below
|
|
32
|
+
- There is also a [wiki page of user-maintained usage information](https://github.com/metricfu/metric_fu/wiki#usage)
|
|
39
33
|
|
|
40
|
-
|
|
34
|
+
## Contact
|
|
41
35
|
|
|
42
|
-
*
|
|
36
|
+
*Code and Bug Reports*
|
|
43
37
|
|
|
44
|
-
*
|
|
38
|
+
* [Issue Tracker](http://github.com/metricfu/metric_fu/issues)
|
|
39
|
+
* See [CONTRIBUTING](https://github.com/metricfu/metric_fu/blob/master/CONTRIBUTING.md) for how to contribute
|
|
45
40
|
|
|
46
|
-
*
|
|
41
|
+
*Questions, Problems, Suggestions, etc.*
|
|
47
42
|
|
|
48
|
-
*
|
|
43
|
+
* [Google Group](https://groups.google.com/forum/#!forum/metric_fu)
|
|
49
44
|
|
|
50
45
|
## Documentation
|
|
51
46
|
|
|
52
|
-
*[See wiki](https://github.com/metricfu/metric_fu/wiki#usage)
|
|
53
47
|
|
|
54
48
|
## Formatters
|
|
55
49
|
|
|
56
50
|
### Built-in Formatters
|
|
57
51
|
|
|
58
|
-
By default, metric_fu will use the built-in html formatter to generate HTML reports for each metric with pretty graphs.
|
|
52
|
+
By default, metric_fu will use the built-in html formatter to generate HTML reports for each metric with pretty graphs.
|
|
59
53
|
|
|
60
54
|
These reports are generated in metric_fu's output directory (```tmp/metric_fu/output```) by default. You can customize the output directory by specifying an out directory at the command line
|
|
61
55
|
using a relative path:
|
|
62
56
|
|
|
63
|
-
|
|
57
|
+
```sh
|
|
58
|
+
metric_fu --out custom_directory # outputs to tmp/metric_fu/custom_directory
|
|
59
|
+
```
|
|
64
60
|
|
|
65
61
|
or a full path:
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
```sh
|
|
64
|
+
metric_fu --out /home/metrics # outputs to /home/metrics
|
|
65
|
+
```
|
|
68
66
|
|
|
69
67
|
You can specify a different formatter at the command line by referencing a built-in formatter or providing the fully-qualified name of a custom formatter.
|
|
70
68
|
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
```sh
|
|
71
|
+
metric_fu --format yaml --out custom_report.yml
|
|
72
|
+
```
|
|
73
|
+
|
|
73
74
|
or
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
```sh
|
|
77
|
+
metric_fu --format MyCustomFormatter
|
|
78
|
+
```
|
|
76
79
|
|
|
77
80
|
### Custom Formatters
|
|
78
81
|
|
|
@@ -83,14 +86,14 @@ that takes an options hash and responds to one or more notifications:
|
|
|
83
86
|
|
|
84
87
|
```ruby
|
|
85
88
|
class MyCustomFormatter
|
|
86
|
-
def initialize(opts={}); end
|
|
89
|
+
def initialize(opts={}); end # metric_fu will pass in an output param if provided.
|
|
87
90
|
|
|
88
91
|
# Should include one or more of...
|
|
89
|
-
def start; end
|
|
90
|
-
def start_metric(metric); end
|
|
91
|
-
def finish_metric(metric); end
|
|
92
|
-
def finish; end
|
|
93
|
-
def display_results; end
|
|
92
|
+
def start; end # Sent before metric_fu starts metric measurements.
|
|
93
|
+
def start_metric(metric); end # Sent before individual metric is measured.
|
|
94
|
+
def finish_metric(metric); end # Sent after individual metric measurement is complete.
|
|
95
|
+
def finish; end # Sent after metric_fu has completed all measurements.
|
|
96
|
+
def display_results; end # Used to open results in browser, etc.
|
|
94
97
|
end
|
|
95
98
|
```
|
|
96
99
|
|
|
@@ -108,22 +111,19 @@ For instance, to require a formatter in your app's lib directory:
|
|
|
108
111
|
require './lib/my_custom_formatter.rb'
|
|
109
112
|
```
|
|
110
113
|
|
|
111
|
-
### Configuration
|
|
112
|
-
|
|
113
|
-
see the .metrics file
|
|
114
|
-
|
|
115
114
|
### Using Coverage Metrics
|
|
116
115
|
|
|
117
116
|
in your .metrics file add the below to run pre-generated metrics
|
|
118
117
|
|
|
118
|
+
```ruby
|
|
119
119
|
MetricFu::Configuration.run do |config|
|
|
120
120
|
config.configure_metric(:rcov) do |rcov|
|
|
121
121
|
rcov.enabled = true
|
|
122
|
-
|
|
123
|
-
rcov.external = coverage_file
|
|
122
|
+
rcov.external = File.expand_path("coverage/rcov/rcov.txt", Dir.pwd)
|
|
124
123
|
rcov.activate
|
|
125
124
|
end
|
|
126
125
|
end
|
|
126
|
+
```
|
|
127
127
|
|
|
128
128
|
If you want metric_fu to actually run rcov itself (1.8 only), don't specify an external file to read from
|
|
129
129
|
|
|
@@ -131,46 +131,76 @@ If you want metric_fu to actually run rcov itself (1.8 only), don't specify an e
|
|
|
131
131
|
|
|
132
132
|
To generate the same metrics metric_fu has been generating run from the root of your project before running metric_fu
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
```sh
|
|
135
|
+
RAILS_ENV=test rcov $(ruby -e "puts Dir['{spec,test}/**/*_{spec,test}.rb'].join(' ')") --sort coverage --no-html --text-coverage --no-color --profile --exclude-only '.*' --include-file "\Aapp,\Alib" -Ispec > coverage/rcov/rcov.txt
|
|
136
|
+
```
|
|
135
137
|
|
|
136
138
|
#### Simplecov metrics with Ruby 1.9 and 2.0
|
|
137
139
|
|
|
138
140
|
Add to your Gemfile or otherwise install
|
|
139
141
|
|
|
142
|
+
```ruby
|
|
140
143
|
gem 'simplecov'
|
|
141
144
|
# https://github.com/kina/simplecov-rcov-text
|
|
142
145
|
gem 'simplecov-rcov-text'
|
|
146
|
+
```
|
|
143
147
|
|
|
144
|
-
Modify your spec_helper as per the SimpleCov docs and run your tests before running metric_fu
|
|
148
|
+
Modify your [spec_helper](https://github.com/metricfu/metric_fu/blob/master/spec/spec_helper.rb) as per the SimpleCov docs and run your tests before running metric_fu
|
|
145
149
|
|
|
150
|
+
```ruby
|
|
146
151
|
#in your spec_helper
|
|
147
152
|
require 'simplecov'
|
|
148
153
|
require 'simplecov-rcov-text'
|
|
149
154
|
SimpleCov.formatter = SimpleCov::Formatter::RcovTextFormatter
|
|
155
|
+
# or
|
|
156
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
|
157
|
+
SimpleCov::Formatter::HTMLFormatter,
|
|
158
|
+
SimpleCov::Formatter::RcovTextFormatter
|
|
159
|
+
]
|
|
150
160
|
SimpleCov.start
|
|
151
|
-
|
|
161
|
+
```
|
|
152
162
|
|
|
153
|
-
|
|
163
|
+
## Compatibility
|
|
154
164
|
|
|
155
|
-
|
|
165
|
+
* It is currently testing on MRI (>= 1.9.3), JRuby (19 mode), and Rubinius (19 mode). Ruby 1.8 is no longer supported.
|
|
156
166
|
|
|
157
|
-
|
|
167
|
+
* For 1.8.7 support, see version 3.0.0 for partial support, or 2.1.3.7.18.1 (where [Semantic Versioning](http://semver.org/) goes to die)
|
|
168
|
+
|
|
169
|
+
* MetricFu no longer runs any of the analyzed code. For code coverage, You may still use rcov metrics as documented below
|
|
158
170
|
|
|
159
|
-
|
|
171
|
+
* The Cane, Flog, and Rails Best Practices metrics are disabled when Ripper is not available
|
|
172
|
+
|
|
173
|
+
### Historical
|
|
160
174
|
|
|
161
|
-
|
|
175
|
+
There is some useful-but-out-of-date documentation about configuring metric_fu at http://metricfu.github.io/metric_fu and a change log in the the HISTORY file.
|
|
162
176
|
|
|
163
177
|
## Resources:
|
|
164
178
|
|
|
165
179
|
This is the official repository for metric_fu. The original repository by Jake Scruggs at [https://github.com/jscruggs/metric_fu](https://github.com/jscruggs/metric_fu) has been deprecated.
|
|
166
180
|
|
|
167
181
|
* [Official Repository](http://github.com/metricfu/metric_fu)
|
|
168
|
-
* [Issue Tracker](http://metricfu.github.io/metric_fu/)
|
|
169
|
-
* [Google Group](http://metricfu.github.io/metric_fu/)
|
|
170
182
|
* [Outdated Homepage](http://metricfu.github.io/metric_fu/)
|
|
171
183
|
* [List of code tools](https://github.com/metricfu/metric_fu/wiki/Code-Tools)
|
|
172
184
|
* [Roadmap](https://github.com/metricfu/metric_fu/wiki/Roadmap)
|
|
173
185
|
|
|
186
|
+
### Metrics
|
|
187
|
+
|
|
188
|
+
* [Cane](https://rubygems.org/gems/cane), [Source](http://github.com/square/cane)
|
|
189
|
+
* [Churn](https://rubygems.org/gems/churn), [Source](http://github.com/danmayer/churn)
|
|
190
|
+
* [Flog](https://rubygems.org/gems/flog), [Source](https://github.com/seattlerb/flog)
|
|
191
|
+
* [Flay](https://rubygems.org/gems/flay), [Source](https://github.com/seattlerb/flay)
|
|
192
|
+
* [Reek](https://rubygems.org/gems/reek) [Source](https://github.com/troessner/reek)
|
|
193
|
+
* [Roodi](https://rubygems.org/gems/roodi), [Source](https://github.com/roodi/roodi)
|
|
194
|
+
* [Saikuro](https://rubygems.org/gems/metric_fu-Saikuro), [Source](https://github.com/metricfu/Saikuro)
|
|
195
|
+
[Code Statistics](https://rubygems.org/gems/code_metrics), [Source](https://github.com/bf4/code_metrics) )
|
|
196
|
+
* Rails-only
|
|
197
|
+
* [Rails Best Practices](https://rubygems.org/gems/rails_best_practices), [Source](https://github.com/railsbp/rails_best_practices)
|
|
198
|
+
* Test Coverage
|
|
199
|
+
* 1.9: [SimpleCov](http://rubygems.org/gems/simplecov) and [SimpleCov-Rcov-Text](http://rubygems.org/gems/simplecov-rcov-text)
|
|
200
|
+
* 1.8: [Rcov](http://rubygems.org/gems/rcov)
|
|
201
|
+
* Hotspots (a meta-metric of the above)
|
|
202
|
+
|
|
203
|
+
|
|
174
204
|
### Original Resources:
|
|
175
205
|
|
|
176
206
|
* Github: http://github.com/jscruggs/metric_fu
|