Created
April 12, 2010 07:04
-
-
Save leobessa/363343 to your computer and use it in GitHub Desktop.
script/metrics with metric_fu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
begin | |
require 'metric_fu' | |
require 'reek' | |
require 'roodi' | |
rescue LoadError | |
puts "Error loading gems. Try this: gem install metric_fu reek roodi" | |
exit | |
end | |
MetricFu::Configuration.run do |config| | |
#define which metrics you want to use | |
config.metrics = [:churn, :saikuro, :stats, :flog, :flay, :reek, :roodi] | |
config.graphs = [:flog, :flay, :reek, :roodi] | |
config.flay = { :dirs_to_flay => ['app', 'lib'], | |
:minimum_score => 10 } | |
config.flog = { :dirs_to_flog => ['app', 'lib'] } | |
config.reek = { :dirs_to_reek => ['app', 'lib'] } | |
config.roodi = { :dirs_to_roodi => ['app', 'lib'] } | |
config.saikuro = { :output_directory => "#{ENV['CC_BUILD_ARTIFACTS'] || 'tmp/metric_fu'}/scratch/saikuro", | |
:input_directory => ["app\" --input_directory \"lib"], | |
:cyclo => "", | |
:filter_cyclo => "0", | |
:warn_cyclo => "5", | |
:error_cyclo => "7", | |
:formater => "text"} #this needs to be set to "text" | |
config.churn = { :start_date => "1 year ago", :minimum_churn_count => 10} | |
config.rcov = { :environment => 'test', | |
:test_files => ['spec/**/*_spec.rb'], | |
:rcov_opts => ["--sort coverage", | |
"--no-html", | |
"--text-coverage", | |
"--no-color", | |
"--profile", | |
"--rails", | |
"--exclude /gems/,/Library/,spec", | |
"--include spec"] | |
} | |
config.graph_engine = :bluff | |
end | |
Rake::Task["metrics:all"].invoke |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment