YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_method('for') do |method|
      method.define_argument('engine')
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 53 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 137..145
lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315

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

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

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

    klass.define_instance_method('_process_options') do |method|
      method.define_argument('options')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 53 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 137..145
lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

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

    klass.define_instance_method('call') do |method|
      method.define_argument('env')
Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 53 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 137..145
lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

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

    klass.define_instance_method('demongoize') do |method|
      method.define_argument('object')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 53 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 137..145
lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

  defs.define_constant('Mongoid::Persistable::Deletable') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('delete') do |method|
      method.define_optional_argument('options')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 53 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 137..145
lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

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

    klass.define_method('included') do |method|
      method.define_argument('base')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 53 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 137..145
lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

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

    klass.define_instance_method('assign_attributes') do |method|
      method.define_argument('new_attributes')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 53 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 137..145
lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

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

    klass.define_instance_method('reflect_on_all_associations') do |method|
      method.define_rest_argument('macros')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 53 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 137..145
lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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('Nokogiri::XML::Namespace') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Nokogiri::XML::PP::Node', RubyLint.registry))

    klass.define_instance_method('document')
Severity: Minor
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 1 other location - About 25 mins to fix
lib/ruby-lint/definitions/core/monitor.rb on lines 7..15

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

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

    klass.define_instance_method('enter')
Severity: Minor
Found in lib/ruby-lint/definitions/core/monitor.rb and 1 other location - About 25 mins to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5397..5405

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

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

  defs.define_constant('ActionView::TestCase::AtomBuilder') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('xml')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 943..949
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1083..1089
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1308..1314
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3533..3539
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 370..376
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2926..2932
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5600..5606
lib/ruby-lint/definitions/rails/active_record.rb on lines 5806..5812
lib/ruby-lint/definitions/rails/active_record.rb on lines 5929..5935
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_optional_argument('message')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 943..949
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1083..1089
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1308..1314
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3533..3539
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 370..376
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/action_view.rb on lines 5243..5249
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5600..5606
lib/ruby-lint/definitions/rails/active_record.rb on lines 5806..5812
lib/ruby-lint/definitions/rails/active_record.rb on lines 5929..5935
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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

  defs.define_constant('ActiveRecord::DuplicateMigrationVersionError') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::ActiveRecordError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('version')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 943..949
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1083..1089
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1308..1314
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3533..3539
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 370..376
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2926..2932
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/action_view.rb on lines 5243..5249
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5806..5812
lib/ruby-lint/definitions/rails/active_record.rb on lines 5929..5935
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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

  defs.define_constant('ActiveRecord::HasAndBelongsToManyAssociationForeignKeyNeeded') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::ActiveRecordError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('reflection')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 943..949
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1083..1089
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1308..1314
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3533..3539
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 370..376
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2926..2932
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/action_view.rb on lines 5243..5249
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5600..5606
lib/ruby-lint/definitions/rails/active_record.rb on lines 5806..5812
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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

  defs.define_constant('ActiveRecord::EagerLoadPolymorphicError') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::ActiveRecordError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('reflection')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 943..949
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1083..1089
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1308..1314
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3533..3539
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 370..376
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2926..2932
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/action_view.rb on lines 5243..5249
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5600..5606
lib/ruby-lint/definitions/rails/active_record.rb on lines 5929..5935
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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

  defs.define_constant('Mongoid::Errors::InvalidPath') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Errors::MongoidError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 943..949
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1083..1089
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1308..1314
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 370..376
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2926..2932
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/action_view.rb on lines 5243..5249
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5600..5606
lib/ruby-lint/definitions/rails/active_record.rb on lines 5806..5812
lib/ruby-lint/definitions/rails/active_record.rb on lines 5929..5935
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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

  defs.define_constant('OpenSSL::Cipher::CAST5::AES') do |klass|
    klass.inherits(defs.constant_proxy('OpenSSL::Cipher', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1083..1089
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1308..1314
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3533..3539
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 370..376
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2926..2932
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/action_view.rb on lines 5243..5249
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5600..5606
lib/ruby-lint/definitions/rails/active_record.rb on lines 5806..5812
lib/ruby-lint/definitions/rails/active_record.rb on lines 5929..5935
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 943..949
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1308..1314
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3533..3539
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 370..376
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2926..2932
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/action_view.rb on lines 5243..5249
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5600..5606
lib/ruby-lint/definitions/rails/active_record.rb on lines 5806..5812
lib/ruby-lint/definitions/rails/active_record.rb on lines 5929..5935
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 943..949
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1083..1089
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3533..3539
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 370..376
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2926..2932
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/action_view.rb on lines 5243..5249
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5600..5606
lib/ruby-lint/definitions/rails/active_record.rb on lines 5806..5812
lib/ruby-lint/definitions/rails/active_record.rb on lines 5929..5935
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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

  defs.define_constant('AbstractController::DoubleRenderError') do |klass|
    klass.inherits(defs.constant_proxy('AbstractController::Error', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_optional_argument('message')
Severity: Major
Found in lib/ruby-lint/definitions/rails/abstract_controller.rb and 59 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/interrupt.rb on lines 7..13
lib/ruby-lint/definitions/core/open_ssl.rb on lines 883..889
lib/ruby-lint/definitions/core/open_ssl.rb on lines 893..899
lib/ruby-lint/definitions/core/open_ssl.rb on lines 903..909
lib/ruby-lint/definitions/core/open_ssl.rb on lines 913..919
lib/ruby-lint/definitions/core/open_ssl.rb on lines 923..929
lib/ruby-lint/definitions/core/open_ssl.rb on lines 933..939
lib/ruby-lint/definitions/core/open_ssl.rb on lines 943..949
lib/ruby-lint/definitions/core/open_ssl.rb on lines 953..959
lib/ruby-lint/definitions/core/open_ssl.rb on lines 963..969
lib/ruby-lint/definitions/core/open_ssl.rb on lines 973..979
lib/ruby-lint/definitions/core/open_ssl.rb on lines 983..989
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1003..1009
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1013..1019
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1023..1029
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1033..1039
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1043..1049
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1063..1069
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1073..1079
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1083..1089
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1093..1099
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1103..1109
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1308..1314
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1395..1401
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3393..3399
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3408..3414
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3423..3429
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3533..3539
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3597..3603
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3612..3618
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3723..3729
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3749..3755
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3764..3770
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3779..3785
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3794..3800
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3868..3874
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1700..1706
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2926..2932
lib/ruby-lint/definitions/rails/action_view.rb on lines 495..501
lib/ruby-lint/definitions/rails/action_view.rb on lines 2301..2307
lib/ruby-lint/definitions/rails/action_view.rb on lines 3883..3889
lib/ruby-lint/definitions/rails/action_view.rb on lines 5243..5249
lib/ruby-lint/definitions/rails/active_record.rb on lines 5522..5528
lib/ruby-lint/definitions/rails/active_record.rb on lines 5590..5596
lib/ruby-lint/definitions/rails/active_record.rb on lines 5600..5606
lib/ruby-lint/definitions/rails/active_record.rb on lines 5806..5812
lib/ruby-lint/definitions/rails/active_record.rb on lines 5929..5935
lib/ruby-lint/definitions/rails/active_record.rb on lines 6029..6035
lib/ruby-lint/definitions/rails/active_record.rb on lines 6051..6057
lib/ruby-lint/definitions/rails/active_record.rb on lines 8229..8235
lib/ruby-lint/definitions/rails/active_record.rb on lines 11643..11649
lib/ruby-lint/definitions/rails/active_support.rb on lines 5615..5621
lib/ruby-lint/definitions/rails/arel.rb on lines 2948..2954
lib/ruby-lint/definitions/rails/arel.rb on lines 5111..5117
lib/ruby-lint/definitions/rails/arel.rb on lines 5175..5181
lib/ruby-lint/definitions/rails/arel.rb on lines 5239..5245
lib/ruby-lint/definitions/rails/arel.rb on lines 7025..7031
lib/ruby-lint/definitions/rails/arel.rb on lines 7268..7274
lib/ruby-lint/definitions/rails/arel.rb on lines 7875..7881

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

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