Skip to content
Browse files

Fixed whitespacing

[git-p4: depot-paths = "//src/flog/dev/": change = 8391]
  • Loading branch information...
1 parent 40e4982 commit 63a28a2b9b3c9fbadd34cb81a7f80016345a329f @zenspider zenspider committed
Showing with 6 additions and 3 deletions.
  1. +4 −1 lib/flog.rb
  2. +2 −2 test/test_flog.rb
View
5 lib/flog.rb
@@ -94,6 +94,7 @@ class Flog < SexpProcessor
attr_reader :calls, :option, :class_stack, :method_stack, :mass, :sclass
attr_reader :method_locations
attr_reader :methods, :scores
+
# :startdoc:
##
@@ -428,6 +429,7 @@ def output_details io, max = nil
##
# Calculates classes and methods scores.
+
def calculate
each_by_score threshold do |class_method, score, call_list|
klass = class_method.split(/#|::/).first
@@ -441,7 +443,7 @@ def calculate
# Output the report, grouped by class/module, up to a given max or
# report everything, if nil.
- def output_details_grouped io, threshold = nil
+ def output_details_grouped io, threshold = nil
calculate
scores.sort_by { |_, n| -n }.each do |klass, total|
@@ -488,6 +490,7 @@ def process_until_empty exp
##
# Final threshold that is used for report
+
def threshold
option[:all] ? nil : total * THRESHOLD
end
View
4 test/test_flog.rb
@@ -112,7 +112,7 @@ def test_flog
ensure
$stdin = old_stdin
end
-
+
def test_flog_ruby
ruby = "2 + 3"
file = "sample.rb"
@@ -755,7 +755,7 @@ def test_calculate
assert_equal({ 'MyKlass' => 42.0 }, @flog.scores)
assert_equal({ 'MyKlass' => [["MyKlass::Base#mymethod", 42.0]] }, @flog.methods)
end
-
+
def setup_my_klass
@flog.class_stack << "Base" << "MyKlass"
@flog.method_stack << "mymethod"

0 comments on commit 63a28a2

Please sign in to comment.
Something went wrong with that request. Please try again.