rapid7/metasploit-framework

View on GitHub
plugins/wmap.rb

Summary

Maintainability
F
1 mo
Test Coverage

Method cmd_wmap_run has a Cognitive Complexity of 421 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_wmap_run(*args)
        # Stop everything
        self.masstop = false
        self.killwhenstop = true

Severity: Minor
Found in plugins/wmap.rb - About 1 wk 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

File wmap.rb has 1645 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'English'
require 'rabal/tree'

module Msf
  class Plugin::Wmap < Msf::Plugin
Severity: Major
Found in plugins/wmap.rb - About 4 days to fix

    Method cmd_wmap_run has 541 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def cmd_wmap_run(*args)
            # Stop everything
            self.masstop = false
            self.killwhenstop = true
    
    
    Severity: Major
    Found in plugins/wmap.rb - About 2 days to fix

      Method cmd_wmap_sites has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
      Open

            def cmd_wmap_sites(*args)
              args.push('-h') if args.empty?
      
              while (arg = args.shift)
                case arg
      Severity: Minor
      Found in plugins/wmap.rb - About 1 day 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_round_exec has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

            def rpc_round_exec(mod, mtype, opts, nmaxjobs)
              res = nil
              idx = 0
      
              if active_rpc_nodes == 0
      Severity: Minor
      Found in plugins/wmap.rb - About 5 hrs 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 process_urls has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

            def process_urls(urlstr)
              target_whitelist = []
      
              urls = urlstr.to_s.split(/\s+/)
      
      
      Severity: Minor
      Found in plugins/wmap.rb - About 5 hrs 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

      Class WmapCommandDispatcher has 37 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class WmapCommandDispatcher
      
            # @!attribute wmapmodules
            #   @return [Array] Enabled WMAP modules
            # @!attribute targets
      Severity: Minor
      Found in plugins/wmap.rb - About 4 hrs to fix

        Method print_tree_recursive has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

              def print_tree_recursive(tree, max_level, indent, prefix, is_last, unicode)
                if !tree.nil? && (tree.depth <= max_level)
                  print(' ' * indent)
        
                  # Prefix serve to print the superior hierarchy
        Severity: Minor
        Found in plugins/wmap.rb - About 4 hrs 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 view_site_tree has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

              def view_site_tree(urlstr, md, ld)
                if !urlstr
                  return
                end
        
        
        Severity: Minor
        Found in plugins/wmap.rb - About 4 hrs 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_wmap_nodes has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

              def cmd_wmap_nodes(*args)
                if !rpcarr
                  self.rpcarr = Hash.new
                end
        
        
        Severity: Minor
        Found in plugins/wmap.rb - About 3 hrs 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_wmap_sites has 81 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def cmd_wmap_sites(*args)
                args.push('-h') if args.empty?
        
                while (arg = args.shift)
                  case arg
        Severity: Major
        Found in plugins/wmap.rb - About 3 hrs to fix

          Method cmd_wmap_nodes has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def cmd_wmap_nodes(*args)
                  if !rpcarr
                    self.rpcarr = Hash.new
                  end
          
          
          Severity: Major
          Found in plugins/wmap.rb - About 3 hrs to fix

            Method process_urls has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def process_urls(urlstr)
                    target_whitelist = []
            
                    urls = urlstr.to_s.split(/\s+/)
            
            
            Severity: Major
            Found in plugins/wmap.rb - About 2 hrs to fix

              Method rpc_mon_nodes has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                    def rpc_mon_nodes
                      # Pretty monitor
              
                      color = begin
                        opts['ConsoleDriver'].output.supports_color?
              Severity: Minor
              Found in plugins/wmap.rb - About 2 hrs 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_round_exec has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def rpc_round_exec(mod, mtype, opts, nmaxjobs)
                      res = nil
                      idx = 0
              
                      if active_rpc_nodes == 0
              Severity: Major
              Found in plugins/wmap.rb - About 2 hrs to fix

                Method rpc_reconnect_nodes has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                      def rpc_reconnect_nodes
                        # Sucky 5 mins token timeout.
                
                        idx = nil
                        rpcarr.each do |k, rpccon|
                Severity: Minor
                Found in plugins/wmap.rb - About 2 hrs 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_mon_nodes has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def rpc_mon_nodes
                        # Pretty monitor
                
                        color = begin
                          opts['ConsoleDriver'].output.supports_color?
                Severity: Major
                Found in plugins/wmap.rb - About 2 hrs to fix

                  Method view_site_tree has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def view_site_tree(urlstr, md, ld)
                          if !urlstr
                            return
                          end
                  
                  
                  Severity: Major
                  Found in plugins/wmap.rb - About 2 hrs to fix

                    Method rpc_kill_node has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def rpc_kill_node(i, j)
                            if !i
                              print_error('Nodes not defined')
                              return
                            end
                    Severity: Minor
                    Found in plugins/wmap.rb - About 1 hr 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 39 lines of code (exceeds 25 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 1 hr to fix

                      Method rpc_view_jobs has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            def rpc_view_jobs
                              indent = '     '
                      
                              rpc_reconnect_nodes
                      
                      
                      Severity: Minor
                      Found in plugins/wmap.rb - About 1 hr to fix

                        Method add_web_site has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def add_web_site(url)
                                vhost = nil
                        
                                # Allow the URL to be supplied as VHOST,URL if a custom VHOST
                                # should be used. This allows for things like:
                        Severity: Minor
                        Found in plugins/wmap.rb - About 1 hr to fix

                          Method local_module_exec has 37 lines of code (exceeds 25 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 1 hr to fix

                            Method view_modules has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  def view_modules
                                    indent = '     '
                            
                                    wmaptype = %i[
                                      wmap_ssl
                            Severity: Minor
                            Found in plugins/wmap.rb - About 1 hr to fix

                              Method load_wmap_modules has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def load_wmap_modules(reload)
                                      if reload || !wmapmodules
                                        print_status('Loading wmap modules...')
                              
                                        self.wmapmodules = []
                              Severity: Minor
                              Found in plugins/wmap.rb - About 1 hr 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_kill_node has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    def rpc_kill_node(i, j)
                                      if !i
                                        print_error('Nodes not defined')
                                        return
                                      end
                              Severity: Minor
                              Found in plugins/wmap.rb - About 1 hr to fix

                                Method view_sites has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      def view_sites
                                        # Clean temporary sites list
                                        self.lastsites = []
                                
                                        indent = '     '
                                Severity: Minor
                                Found in plugins/wmap.rb - About 1 hr to fix

                                  Method print_tree_recursive has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        def print_tree_recursive(tree, max_level, indent, prefix, is_last, unicode)
                                          if !tree.nil? && (tree.depth <= max_level)
                                            print(' ' * indent)
                                  
                                            # Prefix serve to print the superior hierarchy
                                  Severity: Minor
                                  Found in plugins/wmap.rb - About 1 hr to fix

                                    Method rpc_add_node has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          def rpc_add_node(host, port, ssl, user, pass, bypass_exist)
                                            if !rpcarr
                                              self.rpcarr = Hash.new
                                            end
                                    
                                    
                                    Severity: Minor
                                    Found in plugins/wmap.rb - About 1 hr to fix

                                      Method add_web_site has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                            def add_web_site(url)
                                              vhost = nil
                                      
                                              # Allow the URL to be supplied as VHOST,URL if a custom VHOST
                                              # should be used. This allows for things like:
                                      Severity: Minor
                                      Found in plugins/wmap.rb - About 1 hr 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 process_ids has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                            def process_ids(idsstr)
                                              if !lastsites || lastsites.empty?
                                                view_sites
                                                print_status('Web sites ids. referenced from previous table.')
                                              end
                                      Severity: Minor
                                      Found in plugins/wmap.rb - About 1 hr 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_add_node has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                            def rpc_add_node(host, port, ssl, user, pass, bypass_exist)
                                              if !rpcarr
                                                self.rpcarr = Hash.new
                                              end
                                      
                                      
                                      Severity: Minor
                                      Found in plugins/wmap.rb - About 1 hr 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_wmap_targets has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                            def cmd_wmap_targets(*args)
                                              args.push('-h') if args.empty?
                                      
                                              while (arg = args.shift)
                                                case arg
                                      Severity: Minor
                                      Found in plugins/wmap.rb - About 1 hr to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                            if ((node.is_leaf? && !strpath.include?('.')) || node.is_root? || !node.is_leaf?) && (!usinginipath || (usinginipath && strpath.match(inipathname)))
                                        
                                                              modopts['PATH'] = strpath
                                                              print_status("Path: #{strpath}")
                                        
                                        
                                        Severity: Major
                                        Found in plugins/wmap.rb - About 1 hr to fix

                                          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 rpc_db_nodes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                                def rpc_db_nodes(host, port, user, pass, name)
                                                  rpc_reconnect_nodes
                                          
                                                  if active_rpc_nodes == 0
                                                    print_error('No active nodes at this time')
                                          Severity: Minor
                                          Found in plugins/wmap.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 print_tree_recursive has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                                def print_tree_recursive(tree, max_level, indent, prefix, is_last, unicode)
                                          Severity: Minor
                                          Found in plugins/wmap.rb - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                      if execmod
                                                                        rpc_round_exec(xref[0], xref[1], modopts, njobs)
                                                                      end
                                            Severity: Major
                                            Found in plugins/wmap.rb - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      rescue ::Exception
                                                                        print_status(" >> Exception during launch from #{xref[0]}: #{$ERROR_INFO}")
                                              Severity: Major
                                              Found in plugins/wmap.rb - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                    if !modname.empty?
                                                                      eprofile << modname
                                                                    end
                                                Severity: Major
                                                Found in plugins/wmap.rb - About 45 mins to fix

                                                  Method rpc_add_node has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                        def rpc_add_node(host, port, ssl, user, pass, bypass_exist)
                                                  Severity: Minor
                                                  Found in plugins/wmap.rb - About 45 mins to fix

                                                    Consider simplifying this complex logical expression.
                                                    Open

                                                                next unless (using_p && eprofile.include?(xref[0].split('/').last)) || (using_m && xref[0].to_s.match(mname)) || (!using_m && !using_p)
                                                    Severity: Major
                                                    Found in plugins/wmap.rb - About 40 mins to fix

                                                      Consider simplifying this complex logical expression.
                                                      Open

                                                                  next unless (using_p && eprofile.include?(xref[0].split('/').last)) || (using_m && xref[0].to_s.match(mname)) || (!using_m && !using_p)
                                                      Severity: Major
                                                      Found in plugins/wmap.rb - About 40 mins to fix

                                                        Consider simplifying this complex logical expression.
                                                        Open

                                                                    next unless (using_p && eprofile.include?(xref[0].split('/').last)) || (using_m && xref[0].to_s.match(mname)) || (!using_m && !using_p)
                                                        Severity: Major
                                                        Found in plugins/wmap.rb - About 40 mins to fix

                                                          Consider simplifying this complex logical expression.
                                                          Open

                                                                      next unless (using_p && eprofile.include?(xref[0].split('/').last)) || (using_m && xref[0].to_s.match(mname)) || (!using_m && !using_p)
                                                          Severity: Major
                                                          Found in plugins/wmap.rb - About 40 mins to fix

                                                            Consider simplifying this complex logical expression.
                                                            Open

                                                                        next unless !(using_p && eprofile.include?(xref[0].split('/').last)) || (using_m && xref[0].to_s.match(mname)) || (!using_m && !using_p)
                                                            Severity: Major
                                                            Found in plugins/wmap.rb - About 40 mins to fix

                                                              Consider simplifying this complex logical expression.
                                                              Open

                                                                          next unless !(using_p && eprofile.include?(xref[0].split('/').last)) || (using_m && xref[0].to_s.match(mname)) || (!using_m && !using_p)
                                                              Severity: Major
                                                              Found in plugins/wmap.rb - About 40 mins to fix

                                                                Method rpc_db_nodes has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                      def rpc_db_nodes(host, port, user, pass, name)
                                                                Severity: Minor
                                                                Found in plugins/wmap.rb - About 35 mins to fix

                                                                  Method rpc_view_jobs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                        def rpc_view_jobs
                                                                          indent = '     '
                                                                  
                                                                          rpc_reconnect_nodes
                                                                  
                                                                  
                                                                  Severity: Minor
                                                                  Found in plugins/wmap.rb - About 35 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 view_modules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                        def view_modules
                                                                          indent = '     '
                                                                  
                                                                          wmaptype = %i[
                                                                            wmap_ssl
                                                                  Severity: Minor
                                                                  Found in plugins/wmap.rb - About 35 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 delete_sites has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                        def delete_sites(wmap_index)
                                                                          idx = 0
                                                                          to_del = {}
                                                                          # Rebuild the index from wmap_sites -l
                                                                          framework.db.hosts.each do |bdhost|
                                                                  Severity: Minor
                                                                  Found in plugins/wmap.rb - About 35 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 too many return statements within this method.
                                                                  Open

                                                                                return
                                                                  Severity: Major
                                                                  Found in plugins/wmap.rb - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                return
                                                                    Severity: Major
                                                                    Found in plugins/wmap.rb - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                      return
                                                                      Severity: Major
                                                                      Found in plugins/wmap.rb - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                  return
                                                                        Severity: Major
                                                                        Found in plugins/wmap.rb - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                              return
                                                                          Severity: Major
                                                                          Found in plugins/wmap.rb - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                        return
                                                                            Severity: Major
                                                                            Found in plugins/wmap.rb - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                          return
                                                                              Severity: Major
                                                                              Found in plugins/wmap.rb - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                              return
                                                                                Severity: Major
                                                                                Found in plugins/wmap.rb - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                              return
                                                                                  Severity: Major
                                                                                  Found in plugins/wmap.rb - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                  return
                                                                                    Severity: Major
                                                                                    Found in plugins/wmap.rb - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                                  return
                                                                                      Severity: Major
                                                                                      Found in plugins/wmap.rb - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                            return
                                                                                        Severity: Major
                                                                                        Found in plugins/wmap.rb - About 30 mins to fix

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                        return
                                                                                          Severity: Major
                                                                                          Found in plugins/wmap.rb - About 30 mins to fix

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                          return
                                                                                            Severity: Major
                                                                                            Found in plugins/wmap.rb - About 30 mins to fix

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                            return
                                                                                              Severity: Major
                                                                                              Found in plugins/wmap.rb - About 30 mins to fix

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

                                                                                                                    return
                                                                                                Severity: Major
                                                                                                Found in plugins/wmap.rb - About 30 mins to fix

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

                                                                                                        def quit?
                                                                                                          while (c = driver.input.read_nonblock(1))
                                                                                                            print_status('Quited')
                                                                                                            return true if c == 'Q'
                                                                                                          end
                                                                                                  Severity: Minor
                                                                                                  Found in plugins/wmap.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

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                            matches1.each_key do |xref|
                                                                                                              if masstop
                                                                                                                print_error('STOPPED.')
                                                                                                                return
                                                                                                              end
                                                                                                  Severity: Major
                                                                                                  Found in plugins/wmap.rb and 1 other location - About 4 hrs to fix
                                                                                                  plugins/wmap.rb on lines 565..616

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 139.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                            matches3.each_key do |xref|
                                                                                                              if masstop
                                                                                                                print_error('STOPPED.')
                                                                                                                return
                                                                                                              end
                                                                                                  Severity: Major
                                                                                                  Found in plugins/wmap.rb and 1 other location - About 4 hrs to fix
                                                                                                  plugins/wmap.rb on lines 628..680

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 139.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          urls.each do |url|
                                                                                                            next if url.to_s.strip.empty?
                                                                                                  
                                                                                                            vhost = nil
                                                                                                  
                                                                                                  
                                                                                                  Severity: Major
                                                                                                  Found in plugins/wmap.rb and 1 other location - About 2 hrs to fix
                                                                                                  plugins/wmap.rb on lines 1486..1524

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 81.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                          urls.each do |url|
                                                                                                            next if url.to_s.strip.empty?
                                                                                                  
                                                                                                            vhost = nil
                                                                                                  
                                                                                                  
                                                                                                  Severity: Major
                                                                                                  Found in plugins/wmap.rb and 1 other location - About 2 hrs to fix
                                                                                                  plugins/wmap.rb on lines 1339..1376

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 81.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                    req.params.each do |p|
                                                                                                                      pn, pv, _pt = p
                                                                                                                      if pn
                                                                                                                        if !pn.empty?
                                                                                                                          if !pv || pv.empty?
                                                                                                  Severity: Minor
                                                                                                  Found in plugins/wmap.rb and 1 other location - About 50 mins to fix
                                                                                                  plugins/wmap.rb on lines 904..917

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 42.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                                    form.params.each do |p|
                                                                                                                      pn, pv, _pt = p
                                                                                                                      if pn
                                                                                                                        if !pn.empty?
                                                                                                                          if !pv || pv.empty?
                                                                                                  Severity: Minor
                                                                                                  Found in plugins/wmap.rb and 1 other location - About 50 mins to fix
                                                                                                  plugins/wmap.rb on lines 1039..1051

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 42.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                  Open

                                                                                                        def queryparse(query)
                                                                                                          params = Hash.new
                                                                                                  
                                                                                                          query.split(/[&;]/n).each do |pairs|
                                                                                                            key, value = pairs.split('=', 2)
                                                                                                  Severity: Minor
                                                                                                  Found in plugins/wmap.rb and 2 other locations - About 25 mins to fix
                                                                                                  lib/msf/core/auxiliary/wmap_module.rb on lines 82..93
                                                                                                  lib/msf/core/auxiliary/wmap_module.rb on lines 97..108

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 30.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              next unless !(using_p && eprofile.include?(xref[0].split('/').last)) || (using_m && xref[0].to_s.match(mname)) || (!using_m && !using_p)
                                                                                                  
                                                                                                              idx += 1
                                                                                                  Severity: Minor
                                                                                                  Found in plugins/wmap.rb and 1 other location - About 20 mins to fix
                                                                                                  plugins/wmap.rb on lines 1109..1111

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 28.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                  Open

                                                                                                              next unless !(using_p && eprofile.include?(xref[0].split('/').last)) || (using_m && xref[0].to_s.match(mname)) || (!using_m && !using_p)
                                                                                                  
                                                                                                              idx += 1
                                                                                                  Severity: Minor
                                                                                                  Found in plugins/wmap.rb and 1 other location - About 20 mins to fix
                                                                                                  plugins/wmap.rb on lines 982..984

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 28.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

                                                                                                  There are no issues that match your filters.

                                                                                                  Category
                                                                                                  Status