def result
      @task = 'brakeman'
      @path = discover_path

      return unless is_rails? && temp_config(@task) && path_exists?(@path)

      tmp = Tempfile.new('brakeman')
      quietly { `brakeman #{@path} -f json -o #{tmp.path} -q` }
      brakeman = tmp.read
      tmp.close
      tmp.unlink

      unless brakeman.blank?
        bjson = JSON.parse(brakeman)
        basics(bjson)
        brakeman = {}
        ['warnings', 'errors'].each do |type|
          new_brakeman = bjson[type].group_by { |s| s['file'] }
          new_brakeman.each do |file, errors|
            next unless file
            brakeman[file] = errors.map { |e| hash_for_brakeman(e, type) }
          end
        end
      end

      @output[:files_inspected] ||= files_inspected('rb', ' ')
      refine brakeman
    end
def result
      @task = 'brakeman'
      @path = discover_path

      return unless is_rails? && temp_config(@task) && path_exists?(@path)

      tmp = Tempfile.new('brakeman')
      quietly { `brakeman #{@path} -f json -o #{tmp.path} -q` }
      brakeman = tmp.read
      tmp.close
      tmp.unlink

      unless brakeman.blank?
        bjson = JSON.parse(brakeman)
        basics(bjson)
        brakeman = {}
        ['warnings', 'errors'].each do |type|
          new_brakeman = bjson[type].group_by { |s| s['file'] }
          new_brakeman.each do |file, errors|
            next unless file
            brakeman[file] = errors.map { |e| hash_for_brakeman(e, type) }
          end
        end
      end

      @output[:files_inspected] ||= files_inspected('rb', ' ')
      refine brakeman
    end
Brakeman (requires Rails)
 @see Lint#initialize