YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('from')
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 505..525
lib/ruby-lint/definitions/core/file.rb on lines 1467..1487
lib/ruby-lint/definitions/core/io.rb on lines 765..785
lib/ruby-lint/definitions/core/ipsocket.rb on lines 459..479
lib/ruby-lint/definitions/core/socket.rb on lines 3145..3165
lib/ruby-lint/definitions/core/tcpserver.rb on lines 446..466
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 460..480
lib/ruby-lint/definitions/core/udpsocket.rb on lines 461..481
lib/ruby-lint/definitions/core/unixserver.rb on lines 445..465

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

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

  defs.define_constant('Sprockets::Railtie::OrderedOptions::State') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('from') do |method|
      method.define_argument('state')
Severity: Major
Found in lib/ruby-lint/definitions/rails/sprockets.rb and 12 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/hash.rb on lines 509..535
lib/ruby-lint/definitions/core/option_parser.rb on lines 576..602
lib/ruby-lint/definitions/core/option_parser.rb on lines 1046..1072
lib/ruby-lint/definitions/core/syck.rb on lines 914..940
lib/ruby-lint/definitions/core/syck.rb on lines 1216..1242
lib/ruby-lint/definitions/gems/mongoid.rb on lines 588..614
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7377..7403
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2205..2231
lib/ruby-lint/definitions/rails/active_support.rb on lines 2158..2184
lib/ruby-lint/definitions/rails/active_support.rb on lines 2592..2618
lib/ruby-lint/definitions/rails/active_support.rb on lines 3819..3845
lib/ruby-lint/definitions/rails/active_support.rb on lines 4123..4149

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

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

  defs.define_constant('OptionParser::OptionMap::State') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('from') do |method|
      method.define_argument('state')
Severity: Major
Found in lib/ruby-lint/definitions/core/option_parser.rb and 12 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/hash.rb on lines 509..535
lib/ruby-lint/definitions/core/option_parser.rb on lines 576..602
lib/ruby-lint/definitions/core/syck.rb on lines 914..940
lib/ruby-lint/definitions/core/syck.rb on lines 1216..1242
lib/ruby-lint/definitions/gems/mongoid.rb on lines 588..614
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7377..7403
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2205..2231
lib/ruby-lint/definitions/rails/active_support.rb on lines 2158..2184
lib/ruby-lint/definitions/rails/active_support.rb on lines 2592..2618
lib/ruby-lint/definitions/rails/active_support.rb on lines 3819..3845
lib/ruby-lint/definitions/rails/active_support.rb on lines 4123..4149
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1583..1609

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('from')
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 505..525
lib/ruby-lint/definitions/core/file.rb on lines 1467..1487
lib/ruby-lint/definitions/core/io.rb on lines 765..785
lib/ruby-lint/definitions/core/socket.rb on lines 3145..3165
lib/ruby-lint/definitions/core/tcpserver.rb on lines 446..466
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 460..480
lib/ruby-lint/definitions/core/udpsocket.rb on lines 461..481
lib/ruby-lint/definitions/core/unixserver.rb on lines 445..465
lib/ruby-lint/definitions/core/unixsocket.rb on lines 474..494

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('from')
Severity: Major
Found in lib/ruby-lint/definitions/core/udpsocket.rb and 9 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/basic_socket.rb on lines 505..525
lib/ruby-lint/definitions/core/file.rb on lines 1467..1487
lib/ruby-lint/definitions/core/io.rb on lines 765..785
lib/ruby-lint/definitions/core/ipsocket.rb on lines 459..479
lib/ruby-lint/definitions/core/socket.rb on lines 3145..3165
lib/ruby-lint/definitions/core/tcpserver.rb on lines 446..466
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 460..480
lib/ruby-lint/definitions/core/unixserver.rb on lines 445..465
lib/ruby-lint/definitions/core/unixsocket.rb on lines 474..494

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('from')
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 505..525
lib/ruby-lint/definitions/core/file.rb on lines 1467..1487
lib/ruby-lint/definitions/core/io.rb on lines 765..785
lib/ruby-lint/definitions/core/ipsocket.rb on lines 459..479
lib/ruby-lint/definitions/core/socket.rb on lines 3145..3165
lib/ruby-lint/definitions/core/tcpserver.rb on lines 446..466
lib/ruby-lint/definitions/core/udpsocket.rb on lines 461..481
lib/ruby-lint/definitions/core/unixserver.rb on lines 445..465
lib/ruby-lint/definitions/core/unixsocket.rb on lines 474..494

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

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

  defs.define_constant('ActiveSupport::OrderedOptions::State') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('from') do |method|
      method.define_argument('state')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 12 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/hash.rb on lines 509..535
lib/ruby-lint/definitions/core/option_parser.rb on lines 576..602
lib/ruby-lint/definitions/core/option_parser.rb on lines 1046..1072
lib/ruby-lint/definitions/core/syck.rb on lines 914..940
lib/ruby-lint/definitions/core/syck.rb on lines 1216..1242
lib/ruby-lint/definitions/gems/mongoid.rb on lines 588..614
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7377..7403
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2205..2231
lib/ruby-lint/definitions/rails/active_support.rb on lines 2158..2184
lib/ruby-lint/definitions/rails/active_support.rb on lines 2592..2618
lib/ruby-lint/definitions/rails/active_support.rb on lines 3819..3845
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1583..1609

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

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

  defs.define_constant('ActiveSupport::OrderedHash::State') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('from') do |method|
      method.define_argument('state')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 12 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/hash.rb on lines 509..535
lib/ruby-lint/definitions/core/option_parser.rb on lines 576..602
lib/ruby-lint/definitions/core/option_parser.rb on lines 1046..1072
lib/ruby-lint/definitions/core/syck.rb on lines 914..940
lib/ruby-lint/definitions/core/syck.rb on lines 1216..1242
lib/ruby-lint/definitions/gems/mongoid.rb on lines 588..614
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7377..7403
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2205..2231
lib/ruby-lint/definitions/rails/active_support.rb on lines 2158..2184
lib/ruby-lint/definitions/rails/active_support.rb on lines 2592..2618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4123..4149
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1583..1609

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

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

    klass.define_instance_method('close')

Severity: Major
Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/resolv.rb on lines 648..668
lib/ruby-lint/definitions/core/resolv.rb on lines 685..705

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

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

    klass.define_instance_method('close')

Severity: Major
Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/resolv.rb on lines 648..668
lib/ruby-lint/definitions/core/resolv.rb on lines 749..769

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

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

    klass.define_instance_method('after_append_callbacks')

Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/test.rb on lines 1573..1596

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

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

    klass.define_instance_method('close')

Severity: Major
Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/resolv.rb on lines 685..705
lib/ruby-lint/definitions/core/resolv.rb on lines 749..769

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

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

    klass.define_instance_method('after_append_callbacks')

Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/test.rb on lines 2250..2273

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

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

    klass.define_instance_method('criteria')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1434..1455

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

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

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

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

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

    klass.define_method('create') do |method|
      method.define_argument('type_value')
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 963..984

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

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

    klass.define_instance_method('_field_changed?') do |method|
      method.define_argument('attr')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 1912..1933

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

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

    klass.define_instance_method('<<') do |method|
      method.define_argument('value')
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 3714..3739

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

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

    klass.define_instance_method('<<') do |method|
      method.define_argument('value')
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 2945..2970

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

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

    klass.define_instance_method('criteria')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2623..2644

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

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