Permalink
Browse files

Tagging the 0.6.0 release

git-svn-id: svn+ssh://rubyforge.org/var/svn/metric-fu@15 4597c40d-3cec-48d9-97c4-7f736bdd9cc0
  • Loading branch information...
1 parent 46935bc commit ccc79d409c3ee94ca8f1f8729fa44b56ac653dfa @jscruggs jscruggs committed May 12, 2008
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,204 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>metric_fu: A Rails Plugin for Easy Metric Report Generation</title>
+<meta name="keywords" content="metric_fu rails metrics saikuro flog cyclomatic complexity rcov coverage" />
+<meta name="description" content="Rails Plugin for Easy Metric Report Generation" />
+<link href="styles.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="main">
+<!-- header begins -->
+<div id="header">
+
+ <div id="logo"><a href="#">metric_fu</a></div>
+ <div id="buttons">
+ <ul><li>A Rails Plugin for Easy Metric Report Generation</li></ul>
+ </div>
+
+</div>
+<!-- header ends -->
+<!-- content begins -->
+<div id="content">
+<div id="right">
+ <div id="sidebar">
+ <ul>
+ <li>
+ <h2>Links</h2>
+ <ul>
+ <li><a href="http://rubyforge.org/projects/metric-fu/">
+ Summary
+ </a>
+ </li>
+ <li><a href="http://rubyforge.org/forum/?group_id=6142">
+ Forums
+ </a>
+ </li>
+ <li><a href="http://rubyforge.org/tracker/?group_id=6142">
+ Tracker
+ </a>
+ </li>
+ <li><a href="http://rubyforge.org/scm/?group_id=6142">
+ SCM
+ </a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <!-- end #sidebar -->
+ </div>
+<div id="left">
+ <h1>About metric_fu</h1>
+ <div>
+<p><br/>
+ Metric_fu is a set of rake tasks that make it easy to generate metrics reports. It uses <a href="http://saikuro.rubyforge.org/">Saikuro</a>, <a href="http://ruby.sadi.st/Flog.html">Flog</a>, <a href="http://eigenclass.org/hiki.rb?rcov">Rcov</a>, and <a href="http://www.rubyonrails.org/">Rails</a> built-in stats task to create a series of reports. It's designed to integrate easily with <a href="http://cruisecontrolrb.thoughtworks.com/">CruiseControl.rb</a> by placing files in the Custom Build Artifacts folder.
+</p>
+<p><br/>
+ <h2>Output:</h2>
+ <a href="cyclomatic.gif">
+ <img width="225" height="102" src="cyclomatic.gif"
+ alt="cyclomatic"/>
+ </a>
+ <a href="flog.gif">
+ <img width="104" height="121" src="flog.gif"
+ alt="flog"/>
+ </a>
+ <br/>
+ <a href="rcov.gif">
+ <img width="322" height="100" src="rcov.gif"
+ alt="rcov"/>
+ </a>
+ <a href="stats.gif">
+ <img width="322" height="100" src="stats.gif"
+ alt="stats"/>
+ </a>
+ <a href="churn.gif">
+ <img width="322" height="118" src="churn.gif"
+ alt="stats"/>
+ </a>
+ <h2>Installation:</h2>
+ 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 (the first line needs to be executed in base folder of your Rails project):
+ <br/><br/>
+ <pre>ruby script/plugin install http://metric-fu.rubyforge.org/svn/tags/REL_0_5_1/metric_fu/</pre>
+ <pre>sudo gem install rcov</pre>
+ <pre>sudo gem install flog</pre>
+ </ul>
+</p>
+<p><br/>
+ <h2>Usage:</h2>
+ Out of the box metric_fu provides these tasks:
+ <ul>
+ <li>rake metrics:all</li>
+ <li>rake metrics:all_with_migrate</li>
+ <li>rake metrics:coverage</li>
+ <li>rake metrics:cyclomatic_complexity</li>
+ <li>rake metrics:flog</li>
+ <li>rake metrics:stats</li>
+ <li>rake metrics:churn</li>
+ </ul>
+ <br/>
+ See below for more detail on the individual tasks. I recommend using 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:
+<br/><br/>
+ <pre>project.rake_task = 'metrics:all_with_migrate'</pre>
+ <pre>project.scheduler.polling_interval = 24.hours</pre>
+<br/>
+ Which will check for updates every 24 hours and run all the metric_fu rake tasks (migrating your test db first). The output will be visible from an individual build's detail page. Like so:
+</p>
+<br/>
+<a href="cruise_control_1.gif">
+ <img width="285" height="161" src="cruise_control_1.gif"
+ alt="cruise_control"/>
+</a>
+<p><br/>
+ <h2>Notes on metrics:coverage</h2>
+ 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:
+ <br/><br/>
+<pre>
+namespace :metrics do
+ TEST_PATHS_FOR_RCOV = ['spec/**/*_spec.rb']
+end
+</pre><br/>
+ The namespace is only there for intentional purposes and isn't necessary. If you have multiple paths to test, then you can do this:
+<br/><br/>
+ <pre>TEST_PATHS_FOR_RCOV = ['spec/**/*_spec.rb', 'test/**/*_test.rb']</pre>
+ <br/>
+
+ 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.
+<br/>
+ If you want to change the options that Rcov is run with, then set this constant in your Rakefile:
+<br/><br/>
+ <pre>RCOV_OPTIONS = { "--sort" => "loc" }</pre>
+<br/>
+ 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 metrics.rake file in the plugin.
+</p>
+<p><br/>
+ <h2>Notes on metrics:cyclomatic_complexity</h2>
+ 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:
+<br/><br/>
+<pre>
+ namespace :metrics do
+ SAIKURO_OPTIONS = { "--warn_cyclo" => "3", "--error_cyclo" => "4" }
+ end
+</pre>
+<br/>
+ 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.
+</p>
+<p><br/>
+ <h2>Notes on metrics:flog</h2>
+ 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 &lt;pre&gt; tags, calculates the <a href="flog2.gif">average Flog score per method</a>, and jams all that into an index.html file. You should check out the awesome, and a little scary, <a href="http://ruby.sadi.st/Flog.html">Flog website</a> for more info.
+</p>
+<p><br/>
+ <h2>Notes on metrics:stats</h2>
+ 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.
+</p>
+<p><br/>
+ <h2>Notes on metrics:churn</h2>
+ Files that change a lot in your project may be bad a sign. This task uses "svn log" to identify those files and put them in a report. The default is to start counting changes from the beginning of your project, which might be too far back so you can change like so:
+<br/><br/>
+<pre>
+ namespace :metrics do
+ CHURN_OPTIONS = { :start_date => lambda{3.months.ago} }
+ end
+</pre>
+<br/>
+ The Proc is there because '3.months.ago' only works when after the Rails Environment is loaded (and Rails extends Fixnum) which I didn't want to do every time you run a rake task.
+<br/>
+ You can also change the minimum churn count like so:
+<br/>
+<br/>
+<pre>
+ namespace :metrics do
+ CHURN_OPTIONS = { :minimum_churn_count => 3 }
+ end
+</pre>
+</p>
+<p><br/>
+ <h2>Thanks</h2>
+ I'd like to thank the authors of Saikuro, Flog, Rcov, CruiseControl.rb, and Rails for creating such excellent open source products. Also many thanks go to <a href="http://schubert.cx/">Michael Schubert</a>, <a href="http://kseebaldt.blogspot.com/">Kurtis Seebaldt</a>, <a href="http://www.workingwithrails.com/person/11263-toby-tripp">Toby Tripp</a>, <a href="http://www.aliaghareza.com">Ali Aghareza</a>, <a href="http://www.pgrs.net/">Paul Gross</a>, and <a href="http://chirdeepshetty.net/">Chirdeep Shetty</a> for their help and advice.
+</p>
+ </div>
+
+ </div>
+
+</div>
+</div>
+<!-- content ends -->
+<!-- footer begins -->
+<div id="metamorph2"><div id="footer">
+ <p>Copyright &copy; 2008. Designed by <a href="http://www.metamorphozis.com/" title="Free Web Templates">Free Web Templates</a></p>
+ </div></div>
+<!-- footer ends -->
+
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+var pageTracker = _gat._getTracker("UA-1908573-3");
+pageTracker._initData();
+pageTracker._trackPageview();
+</script>
+</body>
+</html>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit ccc79d4

Please sign in to comment.