Class: Gitlab::Ci::Reports::Security::Scanner
- Inherits:
-
Object
- Object
- Gitlab::Ci::Reports::Security::Scanner
- Defined in:
- lib/gitlab/ci/reports/security/scanner.rb
Constant Summary collapse
- ANALYZER_ORDER =
{ "bundler_audit" => 1, "retire.js" => 2, "gemnasium" => 3, "gemnasium-maven" => 3, "gemnasium-python" => 3, "bandit" => 1, "spotbugs" => 1, "semgrep" => 2 }.freeze
Instance Attribute Summary collapse
-
#external_id ⇒ Object
(also: #key)
Returns the value of attribute external_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#primary_identifiers ⇒ Object
Returns the value of attribute primary_identifiers.
-
#vendor ⇒ Object
Returns the value of attribute vendor.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(external_id:, name:, vendor:, version:, primary_identifiers: nil) ⇒ Scanner
constructor
A new instance of Scanner.
- #to_hash ⇒ Object
Constructor Details
#initialize(external_id:, name:, vendor:, version:, primary_identifiers: nil) ⇒ Scanner
Returns a new instance of Scanner.
23 24 25 26 27 28 29 |
# File 'lib/gitlab/ci/reports/security/scanner.rb', line 23 def initialize(external_id:, name:, vendor:, version:, primary_identifiers: nil) @external_id = external_id @name = name @vendor = vendor @version = version @primary_identifiers = primary_identifiers end |
Instance Attribute Details
#external_id ⇒ Object Also known as: key
Returns the value of attribute external_id.
19 20 21 |
# File 'lib/gitlab/ci/reports/security/scanner.rb', line 19 def external_id @external_id end |
#name ⇒ Object
Returns the value of attribute name.
19 20 21 |
# File 'lib/gitlab/ci/reports/security/scanner.rb', line 19 def name @name end |
#primary_identifiers ⇒ Object
Returns the value of attribute primary_identifiers.
19 20 21 |
# File 'lib/gitlab/ci/reports/security/scanner.rb', line 19 def primary_identifiers @primary_identifiers end |
#vendor ⇒ Object
Returns the value of attribute vendor.
19 20 21 |
# File 'lib/gitlab/ci/reports/security/scanner.rb', line 19 def vendor @vendor end |
#version ⇒ Object
Returns the value of attribute version.
19 20 21 |
# File 'lib/gitlab/ci/reports/security/scanner.rb', line 19 def version @version end |
Instance Method Details
#<=>(other) ⇒ Object
43 44 45 |
# File 'lib/gitlab/ci/reports/security/scanner.rb', line 43 def <=>(other) sort_keys.compact <=> other.sort_keys.compact end |
#==(other) ⇒ Object
39 40 41 |
# File 'lib/gitlab/ci/reports/security/scanner.rb', line 39 def ==(other) other.external_id == external_id end |
#to_hash ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/gitlab/ci/reports/security/scanner.rb', line 31 def to_hash { external_id: external_id.to_s, name: name.to_s, vendor: vendor.presence }.compact end |