This project is archived and is in readonly mode.
Better Precision on rake:stats
Reported by Brian Cardarella | November 12th, 2008 @ 04:43 PM | in 2.x
Why not increase the precision so we have a more useful test:code metric?
code_statistics.rb
104c104
< puts " Code LOC: #{code} Test LOC: #{tests} Code to Test Ratio: 1:#{sprintf("%.1f", tests.to_f/code)}"
puts " Code LOC: #{code} Test LOC: #{tests} Code to Test Ratio: 1:#{sprintf("%.3f", tests.to_f/code)}"
Is there a good reason to keep the precision so low? The metric becomes somewhat useless in a larger app because of Ruby's floating point rounding.
Comments and changes to this ticket
-
Brian Cardarella November 12th, 2008 @ 04:49 PM
Well that looked horrible. :p Attaching the diff as an attachment and learning my lesson on pasting directly.
-
Pratik March 7th, 2009 @ 03:31 PM
- Tag set to patch
- State changed from new to wontfix
I think .1f is just fine :) Not sure it's helpful to show 3 precisions.
Thanks !
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>