rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Method parse_msv has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def parse_msv(output)
    results = {}
    lines = output.lines

    while lines.length > 0 do
Severity: Minor
Found in lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb - About 1 hr to fix

    Method map_compile_arch_to_architecture has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def map_compile_arch_to_architecture(compile_arch)
        return '' if compile_arch.blank?
    
        compile_arch = compile_arch.downcase.encode(::Encoding::BINARY)
    
    
    Severity: Minor
    Found in lib/postgres/postgres-pr/connection.rb - About 1 hr to fix

      Method cmd_cd has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method write has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def write(data)
              begin
                @sock.sync = false
                if data.nil?
                  Timeout.timeout @write_timeout do
        Severity: Minor
        Found in lib/rbmysql/protocol.rb - About 1 hr to fix

          Method map_compile_os_to_platform has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def map_compile_os_to_platform(compile_os)
              return Msf::Platform::Unknown.realname if compile_os.blank?
          
              compile_os = compile_os.downcase.encode(::Encoding::BINARY)
          
          
          Severity: Minor
          Found in lib/postgres/postgres-pr/connection.rb - About 1 hr to fix

            Method allowed? has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def allowed?(uri, user_agent)
                  return true unless @parsed
                  allowed = true
                  path = uri.request_uri
            
            
            Severity: Minor
            Found in lib/robots.rb - About 1 hr to fix

              Method cmd_loadpath has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                        def cmd_loadpath(*args)
                          if (args.length == 0 or args.include? "-h")
                            cmd_loadpath_help
                            return true
                          end
              Severity: Minor
              Found in lib/msf/ui/console/command_dispatcher/modules.rb - About 1 hr to fix

                Method ysoserial_payload has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def self.ysoserial_payload(payload_name, command=nil, modified_type: 'none')
                    payloads_json = load_ysoserial_data(modified_type)
                
                    # Extract the specified payload (status, lengthOffset, bufferOffset, bytes)
                    payload = payloads_json[payload_name]
                Severity: Minor
                Found in lib/msf/util/java_deserialization.rb - About 1 hr to fix

                  Method cmd_to_handler has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def cmd_to_handler(*args)
                      if args.include?('-r') || args.include?('--reload-libs')
                        driver.run_single('reload_lib -a')
                      end
                  
                  
                  Severity: Minor
                  Found in lib/msf/ui/console/command_dispatcher/evasion.rb - About 1 hr to fix

                    Method initialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def initialize(framework, console_id, opts={})
                        # Configure the framework
                        self.framework = framework
                    
                        # Configure the ID
                    Severity: Minor
                    Found in lib/msf/ui/web/web_console.rb - About 1 hr to fix

                      Method lookup_proxy_settings has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def lookup_proxy_settings
                          info = {}
                          return @proxy_settings if @proxy_settings
                      
                          if datastore['HttpProxyHost'].to_s == ''
                      Severity: Minor
                      Found in lib/msf/core/handler/reverse_http.rb - About 1 hr to fix

                        Method initialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def initialize(info = {})
                            super
                        
                            register_options(
                              [
                        Severity: Minor
                        Found in lib/msf/core/handler/bind_aws_instance_connect.rb - About 1 hr to fix

                          Method setup_handler has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def setup_handler
                              ex = false
                          
                              comm = select_comm
                              local_port = bind_port
                          Severity: Minor
                          Found in lib/msf/core/handler/reverse_udp.rb - About 1 hr to fix

                            Method do_encode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def do_encode(state)
                            
                                # Copy the decoder stub since we may need to modify it
                                stub = decoder_stub(state).dup
                            
                            
                            Severity: Minor
                            Found in lib/msf/core/encoder.rb - About 1 hr to fix

                              Method module_info_by_path_from_database! has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def module_info_by_path_from_database!(allowed_paths=[""])
                                  self.module_info_by_path = {}
                              
                                  allowed_paths = allowed_paths.map{|x| x + "/"}
                              
                              
                              Severity: Minor
                              Found in lib/msf/core/module_manager/cache.rb - About 1 hr to fix

                                Method rpc_list has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def rpc_list
                                    res = {}
                                    self.framework.sessions.each do |sess|
                                      i,s = sess
                                      res[s.sid] = {
                                Severity: Minor
                                Found in lib/msf/core/rpc/v10/rpc_session.rb - About 1 hr to fix

                                  Method srandom_r has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def srandom_r (seed)
                                      state = @randtbl
                                      if seed == 0
                                        seed = 1
                                      end
                                  Severity: Minor
                                  Found in lib/msf/core/auxiliary/crand.rb - About 1 hr to fix

                                    Method counters_expired? has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def counters_expired?(this_service,credentials)
                                        expired_cred = false
                                        expired_time = false
                                        # Workaround for cases where multiple auth_brute modules are running concurrently and
                                        # someone stomps on the @max_per_service class variable during setup.
                                    Severity: Minor
                                    Found in lib/msf/core/auxiliary/auth_brute.rb - About 1 hr to fix

                                      Method log_resource has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          def log_resource(opts = {})
                                            mode  = name
                                            vhash = [target.to_url, mode, opts[:location]]
                                                    .map(&:to_s).join('|').hash
                                      
                                      
                                      Severity: Minor
                                      Found in lib/msf/core/auxiliary/web.rb - About 1 hr to fix

                                        Method fingerprint_service has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            def fingerprint_service(target_uri)
                                              res = send_request_raw(
                                                'uri'    => normalize_uri(target_uri, 'version'),
                                                'method' => 'GET'
                                              )
                                        Severity: Minor
                                        Found in lib/msf/core/auxiliary/etcd.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language