YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('RSpec::Core::AnonymousExampleGroup::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('let') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 6 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6393..6413
lib/ruby-lint/definitions/gems/rspec.rb on lines 1868..1888
lib/ruby-lint/definitions/gems/rspec.rb on lines 5133..5153
lib/ruby-lint/definitions/gems/rspec.rb on lines 9756..9776
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2636..2656
lib/ruby-lint/definitions/rails/active_record.rb on lines 5390..5410

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

  defs.define_constant('RSpec::Support::Warnings') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('deprecate') do |method|
      method.define_argument('deprecated')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 6 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6393..6413
lib/ruby-lint/definitions/gems/rspec.rb on lines 133..153
lib/ruby-lint/definitions/gems/rspec.rb on lines 1868..1888
lib/ruby-lint/definitions/gems/rspec.rb on lines 5133..5153
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2636..2656
lib/ruby-lint/definitions/rails/active_record.rb on lines 5390..5410

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

  defs.define_constant('Mongoid::Relations::CounterCache::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('decrement_counter') do |method|
      method.define_argument('counter_name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 6 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 133..153
lib/ruby-lint/definitions/gems/rspec.rb on lines 1868..1888
lib/ruby-lint/definitions/gems/rspec.rb on lines 5133..5153
lib/ruby-lint/definitions/gems/rspec.rb on lines 9756..9776
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2636..2656
lib/ruby-lint/definitions/rails/active_record.rb on lines 5390..5410

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

  defs.define_constant('ActiveRecord::CounterCache::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('decrement_counter') do |method|
      method.define_argument('counter_name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 6 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6393..6413
lib/ruby-lint/definitions/gems/rspec.rb on lines 133..153
lib/ruby-lint/definitions/gems/rspec.rb on lines 1868..1888
lib/ruby-lint/definitions/gems/rspec.rb on lines 5133..5153
lib/ruby-lint/definitions/gems/rspec.rb on lines 9756..9776
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2636..2656

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

  defs.define_constant('RSpec::Core::MemoizedHelpers::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('let') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 6 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6393..6413
lib/ruby-lint/definitions/gems/rspec.rb on lines 133..153
lib/ruby-lint/definitions/gems/rspec.rb on lines 1868..1888
lib/ruby-lint/definitions/gems/rspec.rb on lines 9756..9776
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2636..2656
lib/ruby-lint/definitions/rails/active_record.rb on lines 5390..5410

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

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

    klass.define_method('dom_class') do |method|
      method.define_argument('record')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 6 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6393..6413
lib/ruby-lint/definitions/gems/rspec.rb on lines 133..153
lib/ruby-lint/definitions/gems/rspec.rb on lines 1868..1888
lib/ruby-lint/definitions/gems/rspec.rb on lines 5133..5153
lib/ruby-lint/definitions/gems/rspec.rb on lines 9756..9776
lib/ruby-lint/definitions/rails/active_record.rb on lines 5390..5410

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

  defs.define_constant('RSpec::Core::ExampleGroup::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('let') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 6 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6393..6413
lib/ruby-lint/definitions/gems/rspec.rb on lines 133..153
lib/ruby-lint/definitions/gems/rspec.rb on lines 5133..5153
lib/ruby-lint/definitions/gems/rspec.rb on lines 9756..9776
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2636..2656
lib/ruby-lint/definitions/rails/active_record.rb on lines 5390..5410

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

  defs.define_constant('ActiveRecord::SchemaMigration::SingularAssociation') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Associations::Association', RubyLint.registry))

    klass.define_instance_method('build') do |method|
      method.define_optional_argument('attributes')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 7799..7821
lib/ruby-lint/definitions/rails/active_record.rb on lines 660..682
lib/ruby-lint/definitions/rails/active_record.rb on lines 2936..2958

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

  defs.define_constant('ActiveRecord::Base::SingularAssociation') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Associations::Association', RubyLint.registry))

    klass.define_instance_method('build') do |method|
      method.define_optional_argument('attributes')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 7799..7821
lib/ruby-lint/definitions/rails/active_record.rb on lines 660..682
lib/ruby-lint/definitions/rails/active_record.rb on lines 10586..10608

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

  defs.define_constant('ActionDispatch::Cookies::PermanentCookieJar') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('ActionDispatch::Cookies::ChainedCookieJars', RubyLint.registry))

    klass.define_instance_method('[]') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 545..563
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 619..637

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

  defs.define_constant('RSpec::Core::Notifications::StartNotification') do |klass|
    klass.inherits(defs.constant_proxy('Struct', RubyLint.registry))

    klass.define_method('[]') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 947..971
lib/ruby-lint/definitions/gems/rspec.rb on lines 2269..2293
lib/ruby-lint/definitions/gems/rspec.rb on lines 4547..4571

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

  defs.define_constant('ActiveRecord::Associations::SingularAssociation') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Associations::Association', RubyLint.registry))

    klass.define_instance_method('build') do |method|
      method.define_optional_argument('attributes')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 7799..7821
lib/ruby-lint/definitions/rails/active_record.rb on lines 2936..2958
lib/ruby-lint/definitions/rails/active_record.rb on lines 10586..10608

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

  defs.define_constant('RSpec::Core::Formatters::BisectFormatter::RunResults') do |klass|
    klass.inherits(defs.constant_proxy('Struct', RubyLint.registry))

    klass.define_method('[]') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 947..971
lib/ruby-lint/definitions/gems/rspec.rb on lines 4547..4571
lib/ruby-lint/definitions/gems/rspec.rb on lines 7250..7274

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

  defs.define_constant('RSpec::Core::Pending') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('mark_fixed!') do |method|
      method.define_argument('example')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 660..682
lib/ruby-lint/definitions/rails/active_record.rb on lines 2936..2958
lib/ruby-lint/definitions/rails/active_record.rb on lines 10586..10608

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

  defs.define_constant('ActionDispatch::Cookies::SignedCookieJar') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('ActionDispatch::Cookies::ChainedCookieJars', RubyLint.registry))

    klass.define_instance_method('[]') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 545..563
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 582..600

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

  defs.define_constant('RSpec::Core::Hooks::Hook') do |klass|
    klass.inherits(defs.constant_proxy('Struct', RubyLint.registry))

    klass.define_method('[]') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 947..971
lib/ruby-lint/definitions/gems/rspec.rb on lines 2269..2293
lib/ruby-lint/definitions/gems/rspec.rb on lines 7250..7274

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

  defs.define_constant('ActionDispatch::Cookies::EncryptedCookieJar') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('ActionDispatch::Cookies::ChainedCookieJars', RubyLint.registry))

    klass.define_instance_method('[]') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 582..600
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 619..637

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::TestCase::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 1545..1570

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

  defs.define_constant('RSpec::Core::Configuration::Hook') do |klass|
    klass.inherits(defs.constant_proxy('Struct', RubyLint.registry))

    klass.define_method('[]') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 2269..2293
lib/ruby-lint/definitions/gems/rspec.rb on lines 4547..4571
lib/ruby-lint/definitions/gems/rspec.rb on lines 7250..7274

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::HTTPS::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 397..417

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

Severity
Category
Status
Source
Language