flog: March 2009 Archives

Flog reports the most tortured code in an easy to read pain report. The higher the score, the more pain the code is in.

Changes:

2.1.0 / 2009-03-16

  • 5 minor enhancements:

    • Added --group to aggregate and sort by class scores.
    • Added flog_task.rb
    • Made -q default, removed -n.
    • Made report output more readable and processable.
    • Moved option processing from bin/flog to lib/flog.rb for better testing.
  • 1 bug fix:

    • removed extra attr_readers for total and average. doh
  • http://ruby.sadi.st/

  • http://rubyforge.org/projects/seattlerb

I've got some flog readability enhancements coming in the next release of flog. Check it:

Old Way:

% flog -q lib
Total Flog = 1097.2 (17.4 flog / method)
FlogGauntlet#display_report: (202.1)
Flog#output_details: (85.3)
FlogGauntlet#score_for: (65.9)
Flog#process_iter: (61.9)
Flog#parse_options: (53.7)
Flog#flog: (41.2)
Flog#none: (36.5)
FlogGauntlet#group_by_owner: (27.7)
FlogGauntlet#report_bad_people: (26.8)
FlogTask#define: (24.0)
Flog#output_method_details: (23.2)
Flog#score_method: (22.1)

It works. I guess... But it sucks. Why? Because I can't quickly read the thing and I can't use UNIX tools on it easily. And -q not being the default just didn't make sense. The details were overkill until you were digging in and trying to clean stuff up. So that is enabled with --details and --quite is default.

New Way:

There are two ways to do it now:

Vanilla:

% flog lib
  1115.2: flog total
    17.7: flog/method average

   202.1: FlogGauntlet#display_report
    85.3: Flog#output_details
    65.9: FlogGauntlet#score_for
    61.9: Flog#process_iter
    53.7: Flog#parse_options
    41.2: Flog#flog
    36.5: Flog#none
    27.7: FlogGauntlet#group_by_owner
    26.8: FlogGauntlet#report_bad_people
    24.0: FlogTask#define
    23.2: Flog#output_method_details
    22.1: Flog#score_method

pretty, no?

With Grouping:

% flog -g lib
  1115.2: flog total
    17.7: flog/method average

   323.8: Flog total
    85.3: Flog#output_details
    61.9: Flog#process_iter
    53.7: Flog#parse_options
    41.2: Flog#flog
    36.5: Flog#none
    23.2: Flog#output_method_details
    22.1: Flog#score_method

   322.6: FlogGauntlet total
   202.1: FlogGauntlet#display_report
    65.9: FlogGauntlet#score_for
    27.7: FlogGauntlet#group_by_owner
    26.8: FlogGauntlet#report_bad_people

    24.0: FlogTask total
    24.0: FlogTask#define

About this Archive

This page is a archive of entries in the flog category from March 2009.

flog: January 2009 is the previous archive.

flog: April 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.32-en