YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('OpenSSL::Digest::SHA512') do |klass|
    klass.inherits(defs.constant_proxy('OpenSSL::Digest', RubyLint.registry))

    klass.define_method('digest') do |method|
      method.define_argument('data')
Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 27 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 67..81
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1272..1286
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1290..1304
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1323..1337
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1341..1355
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1359..1373
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1377..1391
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1410..1424
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1428..1442
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1446..1460
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1464..1478
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1482..1496
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1500..1514
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1518..1532
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1536..1550
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1554..1568
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1572..1586
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1590..1604
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1608..1622
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1626..1640
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1644..1658
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1662..1676
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1680..1694
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1698..1712
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1716..1730
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 5825..5839
lib/ruby-lint/definitions/rails/active_support.rb on lines 2724..2738

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

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

  defs.define_constant('OpenSSL::Digest::MD4::SHA512') do |klass|
    klass.inherits(defs.constant_proxy('OpenSSL::Digest', RubyLint.registry))

    klass.define_method('digest') do |method|
      method.define_argument('data')
Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 27 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 67..81
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1272..1286
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1290..1304
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1323..1337
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1341..1355
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1359..1373
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1377..1391
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1410..1424
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1428..1442
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1446..1460
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1464..1478
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1482..1496
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1500..1514
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1518..1532
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1536..1550
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1554..1568
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1590..1604
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1608..1622
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1626..1640
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1644..1658
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1662..1676
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1680..1694
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1698..1712
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1716..1730
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1734..1748
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 5825..5839
lib/ruby-lint/definitions/rails/active_support.rb on lines 2724..2738

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

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

  defs.define_constant('OpenSSL::Digest::SHA384') do |klass|
    klass.inherits(defs.constant_proxy('OpenSSL::Digest', RubyLint.registry))

    klass.define_method('digest') do |method|
      method.define_argument('data')
Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 27 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 67..81
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1272..1286
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1290..1304
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1323..1337
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1341..1355
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1359..1373
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1377..1391
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1410..1424
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1428..1442
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1446..1460
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1464..1478
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1482..1496
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1500..1514
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1518..1532
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1536..1550
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1554..1568
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1572..1586
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1590..1604
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1608..1622
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1626..1640
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1644..1658
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1662..1676
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1680..1694
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1698..1712
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1734..1748
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 5825..5839
lib/ruby-lint/definitions/rails/active_support.rb on lines 2724..2738

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

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

    klass.define_instance_method('find_all') do |method|
      method.define_argument('req')
Severity: Minor
Found in lib/ruby-lint/definitions/core/gem.rb and 1 other location - About 55 mins to fix
lib/ruby-lint/definitions/rails/arel.rb on lines 1295..1309

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

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

    klass.define_instance_method('from') do |method|
      method.define_argument('relation')
Severity: Minor
Found in lib/ruby-lint/definitions/rails/arel.rb and 1 other location - About 55 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1005..1019

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

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

  defs.define_constant('ActiveModel::Railtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('Rails::TestUnitRailtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('Sprockets::Railtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/sprockets.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997

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

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

  defs.define_constant('ActionView::Railtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('Rails::Application::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('Rails::Railtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('ActionController::Railtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('ActiveRecord::Railtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('ActiveSupport::Railtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('Rails::Application::Finisher::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('Devise::Engine::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('Rails::Engine::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('ActionMailer::Railtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_mailer.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('Rails::Application::Bootstrap::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2896..2909
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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

  defs.define_constant('ActionDispatch::Railtie::Collection') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))
    klass.inherits(defs.constant_proxy('TSort', RubyLint.registry))

    klass.define_instance_method('+') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 14 other locations - About 50 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 1020..1033
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2525..2538
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 826..839
lib/ruby-lint/definitions/rails/action_view.rb on lines 4127..4140
lib/ruby-lint/definitions/rails/active_model.rb on lines 742..755
lib/ruby-lint/definitions/rails/active_record.rb on lines 8131..8144
lib/ruby-lint/definitions/rails/active_support.rb on lines 4209..4222
lib/ruby-lint/definitions/rails/rails.rb on lines 176..189
lib/ruby-lint/definitions/rails/rails.rb on lines 243..256
lib/ruby-lint/definitions/rails/rails.rb on lines 441..454
lib/ruby-lint/definitions/rails/rails.rb on lines 826..839
lib/ruby-lint/definitions/rails/rails.rb on lines 1852..1865
lib/ruby-lint/definitions/rails/rails.rb on lines 1984..1997
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1219..1232

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

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