YorickPeterse/ruby-lint

View on GitHub

Showing 78 of 2,162 total issues

File string.rb has 455 lines of code (exceeds 250 allowed). Consider refactoring.
Open

RubyLint.registry.register('String') do |defs|
  defs.define_constant('String') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('JSON::Ext::Generator::GeneratorMethods::String', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Comparable', RubyLint.registry))
Severity: Minor
Found in lib/ruby-lint/definitions/core/string.rb - About 6 hrs to fix

    File date.rb has 423 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    RubyLint.registry.register('Date') do |defs|
      defs.define_constant('Date') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
        klass.inherits(defs.constant_proxy('Comparable', RubyLint.registry))
    
    
    Severity: Minor
    Found in lib/ruby-lint/definitions/core/date.rb - About 6 hrs to fix

      File kernel.rb has 400 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      RubyLint.registry.register('Kernel') do |defs|
        defs.define_constant('Kernel') do |klass|
          klass.define_method('Array') do |method|
            method.define_argument('obj')
          end
      Severity: Minor
      Found in lib/ruby-lint/definitions/core/kernel.rb - About 5 hrs to fix

        File drb.rb has 398 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        RubyLint.registry.register('DRb') do |defs|
          defs.define_constant('DRb') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
        
            klass.define_method('config')
        Severity: Minor
        Found in lib/ruby-lint/definitions/core/drb.rb - About 5 hrs to fix

          Class RubyObject has 40 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class RubyObject
                include VariablePredicates
          
                ##
                # Array containing items that should be looked up in the parent
          Severity: Minor
          Found in lib/ruby-lint/definition/ruby_object.rb - About 5 hrs to fix

            File basic_socket.rb has 381 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            RubyLint.registry.register('BasicSocket') do |defs|
              defs.define_constant('BasicSocket') do |klass|
                klass.inherits(defs.constant_proxy('IO', RubyLint.registry))
            
                klass.define_method('do_not_reverse_lookup')
            Severity: Minor
            Found in lib/ruby-lint/definitions/core/basic_socket.rb - About 5 hrs to fix

              File hash.rb has 363 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              RubyLint.registry.register('Hash') do |defs|
                defs.define_constant('Hash') do |klass|
                  klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
                  klass.inherits(defs.constant_proxy('JSON::Ext::Generator::GeneratorMethods::Hash', RubyLint.registry))
                  klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
              Severity: Minor
              Found in lib/ruby-lint/definitions/core/hash.rb - About 4 hrs to fix

                File unixsocket.rb has 358 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                RubyLint.registry.register('UNIXSocket') do |defs|
                  defs.define_constant('UNIXSocket') do |klass|
                    klass.inherits(defs.constant_proxy('BasicSocket', RubyLint.registry))
                    klass.inherits(defs.constant_proxy('IO::TransferIO', RubyLint.registry))
                
                
                Severity: Minor
                Found in lib/ruby-lint/definitions/core/unixsocket.rb - About 4 hrs to fix

                  File tcpsocket.rb has 349 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  RubyLint.registry.register('TCPSocket') do |defs|
                    defs.define_constant('TCPSocket') do |klass|
                      klass.inherits(defs.constant_proxy('IPSocket', RubyLint.registry))
                  
                      klass.define_method('gethostbyname') do |method|
                  Severity: Minor
                  Found in lib/ruby-lint/definitions/core/tcpsocket.rb - About 4 hrs to fix

                    File udpsocket.rb has 349 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    RubyLint.registry.register('UDPSocket') do |defs|
                      defs.define_constant('UDPSocket') do |klass|
                        klass.inherits(defs.constant_proxy('IPSocket', RubyLint.registry))
                    
                        klass.define_instance_method('bind') do |method|
                    Severity: Minor
                    Found in lib/ruby-lint/definitions/core/udpsocket.rb - About 4 hrs to fix

                      File ipsocket.rb has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      RubyLint.registry.register('IPSocket') do |defs|
                        defs.define_constant('IPSocket') do |klass|
                          klass.inherits(defs.constant_proxy('BasicSocket', RubyLint.registry))
                      
                          klass.define_method('getaddress') do |method|
                      Severity: Minor
                      Found in lib/ruby-lint/definitions/core/ipsocket.rb - About 4 hrs to fix

                        File zlib.rb has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        RubyLint.registry.register('Zlib') do |defs|
                          defs.define_constant('Zlib') do |klass|
                            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
                        
                            klass.define_method('adler32')
                        Severity: Minor
                        Found in lib/ruby-lint/definitions/core/zlib.rb - About 4 hrs to fix

                          File tcpserver.rb has 338 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          RubyLint.registry.register('TCPServer') do |defs|
                            defs.define_constant('TCPServer') do |klass|
                              klass.inherits(defs.constant_proxy('TCPSocket', RubyLint.registry))
                              klass.inherits(defs.constant_proxy('Socket::ListenAndAccept', RubyLint.registry))
                              klass.inherits(defs.constant_proxy('IO::Socketable', RubyLint.registry))
                          Severity: Minor
                          Found in lib/ruby-lint/definitions/core/tcpserver.rb - About 4 hrs to fix

                            File json.rb has 338 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            RubyLint.registry.register('JSON') do |defs|
                              defs.define_constant('JSON') do |klass|
                                klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
                            
                                klass.define_method('[]') do |method|
                            Severity: Minor
                            Found in lib/ruby-lint/definitions/core/json.rb - About 4 hrs to fix

                              File unixserver.rb has 337 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              RubyLint.registry.register('UNIXServer') do |defs|
                                defs.define_constant('UNIXServer') do |klass|
                                  klass.inherits(defs.constant_proxy('UNIXSocket', RubyLint.registry))
                                  klass.inherits(defs.constant_proxy('Socket::ListenAndAccept', RubyLint.registry))
                                  klass.inherits(defs.constant_proxy('IO::Socketable', RubyLint.registry))
                              Severity: Minor
                              Found in lib/ruby-lint/definitions/core/unixserver.rb - About 4 hrs to fix

                                File matrix.rb has 337 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                RubyLint.registry.register('Matrix') do |defs|
                                  defs.define_constant('Matrix') do |klass|
                                    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
                                    klass.inherits(defs.constant_proxy('Matrix::CoercionHelper', RubyLint.registry))
                                    klass.inherits(defs.constant_proxy('ExceptionForMatrix', RubyLint.registry))
                                Severity: Minor
                                Found in lib/ruby-lint/definitions/core/matrix.rb - About 4 hrs to fix

                                  File prime.rb has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  RubyLint.registry.register('Prime') do |defs|
                                    defs.define_constant('Prime') do |klass|
                                      klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
                                      klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
                                  
                                  
                                  Severity: Minor
                                  Found in lib/ruby-lint/definitions/core/prime.rb - About 3 hrs to fix

                                    File array.rb has 299 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    RubyLint.registry.register('Array') do |defs|
                                      defs.define_constant('Array') do |klass|
                                        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
                                        klass.inherits(defs.constant_proxy('JSON::Ext::Generator::GeneratorMethods::Array', RubyLint.registry))
                                        klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
                                    Severity: Minor
                                    Found in lib/ruby-lint/definitions/core/array.rb - About 3 hrs to fix

                                      File ruby_object.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      module RubyLint
                                        module Definition
                                          ##
                                          # The RubyObject class is the base definition class of ruby-lint. These so
                                          # called definition classes are used for storing information about Ruby
                                      Severity: Minor
                                      Found in lib/ruby-lint/definition/ruby_object.rb - About 3 hrs to fix

                                        Method inspect_constants has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def inspect_constants(source = constant, ignore = [])
                                              names          = []
                                              source_name    = source.name
                                              have_children  = []
                                              include_source = source != Object
                                        Severity: Minor
                                        Found in lib/ruby-lint/inspector.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