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

    klass.define_instance_method('chain_id')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 2 hrs to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 4285..4317

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

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

    klass.define_instance_method('chain_id')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 2 hrs to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3168..3200

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

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

    klass.define_instance_method('each_loaded_document')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2020..2052
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6463..6495

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

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

    klass.define_instance_method('cache') do |method|
      method.define_optional_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_view.rb on lines 540..565
lib/ruby-lint/definitions/rails/action_view.rb on lines 2337..2362

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

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

    klass.define_instance_method('cache') do |method|
      method.define_optional_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_view.rb on lines 2337..2362
lib/ruby-lint/definitions/rails/action_view.rb on lines 5400..5425

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

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

    klass.define_instance_method('cache') do |method|
      method.define_optional_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_view.rb on lines 540..565
lib/ruby-lint/definitions/rails/action_view.rb on lines 5400..5425

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

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

    klass.define_instance_method('each_loaded_document')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1768..1800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6463..6495

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

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

    klass.define_instance_method('each_loaded_document')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1768..1800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2020..2052

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

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

    klass.define_method('new') do |method|
      method.define_rest_argument('args')
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 2255..2286

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

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

    klass.define_instance_method('<=>') do |method|
      method.define_argument('other')
Severity: Major
Found in lib/ruby-lint/definitions/core/gem.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1986..2016

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

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

    klass.define_method('new') do |method|
      method.define_rest_argument('args')
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 947..978

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

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('Gem::Source::Installed::SpecificFile') do |klass|
    klass.inherits(defs.constant_proxy('Gem::Source', RubyLint.registry))

    klass.define_instance_method('<=>') do |method|
      method.define_argument('other')
Severity: Major
Found in lib/ruby-lint/definitions/core/gem.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/core/gem.rb on lines 2054..2084

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

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('Test::Unit::Notification') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Test::Unit::Util::BacktraceFilter', RubyLint.registry))

    klass.define_instance_method('critical?')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/test.rb on lines 1696..1727
lib/ruby-lint/definitions/gems/test.rb on lines 1773..1804

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

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('Test::Unit::Pending') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Test::Unit::Util::BacktraceFilter', RubyLint.registry))

    klass.define_instance_method('critical?')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/test.rb on lines 1624..1655
lib/ruby-lint/definitions/gems/test.rb on lines 1696..1727

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

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('Test::Unit::Omission') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Test::Unit::Util::BacktraceFilter', RubyLint.registry))

    klass.define_instance_method('critical?')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/test.rb on lines 1624..1655
lib/ruby-lint/definitions/gems/test.rb on lines 1773..1804

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

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 after_send has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def after_send(node)
      receiver, name, _ = *node

      receiver    = unpack_block(receiver)
      name        = name.to_s
Severity: Minor
Found in lib/ruby-lint/virtual_machine.rb - About 1 hr to fix

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

      defs.define_constant('Rails::Application::Finisher::Initializer') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('after')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/rails/rails.rb and 15 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/gems/devise.rb on lines 1077..1106
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2590..2619
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2961..2990
    lib/ruby-lint/definitions/rails/action_mailer.rb on lines 891..920
    lib/ruby-lint/definitions/rails/action_view.rb on lines 4192..4221
    lib/ruby-lint/definitions/rails/active_model.rb on lines 807..836
    lib/ruby-lint/definitions/rails/active_record.rb on lines 8196..8225
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4274..4303
    lib/ruby-lint/definitions/rails/rails.rb on lines 192..221
    lib/ruby-lint/definitions/rails/rails.rb on lines 490..519
    lib/ruby-lint/definitions/rails/rails.rb on lines 883..912
    lib/ruby-lint/definitions/rails/rails.rb on lines 1433..1462
    lib/ruby-lint/definitions/rails/rails.rb on lines 1912..1941
    lib/ruby-lint/definitions/rails/rails.rb on lines 2049..2078
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 1284..1313

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

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

      defs.define_constant('ActionController::Railtie::Initializer') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('after')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/rails/action_controller.rb and 15 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/gems/devise.rb on lines 1077..1106
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2961..2990
    lib/ruby-lint/definitions/rails/action_mailer.rb on lines 891..920
    lib/ruby-lint/definitions/rails/action_view.rb on lines 4192..4221
    lib/ruby-lint/definitions/rails/active_model.rb on lines 807..836
    lib/ruby-lint/definitions/rails/active_record.rb on lines 8196..8225
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4274..4303
    lib/ruby-lint/definitions/rails/rails.rb on lines 192..221
    lib/ruby-lint/definitions/rails/rails.rb on lines 457..486
    lib/ruby-lint/definitions/rails/rails.rb on lines 490..519
    lib/ruby-lint/definitions/rails/rails.rb on lines 883..912
    lib/ruby-lint/definitions/rails/rails.rb on lines 1433..1462
    lib/ruby-lint/definitions/rails/rails.rb on lines 1912..1941
    lib/ruby-lint/definitions/rails/rails.rb on lines 2049..2078
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 1284..1313

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

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

      defs.define_constant('ActiveRecord::Railtie::Initializer') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('after')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/rails/active_record.rb and 15 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/gems/devise.rb on lines 1077..1106
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2590..2619
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2961..2990
    lib/ruby-lint/definitions/rails/action_mailer.rb on lines 891..920
    lib/ruby-lint/definitions/rails/action_view.rb on lines 4192..4221
    lib/ruby-lint/definitions/rails/active_model.rb on lines 807..836
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4274..4303
    lib/ruby-lint/definitions/rails/rails.rb on lines 192..221
    lib/ruby-lint/definitions/rails/rails.rb on lines 457..486
    lib/ruby-lint/definitions/rails/rails.rb on lines 490..519
    lib/ruby-lint/definitions/rails/rails.rb on lines 883..912
    lib/ruby-lint/definitions/rails/rails.rb on lines 1433..1462
    lib/ruby-lint/definitions/rails/rails.rb on lines 1912..1941
    lib/ruby-lint/definitions/rails/rails.rb on lines 2049..2078
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 1284..1313

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

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

      defs.define_constant('Rails::TestUnitRailtie::Initializer') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('after')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/rails/rails.rb and 15 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/gems/devise.rb on lines 1077..1106
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2590..2619
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2961..2990
    lib/ruby-lint/definitions/rails/action_mailer.rb on lines 891..920
    lib/ruby-lint/definitions/rails/action_view.rb on lines 4192..4221
    lib/ruby-lint/definitions/rails/active_model.rb on lines 807..836
    lib/ruby-lint/definitions/rails/active_record.rb on lines 8196..8225
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4274..4303
    lib/ruby-lint/definitions/rails/rails.rb on lines 192..221
    lib/ruby-lint/definitions/rails/rails.rb on lines 457..486
    lib/ruby-lint/definitions/rails/rails.rb on lines 490..519
    lib/ruby-lint/definitions/rails/rails.rb on lines 883..912
    lib/ruby-lint/definitions/rails/rails.rb on lines 1433..1462
    lib/ruby-lint/definitions/rails/rails.rb on lines 1912..1941
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 1284..1313

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

    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