<commit_before># frozen_string_literal: true

module CMSScanner
  # Generic Vulnerability
  class Vulnerability
    include References

    attr_reader :title, :type, :fixed_in, :cvss

    # @param [ String ] title
    # @param [ Hash ] references
    # @option references [ Array<String>, String ] cve
    # @option references [ Array<String>, String ] secunia
    # @option references [ Array<String>, String ] osvdb
    # @option references [ Array<String>, String ] exploitdb
    # @option references [ Array<String> ] url URL(s) to related advisories etc
    # @option references [ Array<String>, String ] metasploit The related metasploit module(s)
    # @param [ String ] type
    # @param [ String ] fixed_in
    # @param [ HashSymbol ] cvss
    # @option cvss [ String ] :score
    # @option cvss [ String ] :vector
    def initialize(title, references: {}, type: nil, fixed_in: nil, cvss: nil)
      @title    = title
      @type     = type
      @fixed_in = fixed_in
      @cvss     = cvss.nil? ? nil : { score: cvss[:score], vector: cvss[:vector] }

      self.references = references
    end

    # param [ Vulnerability ] other
    #
    # @return [ Boolean ]
    def ==(other)
      title == other.title &&
        type == other.type &&
        references == other.references &&
        fixed_in == other.fixed_in &&
        cvss == other.cvss
    end
  end
end
<commit_msg>Updates doc for Vulnerabilty model<commit_after># frozen_string_literal: true

module CMSScanner
  # Generic Vulnerability
  class Vulnerability
    include References

    attr_reader :title, :type, :fixed_in, :cvss

    # @param [ String ] title
    # @param [ Hash ] references
    # @option references [ Array<String>, String ] :cve
    # @option references [ Array<String>, String ] :secunia
    # @option references [ Array<String>, String ] :osvdb
    # @option references [ Array<String>, String ] :exploitdb
    # @option references [ Array<String> ] :url URL(s) to related advisories etc
    # @option references [ Array<String>, String ] :metasploit The related metasploit module(s)
    # @option references [ Array<String> ] :youtube
    # @param [ String ] type
    # @param [ String ] fixed_in
    # @param [ HashSymbol ] cvss
    # @option cvss [ String ] score
    # @option cvss [ String ] vector
    def initialize(title, references: {}, type: nil, fixed_in: nil, cvss: nil)
      @title    = title
      @type     = type
      @fixed_in = fixed_in
      @cvss     = cvss.nil? ? nil : { score: cvss[:score], vector: cvss[:vector] }

      self.references = references
    end

    # param [ Vulnerability ] other
    #
    # @return [ Boolean ]
    def ==(other)
      title == other.title &&
        type == other.type &&
        references == other.references &&
        fixed_in == other.fixed_in &&
        cvss == other.cvss
    end
  end
end

{'fraction_non_alphanumeric': 0.1159369527145359, 'fraction_numerical': 0.0, 'mean_word_length': 2.748031496062992, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '950069', 'n_tokens_mistral': 881, 'n_tokens_neox': 861, 'n_words': 252}