YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('ActiveRecord::SchemaMigration::CollectionAssociation') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Associations::Association', RubyLint.registry))

    klass.define_instance_method('add_to_target') do |method|
      method.define_argument('record')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 6 hrs to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 461..567
lib/ruby-lint/definitions/rails/active_record.rb on lines 2109..2215

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

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

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

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

      defs.define_constant('RSpec::SharedContext') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('record') do |method|
          method.define_argument('methods')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/rspec.rb and 1 other location - About 6 hrs to fix
    lib/ruby-lint/definitions/gems/rspec.rb on lines 8095..8175

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

    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

      defs.define_constant('RSpec::Core::SharedContext') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('record') do |method|
          method.define_argument('methods')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/rspec.rb and 1 other location - About 6 hrs to fix
    lib/ruby-lint/definitions/gems/rspec.rb on lines 9339..9419

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

    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

      defs.define_constant('ActiveRecord::Base::JoinDependency') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('alias_tracker')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/rails/active_record.rb and 1 other location - About 5 hrs to fix
    lib/ruby-lint/definitions/rails/active_record.rb on lines 10280..10360

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

    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

      defs.define_constant('ActiveRecord::SchemaMigration::JoinDependency') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('alias_tracker')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/rails/active_record.rb and 1 other location - About 5 hrs to fix
    lib/ruby-lint/definitions/rails/active_record.rb on lines 2630..2710

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

    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

    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

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

            defs.define_constant('FileUtils::Verbose::Entry_') do |klass|
              klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
              klass.inherits(defs.constant_proxy('FileUtils::StreamUtils_', RubyLint.registry))
          
              klass.define_instance_method('blockdev?')
          Severity: Major
          Found in lib/ruby-lint/definitions/core/file_utils.rb and 1 other location - About 5 hrs to fix
          lib/ruby-lint/definitions/core/file_utils.rb on lines 468..555

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

          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

            defs.define_constant('FileUtils::Entry_') do |klass|
              klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
              klass.inherits(defs.constant_proxy('FileUtils::StreamUtils_', RubyLint.registry))
          
              klass.define_instance_method('blockdev?')
          Severity: Major
          Found in lib/ruby-lint/definitions/core/file_utils.rb and 1 other location - About 5 hrs to fix
          lib/ruby-lint/definitions/core/file_utils.rb on lines 1162..1249

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

          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

            defs.define_constant('Mongoid::Contextual::Memory') do |klass|
              klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
              klass.inherits(defs.constant_proxy('Mongoid::Positional', RubyLint.registry))
              klass.inherits(defs.constant_proxy('Mongoid::Contextual::Queryable', RubyLint.registry))
              klass.inherits(defs.constant_proxy('Mongoid::Relations::Eager', RubyLint.registry))
          Severity: Major
          Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 5 hrs to fix
          lib/ruby-lint/definitions/gems/mongoid.rb on lines 2806..2879

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

          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

            defs.define_constant('Mongoid::Criteria::Memory') do |klass|
              klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
              klass.inherits(defs.constant_proxy('Mongoid::Positional', RubyLint.registry))
              klass.inherits(defs.constant_proxy('Mongoid::Contextual::Queryable', RubyLint.registry))
              klass.inherits(defs.constant_proxy('Mongoid::Relations::Eager', RubyLint.registry))
          Severity: Major
          Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 5 hrs to fix
          lib/ruby-lint/definitions/gems/mongoid.rb on lines 1691..1764

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

          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

          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

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

              defs.define_constant('ActionDispatch::TestRequest::Session') do |klass|
                klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            
                klass.define_method('create') do |method|
                  method.define_argument('store')
            Severity: Major
            Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 1 other location - About 5 hrs to fix
            lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3547..3625

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

            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

              defs.define_constant('ActionDispatch::Request::Session') do |klass|
                klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            
                klass.define_method('create') do |method|
                  method.define_argument('store')
            Severity: Major
            Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 1 other location - About 5 hrs to fix
            lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 4325..4403

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

            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 9 locations. Consider refactoring.
            Open

              defs.define_constant('Socket::InternalBuffer') do |klass|
                klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            
                klass.define_method('allocate')
            
            
            Severity: Major
            Found in lib/ruby-lint/definitions/core/socket.rb and 8 other locations - About 4 hrs to fix
            lib/ruby-lint/definitions/core/basic_socket.rb on lines 323..402
            lib/ruby-lint/definitions/core/file.rb on lines 759..838
            lib/ruby-lint/definitions/core/ipsocket.rb on lines 277..356
            lib/ruby-lint/definitions/core/tcpserver.rb on lines 264..343
            lib/ruby-lint/definitions/core/tcpsocket.rb on lines 278..357
            lib/ruby-lint/definitions/core/udpsocket.rb on lines 279..358
            lib/ruby-lint/definitions/core/unixserver.rb on lines 263..342
            lib/ruby-lint/definitions/core/unixsocket.rb on lines 292..371

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

            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 9 locations. Consider refactoring.
            Open

              defs.define_constant('UNIXSocket::InternalBuffer') do |klass|
                klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            
                klass.define_method('allocate')
            
            
            Severity: Major
            Found in lib/ruby-lint/definitions/core/unixsocket.rb and 8 other locations - About 4 hrs to fix
            lib/ruby-lint/definitions/core/basic_socket.rb on lines 323..402
            lib/ruby-lint/definitions/core/file.rb on lines 759..838
            lib/ruby-lint/definitions/core/ipsocket.rb on lines 277..356
            lib/ruby-lint/definitions/core/socket.rb on lines 2279..2358
            lib/ruby-lint/definitions/core/tcpserver.rb on lines 264..343
            lib/ruby-lint/definitions/core/tcpsocket.rb on lines 278..357
            lib/ruby-lint/definitions/core/udpsocket.rb on lines 279..358
            lib/ruby-lint/definitions/core/unixserver.rb on lines 263..342

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

            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 9 locations. Consider refactoring.
            Open

              defs.define_constant('TCPSocket::InternalBuffer') do |klass|
                klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            
                klass.define_method('allocate')
            
            
            Severity: Major
            Found in lib/ruby-lint/definitions/core/tcpsocket.rb and 8 other locations - About 4 hrs to fix
            lib/ruby-lint/definitions/core/basic_socket.rb on lines 323..402
            lib/ruby-lint/definitions/core/file.rb on lines 759..838
            lib/ruby-lint/definitions/core/ipsocket.rb on lines 277..356
            lib/ruby-lint/definitions/core/socket.rb on lines 2279..2358
            lib/ruby-lint/definitions/core/tcpserver.rb on lines 264..343
            lib/ruby-lint/definitions/core/udpsocket.rb on lines 279..358
            lib/ruby-lint/definitions/core/unixserver.rb on lines 263..342
            lib/ruby-lint/definitions/core/unixsocket.rb on lines 292..371

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

            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 9 locations. Consider refactoring.
            Open

              defs.define_constant('UDPSocket::InternalBuffer') do |klass|
                klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            
                klass.define_method('allocate')
            
            
            Severity: Major
            Found in lib/ruby-lint/definitions/core/udpsocket.rb and 8 other locations - About 4 hrs to fix
            lib/ruby-lint/definitions/core/basic_socket.rb on lines 323..402
            lib/ruby-lint/definitions/core/file.rb on lines 759..838
            lib/ruby-lint/definitions/core/ipsocket.rb on lines 277..356
            lib/ruby-lint/definitions/core/socket.rb on lines 2279..2358
            lib/ruby-lint/definitions/core/tcpserver.rb on lines 264..343
            lib/ruby-lint/definitions/core/tcpsocket.rb on lines 278..357
            lib/ruby-lint/definitions/core/unixserver.rb on lines 263..342
            lib/ruby-lint/definitions/core/unixsocket.rb on lines 292..371

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

            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