Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Better Precision on rake:stats

#1362

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.

Reported by Brian Cardarella · November 12th, 2008 @ 04:43 PM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Brian Cardarella
    Brian Cardarella

    Well that looked horrible. :p Attaching the diff as an attachment and learning my lesson on pasting directly.

    November 12th, 2008 @ 04:49 PM

  2. Pratik
    Pratik
    • 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 !

    March 7th, 2009 @ 03:31 PM