Skip to content

Commit

Permalink
Sort Flog by highest score in the class which I feel is more importan…
Browse files Browse the repository at this point in the history
…t than the total flog flog score
  • Loading branch information
jscruggs committed Jul 8, 2009
1 parent b5b4d99 commit 11fb9d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/generators/flog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def analyze
def to_h
number_of_methods = @pages.inject(0) {|count, page| count += page.scanned_methods.size}
total_flog_score = @pages.inject(0) {|total, page| total += page.score}
sorted_pages = @pages.sort_by {|page| page.score }.reverse
sorted_pages = @pages.sort_by {|page| page.highest_score }.reverse
{:flog => { :total => total_flog_score,
:average => average_score(total_flog_score, number_of_methods),
:pages => sorted_pages.map {|page| page.to_h}}}
Expand Down

0 comments on commit 11fb9d6

Please sign in to comment.