rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Method vmk_from_recovery_password has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def vmk_from_recovery_password(recoverykey)
        recovery_keys_stretched = recovery_key_transformation(recoverykey)
        vmk_encrypted_in_recovery_password_list =  @vmk_entries_hash[
                                                   PROTECTION_RECOVERY_PASSWORD]
        vmk_recovery_password = ''
Severity: Minor
Found in lib/rex/parser/fs/bitlocker.rb - About 45 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_entity has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def collect_entity(attrs)
      return unless in_issue
      return unless @state[:issue].kind_of? Hash
      ent_hash = attr_hash(attrs)
      return unless ent_hash
Severity: Minor
Found in lib/rex/parser/appscan_document.rb - About 45 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 characters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def characters(string)
          element = @stack[-1]
          case element
          when Element::Data
            parent = @stack[-2]
Severity: Minor
Found in lib/rex/parser/graphml.rb - About 45 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

Avoid deeply nested control flow statements.
Open

      @state[:ref] = @text.strip if @text
Severity: Major
Found in lib/rex/parser/outpost24_document.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                @state[:ref_dfn] = [] if @state[:ref_dfn].nil?
    Severity: Major
    Found in lib/rex/parser/openvas_document.rb - About 45 mins to fix

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

              def end_element(name)
                element = @stack.pop
      
                populate_element_default_attributes(element) if element.is_a? AttributeContainer
      
      
      Severity: Minor
      Found in lib/rex/parser/graphml.rb - About 45 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_fingerprint has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def report_fingerprint(host_object)
            return unless host_object.kind_of? ::Mdm::Host
            return unless @report_data[:os].kind_of? Hash
            note = {
              :workspace => host_object.workspace,
      Severity: Minor
      Found in lib/rex/parser/nexpose_raw_document.rb - About 45 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_fingerprint has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def record_service_fingerprint(attrs)
            return unless in_tag("nodes")
            return unless in_tag("node")
            return unless in_tag("service")
            return unless in_tag("fingerprint")
      Severity: Minor
      Found in lib/rex/parser/nexpose_raw_document.rb - About 45 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 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def record_host(attrs)
            return unless in_tag("nodes")
            host_attrs = attr_hash(attrs)
            if host_attrs["status"] == "alive"
              @state[:host_is_alive] = true
      Severity: Minor
      Found in lib/rex/parser/nexpose_raw_document.rb - About 45 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

      Avoid deeply nested control flow statements.
      Open

                  @state[:ref_cb] = [] if @state[:ref_cb].nil?
      Severity: Major
      Found in lib/rex/parser/openvas_document.rb - About 45 mins to fix

        Method fve_entries has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def fve_entries(metadata_entries)
                offset_entry = 0
                entry_size = metadata_entries[0, 2].unpack('v')[0]
                result = Hash.new({})
                while entry_size != 0
        Severity: Minor
        Found in lib/rex/parser/fs/bitlocker.rb - About 45 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_protocol has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def collect_protocol
              return unless in_tag("Service")
              return unless in_tag("ServicesFound")
              return unless in_tag("Host")
              return if @text.nil? || @text.empty?
        Severity: Minor
        Found in lib/rex/parser/foundstone_document.rb - About 45 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_port has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def collect_port
              return unless in_tag("Service")
              return unless in_tag("ServicesFound")
              return unless in_tag("Host")
              return if @text.nil? || @text.empty?
        Severity: Minor
        Found in lib/rex/parser/foundstone_document.rb - About 45 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 get_command_id has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def self.get_command_id(name)
            name = name.downcase
        
            return nil unless name.include?('_')
        
        
        Severity: Minor
        Found in lib/rex/post/meterpreter/command_mapper.rb - About 45 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 cmd_cansend has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def cmd_cansend(*args)
            bus = ''
            id = ''
            data = ''
            cansend_opts = Rex::Parser::Arguments.new(
        Severity: Minor
        Found in lib/rex/post/hwbridge/ui/console/command_dispatcher/automotive.rb - About 45 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_web_service_info has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def report_web_service_info
                return unless @state[:host]
                return unless @state[:port]
                return unless @state[:proto]
                return unless @state[:service_name]
        Severity: Minor
        Found in lib/rex/parser/burp_issue_document.rb - About 45 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 get_commands has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def self.get_commands(*extensions)
            extensions = ['core'] + Rex::Post::Meterpreter::ExtensionMapper.get_extension_names if extensions.empty?
        
            commands = {}
            extensions.each do |mod_name|
        Severity: Minor
        Found in lib/rex/post/meterpreter/command_mapper.rb - About 45 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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def initialize(type, value = nil, compress=false)
            @type     = type
            @compress = compress
        
            if (value != nil)
        Severity: Minor
        Found in lib/rex/post/meterpreter/packet.rb - About 45 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 cmd_run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def cmd_run(*args)
            if args.length.zero?
              cmd_run_help
              return true
            end
        Severity: Minor
        Found in lib/rex/post/hwbridge/ui/console/command_dispatcher/core.rb - About 45 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 cmd_cat has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def cmd_cat(*args)
            if (args.length == 0)
              print_line("Usage: cat file")
              return true
            end
        Severity: Minor
        Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb - About 45 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