Class: CC::Analyzer::Issue

Inherits:
Object
  • Object
show all
Defined in:
lib/cc/analyzer/issue.rb

Constant Summary collapse

SPEC_ISSUE_ATTRIBUTES =
%w[
  categories
  check_name
  content
  description
  location
  other_locations
  remediation_points
  severity
  type
]

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ Issue

Returns a new instance of Issue.



16
17
18
# File 'lib/cc/analyzer/issue.rb', line 16

def initialize(output)
  @output = output
end

Instance Method Details

#as_jsonObject



20
21
22
23
24
# File 'lib/cc/analyzer/issue.rb', line 20

def as_json(*)
  parsed_output.reverse_merge!(
    "fingerprint" => fingerprint,
  )
end

#fingerprintObject



26
27
28
# File 'lib/cc/analyzer/issue.rb', line 26

def fingerprint
  parsed_output.fetch("fingerprint") { default_fingerprint }
end

#pathObject



37
38
39
# File 'lib/cc/analyzer/issue.rb', line 37

def path
  parsed_output.fetch("location", {}).fetch("path", "")
end