rapid7/metasploit-framework

View on GitHub

Showing 14,186 of 19,939 total issues

Method parse_index_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def parse_index_list(index_record, index_allocation_attribute)
        offset_index_entry_list = index_record[0, 4].unpack('V')[0]
        index_size =  index_record[offset_index_entry_list + 8, 2].unpack('v')[0]
        index_size_in_bytes = index_size * @bytes_per_cluster
        index_entry = index_record[offset_index_entry_list, index_size]
Severity: Minor
Found in lib/rex/parser/fs/ntfs.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method start_element has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def start_element(name=nil,attrs=[])
      attrs = normalize_attrs(attrs)
      block = @block

      r = { :e => name }
Severity: Minor
Found in lib/rex/parser/ci_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method from_xml_attributes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def self.from_xml_attributes(xml_attrs)
            id = xml_attrs['id']
            raise Error::InvalidAttributeError.new('key', 'id') if id.nil?

            name = xml_attrs['attr.name']
Severity: Minor
Found in lib/rex/parser/graphml.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method record_updatedata has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def record_updatedata(attrs)
      return unless in_tag("SecScan")
      return unless in_tag("Check")
      return unless in_tag("Detail")
      update_attrs = attr_hash(attrs)
Severity: Minor
Found in lib/rex/parser/mbsa_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method collect_updatedata has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def collect_updatedata
      return unless in_tag("SecScan")
      return unless in_tag("Check")
      return unless in_tag("Detail")
      collect_missing_update
Severity: Minor
Found in lib/rex/parser/mbsa_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method collect_missing_update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def collect_missing_update
      return unless @state[:check_state]["ID"] == 500.to_s
      return if @state[:update]["IsInstalled"] == "true"
      @report_data[:missing_updates] ||= []
      this_update = {}
Severity: Minor
Found in lib/rex/parser/mbsa_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method end_element has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def end_element(name=nil)
      block = @block
      case name
      when "Issue" # Wrap it up
        record_issue
Severity: Minor
Found in lib/rex/parser/appscan_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method record_service has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def record_service(attrs)
      return unless in_tag("nodes")
      return unless in_tag("node")
      return unless in_tag("endpoint")
      @state[:service] = attr_hash(attrs)
Severity: Minor
Found in lib/rex/parser/nexpose_raw_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method end_document has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def end_document
      block = @block
      return unless @report_type_ok
      unless @state[:current_tag].empty?
        missing_ends = @state[:current_tag].keys.map {|x| "'#{x}'"}.join(", ")
Severity: Minor
Found in lib/rex/parser/nokogiri_doc_mixin.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method collect_vuln_info has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def collect_vuln_info
      return unless in_tag("VulnerabilityDefinitions")
      return unless in_tag("vulnerability")
      return unless @state[:vuln]
      vuln = @state[:vuln]
Severity: Minor
Found in lib/rex/parser/nexpose_raw_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method short_arg_from_long_arg has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def short_arg_from_long_arg(long_arg)
        fmt_option = fmt.find { |key, value| value if key.include?(long_arg) }.first
        # if fmt_option == [long_arg] that means that a short flag option for it does not exist
        return if fmt_option.nil? || fmt_option == [long_arg]

Severity: Minor
Found in lib/rex/parser/arguments.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method extract_autologon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def self.extract_autologon(auto_logon)
    return [] if auto_logon.nil?

    domain    = auto_logon.elements['Domain'].get_text.value rescue ''
    username  = auto_logon.elements['Username'].get_text.value rescue ''
Severity: Minor
Found in lib/rex/parser/unattend.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method record_host_script has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def record_host_script(attrs)
      return unless in_tag("host")
      return if in_tag("port")
      temp_hash = attr_hash(attrs)

Severity: Minor
Found in lib/rex/parser/nmap_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method is_valid_bus? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def is_valid_bus?(bus)
    valid = false
    get_supported_buses if buses.nil?
    unless bus.blank?
      self.buses.each do |b|
Severity: Minor
Found in lib/rex/post/hwbridge/extensions/automotive/automotive.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method read has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def read(length = nil)
          if closed?
            raise IOError, 'Channel has been closed.', caller
          end

Severity: Minor
Found in lib/rex/post/channel/stream_abstraction.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method in_issue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def in_issue
      return false unless in_tag("Issue")
      return false unless in_tag("Issues")
      return false unless in_tag("XmlReport")
      return true
Severity: Minor
Found in lib/rex/parser/appscan_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method collect_status has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def collect_status
      return unless in_item
      return unless has_text
      return unless @text.to_i.to_s == @text
      @state[:status] = @text.to_i
Severity: Minor
Found in lib/rex/parser/burp_session_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method record_host_osclass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def record_host_osclass(attrs)
      return unless in_tag("host")
      return unless in_tag("os")
      @state[:os] ||= {}
      temp_hash = attr_hash(attrs)
Severity: Minor
Found in lib/rex/parser/nmap_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method report_vuln has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def report_vuln
        return unless @state[:service_object]
        return unless @state[:vuln_name]
        return unless @state[:issue_detail]
        vuln_info = {workspace: @args[:workspace]}
Severity: Minor
Found in lib/rex/parser/burp_issue_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method collect_risk has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def collect_risk
      return unless in_tag("VulnsFound")
      return unless in_tag("HostData")
      return unless in_tag("Host")
      risk = @text.to_s.to_i
Severity: Minor
Found in lib/rex/parser/foundstone_document.rb - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language