Class: Quality::Tools::Brakeman

Inherits:
Tool
  • Object
show all
Defined in:
lib/quality/tools/brakeman.rb

Overview

Adds ‘rubocop’ tool support to quality gem

Instance Method Summary collapse

Methods inherited from Tool

#initialize

Constructor Details

This class inherits a constructor from Quality::Tools::Tool

Instance Method Details

#quality_brakemanObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/quality/tools/brakeman.rb', line 7

def quality_brakeman
  ratchet_quality_cmd('brakeman',
                      args: '-q --summary -f csv 2>/dev/null',
                      gives_error_code_on_no_relevant_code:
                        true) do |line|
    if line =~ /Security Warnings,([0-9]*) \([0-9]*\)$/
      Regexp.last_match[1].to_i
    else
      0
    end
  end
end