Permalink
Browse files

release of 0.7.5 and changed docs to explain new Flog and Saikuro fun…

…ctionality - you can now Flog/Saikuro custom directories
  • Loading branch information...
1 parent 020a112 commit d439433a74b2fa55f05823cbddd6158bf0de090b @jscruggs jscruggs committed Sep 12, 2008
Showing with 40 additions and 33 deletions.
  1. +5 −0 History.txt
  2. +34 −32 README
  3. +1 −1 metric_fu.gemspec
View
@@ -1,3 +1,8 @@
+=== MetricFu 0.7.5 / 2008-09-12
+
+* Flog can now flog any set of directories you like (see README).
+* Saikuro can now look at any set of directories you like (see README).
+
=== MetricFu 0.7.1 / 2008-09-12
* Fixed filename bugs pointed out by Bastien
View
66 README
@@ -1,4 +1,4 @@
-Version 0.7.1
+Version 0.7.5
http://github.com/jscruggs/metric_fu
Metric_fu began its life as a plugin for Rails that generated code metrics reports. As of version 0.7.0, metric_fu is a gem owing to the excellent work done by Sean Soper.
@@ -11,22 +11,35 @@ sudo gem install jscruggs-metric_fu -s http://gems.github.com
Then in your Rakefile:
require 'metric_fu'
+If you like to vendor gems, you can unpack metric_fu into vendor/gems and require it like so:
+require 'my_app/vendor/gems/jscruggs-metric_fu-0.7.1/lib/metric_fu'
+
+then you don't have to install it on every box you run it on.
+
+
*Important note:
-You must have Rcov and Flog installed to get coverage and flog reports. You can do this through ruby gems at the command line like so:
-sudo gem install rcov
-sudo gem install flog
+You must have Rcov and Flog installed to get coverage and flog reports. Metric_fu requires both of these gems so they will be installed when you install the metric_fu gem.
*Usage
Out of the box metrics provides these tasks:
-rake metrics:all
-rake metrics:all_with_migrate
-rake metrics:coverage
-rake metrics:saikuro
-rake metrics:flog
-rake metrics:stats
-rake metrics:churn
+rake metrics:all
+rake metrics:all_with_migrate # Useful for continuous integration
+rake metrics:churn # Which files change the most
+rake metrics:coverage # Generate and open coverage report
+rake metrics:coverage:clean # Delete aggregate coverage data.
+rake metrics:coverage:clobber_do # Remove rcov products for do
+rake metrics:coverage:do # RCov task to generate report
+rake metrics:flog:all # Generate and open flog report
+rake metrics:flog:clean # Delete aggregate flog data.
+rake metrics:flog:controllers # Flog code in app/controllers
+rake metrics:flog:custom # Generate a flog report from specified directories
+rake metrics:flog:helpers # Flog code in app/helpers
+rake metrics:flog:lib # Flog code in lib
+rake metrics:flog:models # Flog code in app/models
+rake metrics:saikuro # A cyclomatic complexity report using Saikuro
+rake metrics:stats # A stats report
See below for more detail on the individual tasks. It's recommended to use CruiseControl.rb to set up a metrics build. See the CruiseControl.rb online docs for more info on how to set up cc.rb and, once you've got that figured out, change the cruise_config.rb file inside your project to have these lines:
@@ -38,26 +51,10 @@ Which will check for updates every 24 hours and run all the metrics rake tasks (
*Notes on metrics:coverage
-When creating a coverage report, metric_fu runs all the tests in the test folder using Rcov. If you use RSpec you can change the default by putting this in your Rakefile:
-
-namespace :metrics do
- TEST_PATHS_FOR_RCOV = ['spec/**/*_spec.rb']
-end
-
-The namespace is only there for intentional purposes and isn't necessary. If you have multiple paths to test, then you can do this:
+When creating a coverage report, metric_fu runs all the tests in the test folder using Rcov. This task used to support RSpec, but currently that doesn't work. This will be fixed in the near future (claims Jake on 9/12/2008).
- TEST_PATHS_FOR_RCOV = ['spec/**/*_spec.rb', 'test/**/*_test.rb']
-The coverage task will iterate over all the paths and aggregate the results into one report. You'll see a coverage.data file in the root of your project.
-
-If you want to change the options that Rcov is run with, then set this constant in your Rakefile:
-
- RCOV_OPTIONS = { "--sort" => "loc" }
-
-It's a hash that gets merged with the default options. This particular change will sort the coverage report by lines of code (loc). Check out the Rcov documentation for more options. If you want to see the default options metric_fu runs, open up the rake files in the plugin.
-
-
-*Notes on metrics:cyclomatic_complexity
+*Notes on metrics:saikuro
Saikuro is bundled with metric_fu so you don't have to install it. Look at the SAIKURO_README (or the internet) for more documentation on Saikuro. If you wish to change the options Saikuro is run with, then set this constant in your Rakefile:
@@ -67,15 +64,20 @@ end
Like RCOV_OPTIONS, SAIKURO_OPTIONS is a hash that gets merged with the default options hash. The above example will set the warn_cyclo to 3 and the error_cyclo to 4 (which is way too low -- it's just an example) instructing Saikuro to flag methods with a higher cyclomatic complexity in it's report.
+If you want to have Saikuro look at multiple folders you can put something like this in you rakefile:
+SAIKURO_OPTIONS = {"--input_directory" => '"cms/app | cms/lib"'}
+
*Notes on metrics:flog
-Flog is another way of measuring complexity (or tortured code as the Flog authors like to put it). Metric_fu takes the output of Flog run on the 'app' folder, puts it in between some <pre> tags, calculates the average Flog score per method, and jams all that into an index.html file. You should check out the awesome, and a little scary, Flog website for more info.
+Flog is another way of measuring complexity (or tortured code as the Flog authors like to put it). You should check out the awesome, and a little scary, Flog website for more info.
+'rake metrics:flog:custom' allows you to specify a custom set of directories to Flog (in your rakefile) like so:
+MetricFu::DIRECTORIES_TO_FLOG = ['cms/app', 'cms/lib']
*Notes on metrics:stats
-This is just 'rake stats' put into a file. On my projects I like to be able to look at CruiseControl and get stats about the app at different points in time.
+This is just 'rake stats' for Rails put into a file. On my projects I like to be able to look at CruiseControl and get stats about the app at different points in time.
*Notes on metrics:churn
@@ -97,4 +99,4 @@ end
*Thanks
-I'd like to thank the authors of Saikuro, Flog, Rcov, CruiseControl.rb, and Rails for creating such excellent open source products. Also Michael Schubert, Kurtis Seebaldt, Toby Tripp, Paul Gross, and Chirdeep Shetty for their help and advice.
+I'd like to thank the authors of Saikuro, Flog, Rcov, CruiseControl.rb, and Rails for creating such excellent open source products. Also Sean Soper, Michael Schubert, Kurtis Seebaldt, Toby Tripp, Paul Gross, and Chirdeep Shetty for their help and advice.
View
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "metric_fu"
- s.version = "0.7.1"
+ s.version = "0.7.5"
s.date = "2008-09-12"
s.summary = "Generates project metrics using Flog, RCov, Saikuro and more"
s.email = "jake.scruggs@gmail.com"

0 comments on commit d439433

Please sign in to comment.