lib/fasterer/scanners/method_call_scanner.rb in fasterer-0.2.0 vs lib/fasterer/scanners/method_call_scanner.rb in fasterer-0.2.1
- old
+ new
@@ -48,22 +48,20 @@
def check_module_eval_offense
first_argument = method_call.arguments.first
return unless first_argument && first_argument.value.is_a?(String)
- if first_argument.value.include?("def")
- add_offense(:module_eval)
- end
+ add_offense(:module_eval) if first_argument.value.include?('def')
end
def check_gsub_offense
first_argument = method_call.arguments[0]
second_argument = method_call.arguments[1]
return if first_argument.nil? || second_argument.nil?
if first_argument.value.is_a?(String) && first_argument.value.size == 1 &&
- second_argument.value.is_a?(String) && second_argument.value.size == 1
+ second_argument.value.is_a?(String) && second_argument.value.size == 1
add_offense(:gsub_vs_tr)
end
end