rapid7/metasploit-framework

View on GitHub

Showing 15,831 of 21,886 total issues

Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def initialize(host, port = 80, context = {}, ssl = nil, ssl_version = nil, proxies = nil, username = '', password = '', kerberos_authenticator: nil, comm: nil, subscriber: nil)
Severity: Major
Found in lib/rex/proto/http/client.rb - About 1 hr to fix

    Method map_port has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def map_port(udp_sock, host, port, int_port, ext_port, protocol, lifetime, timeout=1)
    Severity: Major
    Found in lib/rex/proto/natpmp/packet.rb - About 1 hr to fix

      Method trans_maxzero has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def trans_maxzero(pipe, param = '', body = '', setup_count = 0, setup_data = '', no_response = false, do_recv = true, ignore_errors = false)
      Severity: Major
      Found in lib/rex/proto/smb/client.rb - About 1 hr to fix

        Method list_path has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def list_path(path, columns, sort, order, short, recursive = false, depth = 0, search_term = nil)
        Severity: Major
        Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb - About 1 hr to fix

          Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def initialize(recnum, timegen, timewri, id, type, cat, strs, data)

            Method store_loot has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def store_loot(ltype, ctype, host, data, filename=nil, info=nil, service=nil, &block)
            Severity: Major
            Found in lib/msf/core/auxiliary/report.rb - About 1 hr to fix

              Method handle_nessus has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def handle_nessus(wspace, hobj, port, nasl, plugin_name, severity, data,task=nil)
              Severity: Major
              Found in lib/msf/core/db_manager/import/nessus.rb - About 1 hr to fix

                Function oracle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                def oracle(target, pms, cke_2nd_prefix, cipher_handshake=ch_def, messageflow=False, timeout=5):
                    try:
                        s, cke_version = tls_connect(target, timeout)
                        s.send(bytearray(b'\x16') + cke_version)
                        s.send(cke_2nd_prefix)
                Severity: Minor
                Found in modules/auxiliary/scanner/ssl/bleichenbacher_oracle.py - About 55 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 transform_params has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def transform_params(options)
                        # If we've been given a specific IP to listen on, use that as our poisoning IP
                        if options[:spoof_ip].nil? && Rex::Socket.is_ip_addr?(options[:srvhost]) && Rex::Socket.addr_atoi(options[:srvhost]) != 0
                          options[:spoof_ip] = options[:srvhost]
                        end
                Severity: Minor
                Found in plugins/capture.rb - About 55 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_nessus_policy_del has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def cmd_nessus_policy_del(*args)
                        if args[0] == '-h'
                          print_status('nessus_policy_del <policy ID>')
                          print_status('Example:> nessus_policy_del 1')
                          print_status('You must be an admin to delete policies.')
                Severity: Minor
                Found in plugins/nessus.rb - About 55 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_nessus_plugin_details has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def cmd_nessus_plugin_details(*args)
                        search_term = nil
                        plugin_id = nil
                        while (arg = args.shift)
                          case arg
                Severity: Minor
                Found in plugins/nessus.rb - About 55 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

                Function run_scanner has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                def run_scanner(args, login_callback):
                    userpass = args['userpass'] or []
                    rhost = args['rhost']
                    rport = int(args['rport'])
                    sleep_interval = float(args['sleep_interval'] or 0)
                Severity: Minor
                Found in lib/msf/core/modules/external/python/metasploit/login_scanner.py - About 55 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_openvas_connect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def cmd_openvas_connect(*args)
                        # Is the database configured?
                        if !database?
                          print_error('No database has been configured.')
                          return
                Severity: Minor
                Found in plugins/openvas.rb - About 55 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_lab_load_config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def cmd_lab_load_config(*args)
                        return lab_usage if args.empty?
                
                        if args[0] =~ /^remote_/
                          return lab_usage unless args.count == 3
                Severity: Minor
                Found in plugins/lab.rb - About 55 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_lab_load_running has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def cmd_lab_load_running(*args)
                        return lab_usage if args.empty?
                
                        if args[0] =~ /^remote_/
                          return lab_usage unless args.count == 3
                Severity: Minor
                Found in plugins/lab.rb - About 55 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_ffautoregen has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def cmd_ffautoregen(*_args)
                        if !active_module || !(path = active_module.file_path)
                          print_line('Error: No active module selected')
                          return nil
                        end
                Severity: Minor
                Found in plugins/ffautoregen.rb - About 55 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 rpc_list_nodes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def rpc_list_nodes
                        indent = '     '
                
                        tbl = Rex::Text::Table.new(
                          'Indent' => indent.length,
                Severity: Minor
                Found in plugins/wmap.rb - About 55 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 local_module_exec has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def local_module_exec(mod, mtype, opts, _nmaxjobs)
                        jobify = false
                
                        modinst = framework.modules.create(mod)
                
                
                Severity: Minor
                Found in plugins/wmap.rb - About 55 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 send_text_to_gotify has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def send_text_to_gotify(session)
                        # https://gotify.net/docs/more-pushmsg
                        uri_parser = URI.parse(gotify_address)
                        message_text =
                          "Platform : #{session.platform}\n" \
                Severity: Minor
                Found in plugins/session_notifier.rb - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def run_host(ip)
                
                    begin
                
                      name = datastore['MSG']
                Severity: Minor
                Found in modules/auxiliary/voip/sip_invite_spoof.rb - About 55 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