ronin-rb/ronin-support

View on GitHub

Showing 196 of 196 total issues

File http.rb has 1063 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 68 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 30 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

                                  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 has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                def initialize(types)
                                                  super(types)
                                    
                                                  if types::ADDRESS_SIZE == 8
                                                    # NOTE: `long` and `unsigne long` are actually 4 bytes on
                                    Severity: Major
                                    Found in lib/ronin/support/binary/ctypes/os/windows.rb - About 2 hrs to fix

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

                                      module Ronin
                                        module Support
                                          module Binary
                                            module CTypes
                                              #
                                      Severity: Major
                                      Found in lib/ronin/support/binary/ctypes/union_object_type.rb and 1 other location - About 2 hrs to fix
                                      lib/ronin/support/binary/ctypes/struct_object_type.rb on lines 22..166

                                      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 100.

                                      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

                                      module Ronin
                                        module Support
                                          module Binary
                                            module CTypes
                                              #
                                      Severity: Major
                                      Found in lib/ronin/support/binary/ctypes/struct_object_type.rb and 1 other location - About 2 hrs to fix
                                      lib/ronin/support/binary/ctypes/union_object_type.rb on lines 22..166

                                      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 100.

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language