def scan(text, filename='(none)')
      warnings = scan_for_file_warnings(text, filename)
      text = filter_fixable(warnings).inject(text) do |text, warning|
        warning.fix(text)
      end
      with_fixing_piped_to_output do
        text.split(/\n/).each_with_index do |line, number|
          warnings.concat process_line(line, number + 1, filename)
        end
      end
      warnings += unused_method_warnings
      warnings
    end
def scan(text, filename='(none)')
      warnings = scan_for_file_warnings(text, filename)
      text = filter_fixable(warnings).inject(text) do |text, warning|
        warning.fix(text)
      end
      with_fixing_piped_to_output do
        text.split(/\n/).each_with_index do |line, number|
          warnings.concat process_line(line, number + 1, filename)
        end
      end
      warnings += unused_method_warnings
      warnings
    end
Scans the text for warnings.

 @param [String] text the input ruby file to scan
 @return [Array[Laser::Warnings]] the warnings generated by the code.
   If the code is clean, an empty array is returned.