YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('jruby?') do |method|
      method.define_optional_argument('platform')
Severity: Major
Found in lib/ruby-lint/definitions/gems/minitest.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1350..1370
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8885..8905
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2618..2638

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

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

  defs.define_constant('Mongoid::Validatable::Macros') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('validates_associated') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/minitest.rb on lines 386..406
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1350..1370
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2618..2638

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

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('Celluloid::Links') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('<<') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2612..2632

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

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('Arel::Nodes::InsertStatement') do |klass|
    klass.inherits(defs.constant_proxy('Arel::Nodes::Node', RubyLint.registry))

    klass.define_instance_method('==') do |method|
      method.define_argument('other')
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4127..4152

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

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('Resolv::DNS::Resource::MX') do |klass|
    klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))

    klass.define_method('decode_rdata') do |method|
      method.define_argument('msg')
Severity: Major
Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/core/resolv.rb on lines 1016..1036

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

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('Resolv::DNS::Resource::HINFO::MX') do |klass|
    klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))

    klass.define_method('decode_rdata') do |method|
      method.define_argument('msg')
Severity: Major
Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/core/resolv.rb on lines 1143..1163

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

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::Extensions::Hash') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('__consolidate__') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/rails/arel.rb on lines 3590..3615

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

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('DRb::DRbURIOption') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('==') do |method|
      method.define_argument('other')
Severity: Major
Found in lib/ruby-lint/definitions/core/drb.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/rails/arel.rb on lines 4415..4436

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

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('ActiveSupport::OrderedOptions') do |klass|
    klass.inherits(defs.constant_proxy('Hash', RubyLint.registry))

    klass.define_instance_method('[]') do |method|
      method.define_argument('key')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 3106..3124

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

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::Formatters::Helpers') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('format_duration') do |method|
      method.define_argument('duration')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_support.rb on lines 3848..3866

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

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

Method generate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def generate
      constants = inspector.inspect_constants(
        inspector.constant,
        options[:ignore].dup
      )
Severity: Minor
Found in lib/ruby-lint/definition_generator.rb - About 1 hr to fix

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

      defs.define_constant('TCPServer::EachReader') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('each')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/tcpserver.rb and 9 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 165..185
    lib/ruby-lint/definitions/core/file.rb on lines 596..616
    lib/ruby-lint/definitions/core/io.rb on lines 507..527
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 119..139
    lib/ruby-lint/definitions/core/socket.rb on lines 1487..1507
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 120..140
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 121..141
    lib/ruby-lint/definitions/core/unixserver.rb on lines 105..125
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 134..154

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

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

      defs.define_constant('File::EachReader') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('each')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/file.rb and 9 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 165..185
    lib/ruby-lint/definitions/core/io.rb on lines 507..527
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 119..139
    lib/ruby-lint/definitions/core/socket.rb on lines 1487..1507
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 106..126
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 120..140
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 121..141
    lib/ruby-lint/definitions/core/unixserver.rb on lines 105..125
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 134..154

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

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

      defs.define_constant('IPSocket::EachReader') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('each')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/ipsocket.rb and 9 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 165..185
    lib/ruby-lint/definitions/core/file.rb on lines 596..616
    lib/ruby-lint/definitions/core/io.rb on lines 507..527
    lib/ruby-lint/definitions/core/socket.rb on lines 1487..1507
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 106..126
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 120..140
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 121..141
    lib/ruby-lint/definitions/core/unixserver.rb on lines 105..125
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 134..154

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

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

      defs.define_constant('TCPSocket::EachReader') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('each')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/tcpsocket.rb and 9 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 165..185
    lib/ruby-lint/definitions/core/file.rb on lines 596..616
    lib/ruby-lint/definitions/core/io.rb on lines 507..527
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 119..139
    lib/ruby-lint/definitions/core/socket.rb on lines 1487..1507
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 106..126
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 121..141
    lib/ruby-lint/definitions/core/unixserver.rb on lines 105..125
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 134..154

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

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

      defs.define_constant('IO::EachReader') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('each')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/io.rb and 9 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 165..185
    lib/ruby-lint/definitions/core/file.rb on lines 596..616
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 119..139
    lib/ruby-lint/definitions/core/socket.rb on lines 1487..1507
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 106..126
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 120..140
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 121..141
    lib/ruby-lint/definitions/core/unixserver.rb on lines 105..125
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 134..154

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

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

      defs.define_constant('BasicSocket::EachReader') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('each')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/basic_socket.rb and 9 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/file.rb on lines 596..616
    lib/ruby-lint/definitions/core/io.rb on lines 507..527
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 119..139
    lib/ruby-lint/definitions/core/socket.rb on lines 1487..1507
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 106..126
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 120..140
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 121..141
    lib/ruby-lint/definitions/core/unixserver.rb on lines 105..125
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 134..154

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

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

      defs.define_constant('UNIXSocket::EachReader') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('each')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/unixsocket.rb and 9 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 165..185
    lib/ruby-lint/definitions/core/file.rb on lines 596..616
    lib/ruby-lint/definitions/core/io.rb on lines 507..527
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 119..139
    lib/ruby-lint/definitions/core/socket.rb on lines 1487..1507
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 106..126
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 120..140
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 121..141
    lib/ruby-lint/definitions/core/unixserver.rb on lines 105..125

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

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

      defs.define_constant('Socket::EachReader') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('each')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/socket.rb and 9 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 165..185
    lib/ruby-lint/definitions/core/file.rb on lines 596..616
    lib/ruby-lint/definitions/core/io.rb on lines 507..527
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 119..139
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 106..126
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 120..140
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 121..141
    lib/ruby-lint/definitions/core/unixserver.rb on lines 105..125
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 134..154

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

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

      defs.define_constant('UNIXServer::EachReader') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('each')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/unixserver.rb and 9 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 165..185
    lib/ruby-lint/definitions/core/file.rb on lines 596..616
    lib/ruby-lint/definitions/core/io.rb on lines 507..527
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 119..139
    lib/ruby-lint/definitions/core/socket.rb on lines 1487..1507
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 106..126
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 120..140
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 121..141
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 134..154

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

    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