ronin-rb/ronin-support

View on GitHub

Showing 114 of 202 total issues

File http.rb has 1117 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'ronin/support/network/http/user_agents'
require 'ronin/support/network/http/request'
require 'ronin/support/network/http/set_cookie'
require 'ronin/support/network/http/core_ext'
require 'ronin/support/network/dns/idn'
Severity: Major
Found in lib/ronin/support/network/http.rb - About 2 days to fix

    Class Buffer has 106 methods (exceeds 20 allowed). Consider refactoring.
    Open

          class Buffer < Memory
    
            include CTypes::Mixin
    
            #
    Severity: Major
    Found in lib/ronin/support/binary/buffer.rb - About 2 days to fix

      Class Stream has 103 methods (exceeds 20 allowed). Consider refactoring.
      Open

            class Stream
              #
              # Adds `read_*`/`write_*` methods for reading and writing binary data
              # types.
              #
      Severity: Major
      Found in lib/ronin/support/binary/stream/methods.rb - About 1 day to fix

        Class HTTP has 70 methods (exceeds 20 allowed). Consider refactoring.
        Open

              class HTTP
        
                #
                # The Ronin HTTP proxy to use.
                #
        Severity: Major
        Found in lib/ronin/support/network/http.rb - About 1 day to fix

          Class Host has 59 methods (exceeds 20 allowed). Consider refactoring.
          Open

                class Host
          
                  # The host name.
                  #
                  # @return [String]
          Severity: Major
          Found in lib/ronin/support/network/host.rb - About 1 day to fix

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

                        def initialize(types)
                          super(types)
            
                          typedef :int, :__clockid_t
                          typedef :int, :clockid_t
            Severity: Major
            Found in lib/ronin/support/binary/ctypes/os/freebsd.rb - About 6 hrs to fix

              File buffer.rb has 418 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'ronin/support/binary/memory'
              require 'ronin/support/binary/byte_slice'
              require 'ronin/support/binary/ctypes/mixin'
              
              module Ronin
              Severity: Minor
              Found in lib/ronin/support/binary/buffer.rb - About 6 hrs to fix

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

                            def initialize(types)
                              super(types)
                
                              typedef :long, :__blkcnt_t
                              typedef :long, :__blksize_t
                Severity: Major
                Found in lib/ronin/support/binary/ctypes/os/linux.rb - About 5 hrs to fix

                  Class Resolver has 39 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                          class Resolver
                  
                            # The nameserver(s) to query.
                            #
                            # @return [Array<String>]
                  Severity: Minor
                  Found in lib/ronin/support/network/dns/resolver.rb - About 5 hrs to fix

                    File methods.rb has 377 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'ronin/support/binary/buffer'
                    require 'ronin/support/binary/array'
                    require 'ronin/support/binary/struct'
                    require 'ronin/support/binary/union'
                    
                    
                    Severity: Minor
                    Found in lib/ronin/support/binary/stream/methods.rb - About 5 hrs to fix

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

                                  def initialize(types)
                                    super(types)
                      
                                    typedef :int, :__clockid_t
                                    typedef :int, :clockid_t
                      Severity: Major
                      Found in lib/ronin/support/binary/ctypes/os/openbsd.rb - About 4 hrs to fix

                        Class Proxy has 33 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                              class Proxy
                        
                                # Default host to bind to
                                DEFAULT_HOST = '0.0.0.0'
                        
                        
                        Severity: Minor
                        Found in lib/ronin/support/network/proxy.rb - About 4 hrs to fix

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

                                      def initialize(types)
                                        super(types)
                          
                                        typedef :long_long, :blkcnt_t
                                        typedef :int, :blksize_t
                          Severity: Major
                          Found in lib/ronin/support/binary/ctypes/os/macos.rb - About 3 hrs to fix

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

                                        def initialize(types)
                                          super(types)
                            
                                          typedef :int, :__clockid_t
                                          typedef :int, :clockid_t
                            Severity: Major
                            Found in lib/ronin/support/binary/ctypes/os/netbsd.rb - About 3 hrs to fix

                              Class HTTP has 31 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                    class HTTP
                                      #
                                      # Provides helper methods for communicating with HTTP Servers.
                                      #
                                      module Mixin
                              Severity: Minor
                              Found in lib/ronin/support/network/http/mixin.rb - About 3 hrs to fix

                                File host.rb has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                require 'ronin/support/network/dns'
                                require 'ronin/support/network/dns/idn'
                                require 'ronin/support/network/ip'
                                require 'ronin/support/network/tld'
                                require 'ronin/support/network/public_suffix'
                                Severity: Minor
                                Found in lib/ronin/support/network/host.rb - About 3 hrs to fix

                                  Method context has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          def self.context(version:     nil,
                                                           min_version: nil,
                                                           max_version: nil,
                                                           verify:      :none,
                                                           key:         nil,
                                  Severity: Minor
                                  Found in lib/ronin/support/network/ssl.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

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if (byte == 33) || (byte == 36) || (byte == 38) || ((byte >= 39) && (byte <= 59)) || (byte == 61) || ((byte >= 63) && (byte <= 91)) || (byte == 93) || (byte == 95) || ((byte >= 97) && (byte <= 122)) || (byte == 126)
                                                byte.chr
                                              else
                                                encode_byte(byte,**kwargs)
                                              end
                                  Severity: Critical
                                  Found in lib/ronin/support/encoding/uri.rb - About 3 hrs to fix

                                    Method initialize_ssl has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                            def initialize_ssl(ca_bundle:        nil,
                                                               cert:             nil,
                                                               cert_store:       nil,
                                                               ciphers:          nil,
                                                               extra_chain_cert: nil,
                                    Severity: Minor
                                    Found in lib/ronin/support/network/http.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 build has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                              def self.build(method,path, # query string keyword arguments
                                                                          query:        nil,
                                                                          query_params: nil,
                                                                          # Basic-Auth keyword arguments
                                                                          user:     nil,
                                    Severity: Minor
                                    Found in lib/ronin/support/network/http/request.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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language