# frozen_string_literal: true

module Types
  module VulnerabilityLocation
    # rubocop: disable Graphql/AuthorizeTypes
    class SecretDetectionType < BaseObject
      graphql_name 'VulnerabilityLocationSecretDetection'
      description 'Represents the location of a vulnerability found by a secret detection scan'

      field :vulnerable_class, GraphQL::STRING_TYPE, null: true,
            description: 'Class containing the vulnerability',
            hash_key: :class

      field :end_line, GraphQL::STRING_TYPE, null: true,
            description: 'Number of the last relevant line in the vulnerable file'

      field :file, GraphQL::STRING_TYPE, null: true,
            description: 'Path to the vulnerable file'

      field :vulnerable_method, GraphQL::STRING_TYPE, null: true,
            description: 'Method containing the vulnerability',
            hash_key: :method

      field :start_line, GraphQL::STRING_TYPE, null: true,
            description: 'Number of the first relevant line in the vulnerable file'
    end
  end
end
