class ScriptCheck

def run

def run
  @html.css('script').each do |s|
    script = ScriptCheckable.new s, self
    next if script.ignore?
    next unless script.blank?
    # does the script exist?
    if script.missing_src?
      add_issue('script is empty and has no src attribute', s.line)
    elsif script.remote?
      add_to_external_urls script.src
    else
      add_issue("internal script #{script.src} does not exist", s.line) unless script.exists?
    end
  end
  external_urls
end