我向Metrical指出我们需要运行rcov,roody,reek,stat,flog,flay。 看起来在运行所有指标后,它会在生成报告时卡住。当我按Ctrl + C中止测量时,它会打印出下面的堆栈跟踪。
/home/deploy/.gem/ruby/1.8/gems/syntax-1.0.0/lib/syntax/common.rb:99:in `scan_until': Interrupt
from /home/deploy/.gem/ruby/1.8/gems/syntax-1.0.0/lib/syntax/common.rb:99:in `__send__'
from /home/deploy/.gem/ruby/1.8/gems/syntax-1.0.0/lib/syntax/common.rb:99:in `scan_until'
from /home/deploy/.gem/ruby/1.8/gems/syntax-1.0.0/lib/syntax/lang/ruby.rb:28:in `step'
from /home/deploy/.gem/ruby/1.8/gems/syntax-1.0.0/lib/syntax/common.rb:77:in `tokenize'
from /home/deploy/.gem/ruby/1.8/gems/syntax-1.0.0/lib/syntax/convertors/html.rb:16:in `convert'
from /home/deploy/.gem/ruby/1.8/gems/metric_fu-2.1.1/lib/templates/awesome/awesome_template.rb:59:in `write_file_data'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `each_with_index'
from /home/deploy/.gem/ruby/1.8/gems/metric_fu-2.1.1/lib/templates/awesome/awesome_template.rb:46:in `each'
from /home/deploy/.gem/ruby/1.8/gems/metric_fu-2.1.1/lib/templates/awesome/awesome_template.rb:46:in `each_with_index'
from /home/deploy/.gem/ruby/1.8/gems/metric_fu-2.1.1/lib/templates/awesome/awesome_template.rb:46:in `write_file_data'
from /home/deploy/.gem/ruby/1.8/gems/metric_fu-2.1.1/lib/templates/awesome/awesome_template.rb:40:in `each_pair'
from /home/deploy/.gem/ruby/1.8/gems/metric_fu-2.1.1/lib/templates/awesome/awesome_template.rb:40:in `write_file_data'
from /home/deploy/.gem/ruby/1.8/gems/metric_fu-2.1.1/lib/templates/awesome/awesome_template.rb:34:in `write'
from /home/deploy/.gem/ruby/1.8/gems/metric_fu-2.1.1/lib/base/report.rb:48:in `save_templatized_report'
from /usr/lib/ruby/gems/1.8/gems/metrical-0.1.0/lib/metrical.rb:66:in `run_metric_fu'
from /usr/lib/ruby/gems/1.8/gems/metrical-0.1.0/lib/metrical.rb:21:in `run'
from /usr/lib/ruby/gems/1.8/gems/metrical-0.1.0/bin/metrical:4
from /usr/bin/metrical:19:in `load'
from /usr/bin/metrical:19
请帮忙。提前谢谢。
答案 0 :(得分:0)
下面的测量配置解决了我的问题。基本上我将模板更改为StandardTemplate,这不是默认设置,并且可以正常工作。至少它不会因任何原因而挂起。
MetricFu::Configuration.run do |config|
config.metrics = [:reek, :roodi, :flog, :flay, :rcov, :stats, :rails_best_practices, :churn, :saikuro]
config.graphs = [:reek, :roodi, :flog, :flay, :rcov, :stats, :rails_best_practices, :churn, :saikuro]
config.verbose = true
config.template_class = StandardTemplate
config.rcov[:rcov_opts] << "-I#{"lib:test"}"
config.graph_engine = :gchart
end