Domanda

I specified to Metrical that we need to run rcov, roody, reek, stat, flog, flay. It looks like after running all the metrics, it gets stuck while generating reports. When I abort metrical pressing Ctrl+C, it prints out following stacktrace.

/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

Please help. Thanks in advance.

È stato utile?

Soluzione

The following configuration for metrical solved my problem. Essentially I change the template to StandardTemplate which is not the default and it works. At least it doesn't hang for any reason.

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top