YorickPeterse/ruby-lint

View on GitHub

Showing 2,084 of 2,162 total issues

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

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

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

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/unixserver.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/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('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('IPSocket::InternalBuffer') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/ipsocket.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/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
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('TCPServer::InternalBuffer') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/tcpserver.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/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('File::InternalBuffer') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/file.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/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
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('BasicSocket::InternalBuffer') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/basic_socket.rb and 8 other locations - About 4 hrs to fix
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
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('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('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

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

  defs.define_constant('Celluloid::IncidentReporter') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Celluloid::Notifications', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Celluloid::InstanceMethods', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Celluloid', RubyLint.registry))
Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 4 hrs to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2448..2508

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

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