YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('URI::Parser') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('URI::REGEXP', RubyLint.registry))

    klass.define_instance_method('escape') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/core/uri.rb and 1 other location - About 3 hrs to fix
lib/ruby-lint/definitions/core/uri.rb on lines 938..982

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

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

  defs.define_constant('JSON::Ext::Generator::State') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/json.rb and 2 other locations - About 3 hrs to fix
lib/ruby-lint/definitions/core/json.rb on lines 438..505
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2204..2271

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

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('URI::HTTPS::Parser') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('URI::REGEXP', RubyLint.registry))

    klass.define_instance_method('escape') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/core/uri.rb and 1 other location - About 3 hrs to fix
lib/ruby-lint/definitions/core/uri.rb on lines 1211..1255

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

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

  defs.define_constant('OpenSSL::PKCS7') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 2 other locations - About 3 hrs to fix
lib/ruby-lint/definitions/core/json.rb on lines 218..285
lib/ruby-lint/definitions/core/json.rb on lines 438..505

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

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

  defs.define_constant('ActiveRecord::SchemaMigration::ThroughReflection') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Reflection::AssociationReflection', RubyLint.registry))

    klass.define_instance_method('active_record_primary_key') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 3 hrs to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 2983..3032
lib/ruby-lint/definitions/rails/active_record.rb on lines 8436..8485

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

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

  defs.define_constant('ActiveRecord::Reflection::ThroughReflection') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Reflection::AssociationReflection', RubyLint.registry))

    klass.define_instance_method('active_record_primary_key') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 3 hrs to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 2983..3032
lib/ruby-lint/definitions/rails/active_record.rb on lines 10633..10682

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

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

  defs.define_constant('ActiveRecord::Base::ThroughReflection') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Reflection::AssociationReflection', RubyLint.registry))

    klass.define_instance_method('active_record_primary_key') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 3 hrs to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 8436..8485
lib/ruby-lint/definitions/rails/active_record.rb on lines 10633..10682

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

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::TextSearch') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Mongoid::Contextual::Command', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 3 hrs to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2267..2308

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

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::TextSearch') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Mongoid::Contextual::Command', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 3 hrs to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3178..3219

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

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

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

      defs.define_constant('Test::Unit::TestCase::Checker') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('available_priorities')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/test.rb and 1 other location - About 3 hrs to fix
    lib/ruby-lint/definitions/gems/test.rb on lines 1866..1915

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

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

      defs.define_constant('ActiveRecord::Base::UniquenessValidator') do |klass|
        klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))
    
        klass.define_instance_method('build_relation') do |method|
          method.define_argument('klass')
    Severity: Major
    Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 3 hrs to fix
    lib/ruby-lint/definitions/rails/active_record.rb on lines 10722..10761
    lib/ruby-lint/definitions/rails/active_record.rb on lines 11754..11793

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

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

      defs.define_constant('ActiveRecord::SchemaMigration::UniquenessValidator') do |klass|
        klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))
    
        klass.define_instance_method('build_relation') do |method|
          method.define_argument('klass')
    Severity: Major
    Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 3 hrs to fix
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3072..3111
    lib/ruby-lint/definitions/rails/active_record.rb on lines 11754..11793

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

    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('Test::Unit::Priority::Checker') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('available_priorities')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/test.rb and 1 other location - About 3 hrs to fix
    lib/ruby-lint/definitions/gems/test.rb on lines 2142..2191

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

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

      defs.define_constant('ActiveRecord::Validations::UniquenessValidator') do |klass|
        klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))
    
        klass.define_instance_method('build_relation') do |method|
          method.define_argument('klass')
    Severity: Major
    Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 3 hrs to fix
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3072..3111
    lib/ruby-lint/definitions/rails/active_record.rb on lines 10722..10761

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

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

      defs.define_constant('UNIXSocket::FFI') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('add_typedef') do |method|
          method.define_argument('current')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/unixsocket.rb and 14 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 228..269
    lib/ruby-lint/definitions/core/errno.rb on lines 1960..2001
    lib/ruby-lint/definitions/core/etc.rb on lines 45..86
    lib/ruby-lint/definitions/core/file.rb on lines 659..700
    lib/ruby-lint/definitions/core/float.rb on lines 181..222
    lib/ruby-lint/definitions/core/io.rb on lines 570..611
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 182..223
    lib/ruby-lint/definitions/core/math.rb on lines 133..174
    lib/ruby-lint/definitions/core/process.rb on lines 325..366
    lib/ruby-lint/definitions/core/socket.rb on lines 1550..1591
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 169..210
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 183..224
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 184..225
    lib/ruby-lint/definitions/core/unixserver.rb on lines 168..209

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

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

      defs.define_constant('IO::FFI') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('add_typedef') do |method|
          method.define_argument('current')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/io.rb and 14 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 228..269
    lib/ruby-lint/definitions/core/errno.rb on lines 1960..2001
    lib/ruby-lint/definitions/core/etc.rb on lines 45..86
    lib/ruby-lint/definitions/core/file.rb on lines 659..700
    lib/ruby-lint/definitions/core/float.rb on lines 181..222
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 182..223
    lib/ruby-lint/definitions/core/math.rb on lines 133..174
    lib/ruby-lint/definitions/core/process.rb on lines 325..366
    lib/ruby-lint/definitions/core/socket.rb on lines 1550..1591
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 169..210
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 183..224
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 184..225
    lib/ruby-lint/definitions/core/unixserver.rb on lines 168..209
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 197..238

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

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

      defs.define_constant('Etc::FFI') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('add_typedef') do |method|
          method.define_argument('current')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/etc.rb and 14 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 228..269
    lib/ruby-lint/definitions/core/errno.rb on lines 1960..2001
    lib/ruby-lint/definitions/core/file.rb on lines 659..700
    lib/ruby-lint/definitions/core/float.rb on lines 181..222
    lib/ruby-lint/definitions/core/io.rb on lines 570..611
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 182..223
    lib/ruby-lint/definitions/core/math.rb on lines 133..174
    lib/ruby-lint/definitions/core/process.rb on lines 325..366
    lib/ruby-lint/definitions/core/socket.rb on lines 1550..1591
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 169..210
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 183..224
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 184..225
    lib/ruby-lint/definitions/core/unixserver.rb on lines 168..209
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 197..238

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

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

      defs.define_constant('Socket::FFI') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('add_typedef') do |method|
          method.define_argument('current')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/socket.rb and 14 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 228..269
    lib/ruby-lint/definitions/core/errno.rb on lines 1960..2001
    lib/ruby-lint/definitions/core/etc.rb on lines 45..86
    lib/ruby-lint/definitions/core/file.rb on lines 659..700
    lib/ruby-lint/definitions/core/float.rb on lines 181..222
    lib/ruby-lint/definitions/core/io.rb on lines 570..611
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 182..223
    lib/ruby-lint/definitions/core/math.rb on lines 133..174
    lib/ruby-lint/definitions/core/process.rb on lines 325..366
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 169..210
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 183..224
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 184..225
    lib/ruby-lint/definitions/core/unixserver.rb on lines 168..209
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 197..238

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

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

      defs.define_constant('Process::FFI') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('add_typedef') do |method|
          method.define_argument('current')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/process.rb and 14 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 228..269
    lib/ruby-lint/definitions/core/errno.rb on lines 1960..2001
    lib/ruby-lint/definitions/core/etc.rb on lines 45..86
    lib/ruby-lint/definitions/core/file.rb on lines 659..700
    lib/ruby-lint/definitions/core/float.rb on lines 181..222
    lib/ruby-lint/definitions/core/io.rb on lines 570..611
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 182..223
    lib/ruby-lint/definitions/core/math.rb on lines 133..174
    lib/ruby-lint/definitions/core/socket.rb on lines 1550..1591
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 169..210
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 183..224
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 184..225
    lib/ruby-lint/definitions/core/unixserver.rb on lines 168..209
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 197..238

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

    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