Sha256: 28585710d2ca44da4a9232759a84129e4afabda6785cda3edec127c8ff7c0aec

Contents?: true

Size: 477 Bytes

Versions: 18

Compression:

Stored size: 477 Bytes

Contents

module CC::Service::VulnerabilityHelper
  def vulnerability
    vulnerabilities.first || {}
  end

  def vulnerabilities
    payload.fetch("vulnerabilities", [])
  end

  def multiple?
    vulnerabilities.size > 1
  end

  def location_info
    if vulnerability["location"]
      " in #{vulnerability["location"]}"
    else
      ""
    end
  end

  def warning_type
    if multiple?
      payload["warning_type"]
    else
      vulnerability["warning_type"]
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
codeclimate-services-1.11.4 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.11.3 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.11.2 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.11.1 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.11.0 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.10.1 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.10.0 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.9.8 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.9.7 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.9.6 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.9.5 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.9.4 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.9.3 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.9.2 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.9.1 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.9.0 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.8.0 lib/cc/helpers/vulnerability_helper.rb
codeclimate-services-1.7.0 lib/cc/helpers/vulnerability_helper.rb