lib/reek/smells/duplication.rb in kevinrutherford-reek-1.1.3.7 vs lib/reek/smells/duplication.rb in kevinrutherford-reek-1.1.3.8
- old
+ new
@@ -27,22 +27,21 @@
def self.default_config
super.adopt(MAX_ALLOWED_CALLS_KEY => 1)
end
def initialize(config = Duplication.default_config)
- super
- @max_calls = config[MAX_ALLOWED_CALLS_KEY]
+ super(config)
end
def examine_context(method)
smelly_calls(method).each do |call|
found(method, "calls #{SexpFormatter.format(call)} multiple times")
end
end
def smelly_calls(method) # :nodoc:
method.calls.select do |key,val|
- val > @max_calls and key[2] != :new
+ val > @config[MAX_ALLOWED_CALLS_KEY] and key[2] != :new
end.map { |call_exp| call_exp[0] }
end
end
end
end