Class: Semgrep::Changes::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/semgrep/changes/check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, analysis, patch) ⇒ Check

Returns a new instance of Check.



6
7
8
9
10
# File 'lib/semgrep/changes/check.rb', line 6

def initialize(path, analysis, patch)
  @path = path
  @analysis = analysis
  @patch = patch
end

Instance Attribute Details

#analysisObject (readonly)

Returns the value of attribute analysis.



18
19
20
# File 'lib/semgrep/changes/check.rb', line 18

def analysis
  @analysis
end

#patchObject (readonly)

Returns the value of attribute patch.



18
19
20
# File 'lib/semgrep/changes/check.rb', line 18

def patch
  @patch
end

#pathObject (readonly)

Returns the value of attribute path.



18
19
20
# File 'lib/semgrep/changes/check.rb', line 18

def path
  @path
end

Instance Method Details

#offensesObject



12
13
14
15
16
# File 'lib/semgrep/changes/check.rb', line 12

def offenses
  analysis.select do |offense|
    line_numbers.include?(line(offense))
  end
end