install metric_fu

metric_fu

Installation

gem install metric_fu

Gem

 

From your Gemfile ,install these gems for test and development environment

group :test ,:development do

gem "metric_fu"

gem 'simplecov'

gem 'simplecov-rcov-text'

gem 'roodi' #these gem ensure that you can run roodi or roodi . in shell

end

Require

 

From your Rakefile

 require 'churn'

Usage

 

From your application root. Running via Rake is still supported.

metric_fu

See:

  • metric_fu --help for more options

Run

run "rake -T", you can see all of Commands that you can use , for example:
rake metrics:all 
rake metrics:cane
rake metrics:churn
rake metrics:flay
rake metrics:flog
rake metrics:hotspots
rake metrics:only
rake metrics:rails_best_practices
rake metrics:reek
rake metrics:roodi
rake metrics:saikuro
rake metrics:stats 
Run these commands , you will get some reports at "server/tmp/metric_fu/output" and yml files at "server/tmp/metric_fu/_data"

In shell 

rspec .
Run the command , you will run all testings include all of engine and get a value about test coverage
 
run other metric_fu features: 
flog feature/ #measuring code complexity
flay feature/ #find duplicate (including copy / paste and structure)
reek .   or   reek features/     #spot code smells
roodi  or  roodi .          #find a large number of general issues
rake churn     #Identifies the file changes too frequently
rails_best_practices .      #code matrix tool
cane             #code quality threshold violation
Extra
    saikuro - cyclomatic complexity measure
    hotspot - hot code analysis

Link

 
How To Score Your Rails  App's Complexity Before Refactoring :  http://www.railsinside.com/tutorials/487-how-to-score-your-rails-apps-complexity-before-refactoring.html 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值