2

我目前正在开发一个 Ruby gem 并希望创建指标。

我正在使用“metric_fu”,但 RCov 似乎偏离了我的规范。

这是我的 metric_fu 配置:

MetricFu::Configuration.run do |config|
        config.metrics  = [:churn, :saikuro, :flog, :flay, :reek, :roodi, :rcov]
        config.graphs   = [:flog, :flay, :reek, :roodi, :rcov]
        config.flay     = { :dirs_to_flay => ['lib']  } 
        config.flog     = { :dirs_to_flog => ['lib']  }
        config.reek     = { :dirs_to_reek => ['lib']  }
        config.roodi    = { :dirs_to_roodi => ['lib'] }
        config.saikuro  = { :output_directory => 'scratch_directory/saikuro', 
                            :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     = { :test_files => ["spec/**/*_spec.rb"],
                            :rcov_opts => ["--sort coverage", 
                                           "--no-html", 
                                           "--text-coverage",
                                           "--no-color",
                                           "--profile",
                                           "--spec-only",
                                           "--exclude /gems/,/Library/,spec"]}
end

你有什么建议吗?

此致

4

1 回答 1

0

好吧,如果没有堆栈跟踪,这将很难诊断,但我建议将您的配置更改为:

MetricFu::Configuration.run do |config|
        config.metrics  = [:rcov]
        config.graphs   = [:rcov]
        config.rcov     = { :test_files => ["spec/**/*_spec.rb"],
                            :rcov_opts => ["--sort coverage", 
                                           "--no-html", 
                                           "--text-coverage",
                                           "--no-color",
                                           "--profile",
                                           "--spec-only",
                                           "--exclude /gems/,/Library/,spec"]}
end

所以你可以隔离问题。然后运行“rake metrics:all --trace”,如果您无法从那里弄清楚,请在此处或 metric_fu google 组发布结果:http ://groups.google.com/group/metric_fu

您也可以尝试直接从命令行运行 rcov(本质上就是 metric_fu 所做的)。

希望有帮助。

于 2009-12-23T01:28:46.077 回答