rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

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

  def run_host(ip)
    traverse = "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\"
    filename = datastore['FILEPATH']

    res = send_request_raw({
Severity: Minor
Found in modules/auxiliary/scanner/http/manageengine_deviceexpert_traversal.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

                rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
Severity: Major
Found in modules/auxiliary/scanner/http/svn_scanner.rb - About 45 mins to fix

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

      def run_host(ip)
        res = scan
    
        return unless res && res.code == 200
    
    
    Severity: Minor
    Found in modules/auxiliary/scanner/http/chromecast_wifi.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

              for c in @charset_names
                @queue  <<(url +c)
              end
    Severity: Major
    Found in modules/auxiliary/scanner/http/iis_shortname_scanner.rb - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                        if srcres and srcres.body.length > 0
                          if datastore['SHOW_SOURCE']
                            print_status(srcres.body)
                          end
      
      
      Severity: Major
      Found in modules/auxiliary/scanner/http/svn_scanner.rb - About 45 mins to fix

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

          def run_host(ip)
        
        
            # Configure how deep we want to traverse
            depth  = (datastore['DEPTH'].nil? or datastore['DEPTH'] == 0) ? 10 : datastore['DEPTH']
        Severity: Minor
        Found in modules/auxiliary/scanner/tftp/netdecision_tftp.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

                        result.connection.close unless result.connection.nil?
        Severity: Major
        Found in modules/auxiliary/scanner/mysql/mysql_login.rb - About 45 mins to fix

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

            def parse_reply(pkt)
          
              return if not pkt[1]
          
              if(pkt[1] =~ /^::ffff:/)
          Severity: Minor
          Found in modules/auxiliary/scanner/vxworks/wdbrpc_bootline.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 parse_handshakes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def parse_handshakes(data)
              # Can contain multiple handshakes
              remaining_data = data
              handshakes = []
              handshake_count = 0
          Severity: Minor
          Found in modules/auxiliary/scanner/ssl/openssl_heartbleed.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 getadvertisement has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def getadvertisement
              pkt = capture.next
              Kernel.select(nil,nil,nil,0.1)
              return if not pkt
              p = PacketFu::Packet.parse(pkt)
          Severity: Minor
          Found in modules/auxiliary/scanner/discovery/ipv6_neighbor.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 run_host has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def run_host(ip)
              vprint_status("Login...") unless session
          
              # If we have a session make use of it
              if session
          Severity: Minor
          Found in modules/auxiliary/scanner/mysql/mysql_file_enum.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 tcp_malformed_options_detection has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def tcp_malformed_options_detection(sock, ip, port)
              pkt = PacketFu::TCPPacket.new(config: @config)
          
              # IP destination address
              pkt.ip_daddr = ip
          Severity: Minor
          Found in modules/auxiliary/scanner/vxworks/urgent11_check.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 run_host has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def run_host(ip)
              # If we have a session make use of it
              if session
                print_status("Using existing session #{session.sid}")
                self.mysql_conn = session.client
          Severity: Minor
          Found in modules/auxiliary/scanner/mysql/mysql_hashdump.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

                          rescue ::Timeout::Error, ::Errno::EPIPE
          Severity: Major
          Found in modules/auxiliary/scanner/http/svn_scanner.rb - About 45 mins to fix

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

              def tcp_dos_detection(sock, ip, port)
                pkt = PacketFu::TCPPacket.new(config: @config)
            
                # IP destination address
                pkt.ip_daddr = ip
            Severity: Minor
            Found in modules/auxiliary/scanner/vxworks/urgent11_check.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 start_session has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def start_session(obj, info, ds_merge, _crlf = false, _sock = nil, sess = nil)
            Severity: Minor
            Found in modules/auxiliary/scanner/winrm/winrm_login.rb - About 45 mins to fix

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

                def run_detections(ip, port)
                  print_status("#{ip}:#{port} being checked")
              
                  final_ipnet_score        = 0
                  final_vxworks_score      = 0
              Severity: Minor
              Found in modules/auxiliary/scanner/vxworks/urgent11_check.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 run_host has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def run_host(ip)
                  begin
                    connect
              
                    pkt = tns_packet("(CONNECT_DATA=(COMMAND=VERSION))")
              Severity: Minor
              Found in modules/auxiliary/scanner/oracle/tnslsnr_version.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 start_rsh_session has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def start_rsh_session(host, port, user, luser, proof, stderr_sock)
              Severity: Minor
              Found in modules/auxiliary/scanner/rservices/rsh_login.rb - About 45 mins to fix

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

                  def run_host(ip)
                    begin
                      connect
                      send_packet = tns_packet("(CONNECT_DATA=(COMMAND=service_register_NSGR))")
                      sock.put(send_packet)
                Severity: Minor
                Found in modules/auxiliary/scanner/oracle/tnspoison_checker.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