Class: Gitlab::Ci::Reports::Security::Locations::SecretDetection

Inherits:
Base
  • Object
show all
Includes:
Concerns::FingerprintPathFromFile
Defined in:
lib/gitlab/ci/reports/security/locations/secret_detection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concerns::FingerprintPathFromFile

#fingerprint_path

Methods inherited from Base

#==, #as_json, #fingerprint, #fingerprint_path

Constructor Details

#initialize(file_path:, start_line:, end_line: nil, class_name: nil, method_name: nil) ⇒ SecretDetection

Returns a new instance of SecretDetection.



17
18
19
20
21
22
23
# File 'lib/gitlab/ci/reports/security/locations/secret_detection.rb', line 17

def initialize(file_path:, start_line:, end_line: nil, class_name: nil, method_name: nil)
  @class_name = class_name
  @end_line = end_line
  @file_path = file_path
  @method_name = method_name
  @start_line = start_line
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



11
12
13
# File 'lib/gitlab/ci/reports/security/locations/secret_detection.rb', line 11

def class_name
  @class_name
end

#end_lineObject (readonly)

Returns the value of attribute end_line.



12
13
14
# File 'lib/gitlab/ci/reports/security/locations/secret_detection.rb', line 12

def end_line
  @end_line
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



13
14
15
# File 'lib/gitlab/ci/reports/security/locations/secret_detection.rb', line 13

def file_path
  @file_path
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



14
15
16
# File 'lib/gitlab/ci/reports/security/locations/secret_detection.rb', line 14

def method_name
  @method_name
end

#start_lineObject (readonly)

Returns the value of attribute start_line.



15
16
17
# File 'lib/gitlab/ci/reports/security/locations/secret_detection.rb', line 15

def start_line
  @start_line
end

Instance Method Details

#fingerprint_dataObject



25
26
27
# File 'lib/gitlab/ci/reports/security/locations/secret_detection.rb', line 25

def fingerprint_data
  "#{file_path}:#{start_line}:#{end_line}"
end