Skip to content

Commit

Permalink
changed the metric-fu task a little
Browse files Browse the repository at this point in the history
git-svn-id: http://subversion.assembla.com/svn/kronn/dotfiles@82 1aa5152a-1356-48d1-b235-dfba56e26d50
  • Loading branch information
kronn committed Jul 9, 2010
1 parent 15f08da commit 2e88132
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions .rake/metrics.rake
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,43 @@ rescue LoadError
end

if defined? MetricFu
app_type = ( ENV['TYPE'] || 'rails' ).to_sym
dirs = ['app', 'lib']

MetricFu::Configuration.run do |config|
#define which metrics you want to use
# config.metrics = [:churn, :saikuro, :stats, :flog, :flay, :reek, :roodi, :rcov]
config.metrics = [:churn, :saikuro, :flog, :flay, :roodi]
# config.graphs = ( defined? RMagick ) ? [:flog, :flay, :reek, :roodi, :rcov] : []
config.graphs = ( defined? Magick ) ? [:flog, :flay, :roodi] : []
config.flay = { :dirs_to_flay => ['app', 'lib'] }
config.flog = { :dirs_to_flog => ['app', 'lib'] }
config.reek = { :dirs_to_reek => ['app', 'lib'] }
config.roodi = { :dirs_to_roodi => ['app', 'lib'] }
config.flay = { :dirs_to_flay => dirs, :minimun_score => 50 }
config.flog = { :dirs_to_flog => dirs }
config.reek = { :dirs_to_reek => dirs }
config.roodi = { :dirs_to_roodi => dirs }
config.saikuro = { :output_directory => 'tmp/metric_fu/scratch/saikuro',
:input_directory => ['app', 'lib'],
:input_directory => dirs,
:cyclo => "",
:filter_cyclo => "0",
:warn_cyclo => "5",
:error_cyclo => "7",
:formater => "text"} #this needs to be set to "text"
config.churn = { :start_date => "6 months ago", :minimum_churn_count => 10}
config.rcov = { :test_files => ['test/**/*_test.rb', 'spec/**/*_spec.rb'],
:rcov_opts => [
"--sort coverage",
"--no-html",
"--text-coverage",
"--no-color",
"--profile",
"--rails",
"--include test",
"--exclude /gems/,/Library/,spec"]}
end
# config.graph_engine = :bluff

# differences between metriced code
case app_type
when :lib
# config.metrics = [:churn, :saikuro, :flog, :flay, :reek, :roodi, :rcov]
# config.graphs = ( defined? RMagick ) ? [:flog, :flay, :reek, :roodi, :rcov] : []
config.metrics = [:churn, :saikuro, :flog, :flay, :roodi, :rcov]
config.graphs = ( defined? Magick ) ? [:flog, :flay, :roodi] : []
config.rcov = { :environment => 'test', :test_files => ['**/test_*.rb', '**/spec_*.rb'],
:rcov_opts => [ "--sort coverage", "--no-html", "--text-coverage", "--no-color",
"--profile", "--include test", "--exclude /gems/,/Library/,spec"]
}
else # :rails
config.metrics = [:churn, :saikuro, :stats, :flog, :flay, :reek, :roodi, :rcov]
config.graphs = ( defined? RMagick ) ? [:flog, :flay, :reek, :roodi, :rcov] : []
config.rcov = { :environment => 'test', :test_files => ['test/**/*_test.rb', 'spec/**/*_spec.rb'],
:rcov_opts => [ "--sort coverage", "--no-html", "--text-coverage", "--no-color",
"--profile", "--rails", "--include test", "--exclude /gems/,/Library/,spec"]
}
end
end
end

0 comments on commit 2e88132

Please sign in to comment.