YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('Mongoid::Atomic::Modifiers') do |klass|
    klass.inherits(defs.constant_proxy('Hash', RubyLint.registry))

    klass.define_instance_method('add_to_set') do |method|
      method.define_argument('modifications')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/core/base64.rb on lines 7..31

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

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

    klass.define_method('decode64') do |method|
      method.define_argument('str')
Severity: Major
Found in lib/ruby-lint/definitions/core/base64.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 271..295

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  defs.define_constant('URI::HTTP') do |klass|
    klass.inherits(defs.constant_proxy('URI::Generic', RubyLint.registry))
    klass.inherits(defs.constant_proxy('OpenURI::OpenRead', RubyLint.registry))

    klass.define_method('build') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/core/uri.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/core/uri.rb on lines 779..799

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

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

    klass.define_instance_method('[]') do |method|
      method.define_argument('type')
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 2222..2247

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

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 lookup has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

      def lookup(type, name, lookup_parent = true, exclude = [])
        type, name = prepare_lookup(type, name)
        found      = nil

        if defines?(type, name)
Severity: Minor
Found in lib/ruby-lint/definition/ruby_object.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  defs.define_constant('Mongoid::Relations::Metadata::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/gems/mongoid.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/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('BasicSocket::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/basic_socket.rb and 9 other locations - About 1 hr to fix
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
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::HashWithIndifferentAccess::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 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 13 locations. Consider refactoring.
Open

  defs.define_constant('ActiveSupport::InheritableOptions::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 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 13 locations. Consider refactoring.
Open

  defs.define_constant('Syck::SpecialHash::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/syck.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/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('Socket::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/socket.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/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('File::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/file.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/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
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('Mongoid::Atomic::Modifiers::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/gems/mongoid.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 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 13 locations. Consider refactoring.
Open

  defs.define_constant('ActionController::Parameters::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/action_controller.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/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('IO::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/io.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/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
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('Syck::Set::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/syck.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 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('TCPServer::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/tcpserver.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/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 13 locations. Consider refactoring.
Open

  defs.define_constant('OptionParser::CompletingHash::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 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
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('Hash::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/hash.rb and 12 other locations - About 1 hr to fix
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
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('UNIXServer::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/unixserver.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/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

Severity
Category
Status
Source
Language