rapid7/metasploit-framework

View on GitHub

Showing 15,831 of 21,886 total issues

Method mouse has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def mouse(mouseaction, x=-1, y=-1)
    request  = Packet.create_request(COMMAND_ID_STDAPI_UI_SEND_MOUSE)
    action = 0
    case mouseaction
    when "move"
Severity: Minor
Found in lib/rex/post/meterpreter/extensions/stdapi/ui.rb - About 1 hr to fix

    Method cmd_rmdir has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def cmd_rmdir(*args)
                if args.include?('-h') || args.include?('--help')
                  cmd_rmdir_help
                  return
                end
    Severity: Minor
    Found in lib/rex/post/smb/ui/console/command_dispatcher/shares.rb - About 1 hr to fix

      Method get_processes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def Process.get_processes
          request   = Packet.create_request(COMMAND_ID_STDAPI_SYS_PROCESS_GET_PROCESSES)
          processes = ProcessList.new
      
          response = client.send_request(request)
      Severity: Minor
      Found in lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb - About 1 hr to fix

        Method to_exe_elf has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.to_exe_elf(framework, opts, template, code, big_endian=false)
            if elf? code
              return code
            end
        
        
        Severity: Minor
        Found in lib/msf/util/exe.rb - About 1 hr to fix

          Method normalize_references has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def normalize_references(refs)
                    normalized = ''
                    cve_collection = refs.select { |r| r.ctx_id.match(/^cve$/i) }
                    if cve_collection.empty?
                      normalized << "* #{NO_CVE_MESSAGE}\n"
          Severity: Minor
          Found in lib/msf/util/document_generator/document_normalizer.rb - About 1 hr to fix

            Method query has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def query(sql)
                write_message(Query.new(sql))
            
                result = Result.new
                errors = []
            Severity: Minor
            Found in lib/postgres/postgres-pr/connection.rb - About 1 hr to fix

              Method show_options has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def show_options(mod) # :nodoc:
                  mod_opt = Serializer::ReadableText.dump_options(mod, '   ')
                  print("\nModule options (#{mod.fullname}):\n\n#{mod_opt}\n") if (mod_opt and mod_opt.length > 0)
              
                  # If it's an exploit and a payload is defined, create it and
              Severity: Minor
              Found in lib/msf/ui/console/command_dispatcher/common.rb - About 1 hr to fix

                Method cmd_loadpath_tabs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def cmd_loadpath_tabs(str, words)
                            return [] if words.length > 1
                
                            # This custom completion might better than Readline's... We'll leave it for now.
                            #tab_complete_filenames(str,words)
                Severity: Minor
                Found in lib/msf/ui/console/command_dispatcher/modules.rb - About 1 hr to fix

                  Method cmd_route_tabs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def cmd_route_tabs(str, words)
                      if words.length == 1
                        return %w{add remove get flush print}
                      end
                  
                  
                  Severity: Minor
                  Found in lib/msf/ui/console/command_dispatcher/core.rb - About 1 hr to fix

                    Method cmd_resource has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                              def cmd_resource(*args)
                                if args.empty? || args.include?('-h') || args.include?('--help')
                                  cmd_resource_help
                                  return false
                                end
                    Severity: Minor
                    Found in lib/msf/ui/console/command_dispatcher/session.rb - About 1 hr to fix

                      Method cmd_shell has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def cmd_shell(*args)
                          if args.length == 1 && (args[0] == '-h' || args[0] == '--help')
                            # One arg, and args[0] => '-h' '--help'
                            return cmd_shell_help
                          end
                      Severity: Minor
                      Found in lib/msf/base/sessions/command_shell.rb - About 1 hr to fix

                        Method shell_read_until_token has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def shell_read_until_token(token, wanted_idx=0, timeout=10)
                            return if timeout.to_i == 0
                        
                            if wanted_idx == 0
                              parts_needed = 2
                        Severity: Minor
                        Found in lib/msf/core/session/provider/single_command_shell.rb - About 1 hr to fix

                          Method get_notes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def get_notes(xopts)
                            ::ApplicationRecord.connection_pool.with_connection {
                              opts, wspace = init_db_opts_workspace(xopts)
                              notes = []
                          
                          
                          Severity: Minor
                          Found in lib/msf/core/rpc/v10/rpc_db.rb - About 1 hr to fix

                            Method _run_payload has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def _run_payload(mod, opts)
                                badchars = opts['BadChars'] || ''
                                fmt = opts['Format'] || 'raw'
                                force = opts['ForceEncode'] || false
                                template = opts['Template'] || nil
                            Severity: Minor
                            Found in lib/msf/core/rpc/v10/rpc_module.rb - About 1 hr to fix

                              Method rpc_services has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def rpc_services( xopts)
                                ::ApplicationRecord.connection_pool.with_connection {
                                  opts, wspace = init_db_opts_workspace(xopts)
                                  limit = opts.delete(:limit) || 100
                                  offset = opts.delete(:offset) || 0
                              Severity: Minor
                              Found in lib/msf/core/rpc/v10/rpc_db.rb - About 1 hr to fix

                                Method rpc_hosts has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def rpc_hosts(xopts)
                                  ::ApplicationRecord.connection_pool.with_connection {
                                    opts, wspace = init_db_opts_workspace(xopts)
                                
                                    conditions = {}
                                Severity: Minor
                                Found in lib/msf/core/rpc/v10/rpc_db.rb - About 1 hr to fix

                                  Method export_to_hash has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def export_to_hash(config)
                                        return {} unless config.is_a? String
                                  
                                        config = config.gsub(/^\s{2,4}/, '') # replace code indents
                                        config = config.gsub(/\\\s*\n/, '') # replace verbose multiline items as single lines, similar to terse
                                  Severity: Minor
                                  Found in lib/msf/core/auxiliary/mikrotik.rb - About 1 hr to fix

                                    Method describe_response has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def describe_response(response)
                                          decoded = Resolv::DNS::Message.decode(response)
                                          answers = decoded.answer
                                    
                                          if answers.empty? # not sure this will ever happen...
                                    Severity: Minor
                                    Found in lib/msf/core/auxiliary/mdns.rb - About 1 hr to fix

                                      Method create_credential_and_login has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          def create_credential_and_login(opts = {})
                                            return nil unless active_db?
                                      
                                            if respond_to?(:[]) && self[:task]
                                              opts[:task_id] ||= self[:task].record.id
                                      Severity: Minor
                                      Found in lib/msf/core/auxiliary/brocade.rb - About 1 hr to fix

                                        Method get_api_docs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def self.get_api_docs
                                            lambda {
                                              swaggered_classes = [
                                                  Msf::WebServices::Documentation::Api::V1::RootApiDoc,
                                                  Msf::WebServices::Documentation::Api::V1::AuthApiDoc,
                                        Severity: Minor
                                        Found in lib/msf/core/web_services/servlet/api_docs_servlet.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language