From 57176ba9a5088a08e8da82dd87b04fa7f4069a50 Mon Sep 17 00:00:00 2001 From: Kevin Rutherford Date: Mon, 15 Jun 2009 15:08:43 +0100 Subject: [PATCH] Report no longer used as a Collecting Parameter --- lib/reek/class_context.rb | 2 +- lib/reek/code_parser.rb | 3 +-- lib/reek/source.rb | 2 +- spec/reek/smells/long_method_spec.rb | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/reek/class_context.rb b/lib/reek/class_context.rb index 9074dc355..47910bb6c 100644 --- a/lib/reek/class_context.rb +++ b/lib/reek/class_context.rb @@ -17,7 +17,7 @@ def ClassContext.create(outer, exp) def ClassContext.from_s(src) source = Source.from_s(src) - CodeParser.new(nil, {}).process_class(source.generate_syntax_tree) + CodeParser.new({}).process_class(source.generate_syntax_tree) end def initialize(outer, name, superclass = nil) diff --git a/lib/reek/code_parser.rb b/lib/reek/code_parser.rb index 0599e5055..5d6f7c73c 100644 --- a/lib/reek/code_parser.rb +++ b/lib/reek/code_parser.rb @@ -29,8 +29,7 @@ class CodeParser # Creates a new Ruby code checker. Any smells discovered # will be stored in +report+. - def initialize(report, smells, ctx = StopContext.new) - @report = nil + def initialize(smells, ctx = StopContext.new) @smells = smells @element = ctx end diff --git a/lib/reek/source.rb b/lib/reek/source.rb index 28aa2fdbd..846170b65 100644 --- a/lib/reek/source.rb +++ b/lib/reek/source.rb @@ -77,7 +77,7 @@ def generate_syntax_tree def report unless @report detectors = @cf.smell_listeners - parser = CodeParser.new(nil, detectors) + parser = CodeParser.new(detectors) parser.process(generate_syntax_tree) @report = Report.new(detectors) end diff --git a/spec/reek/smells/long_method_spec.rb b/spec/reek/smells/long_method_spec.rb index 56b67697d..e74ac9228 100644 --- a/spec/reek/smells/long_method_spec.rb +++ b/spec/reek/smells/long_method_spec.rb @@ -9,7 +9,7 @@ def process_method(src) source = Source.from_s(src) - CodeParser.new(nil, {}).process_defn(source.generate_syntax_tree) + CodeParser.new({}).process_defn(source.generate_syntax_tree) end describe LongMethod do