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

    klass.define_instance_method('convert_to_model') do |method|
      method.define_argument('object')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.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/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::Integer::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 4115..4123
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::Set::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 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 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::Symbol::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 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 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::Pullable') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('pull') do |method|
      method.define_argument('pulls')
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 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('ActiveRecord::Batches') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('find_each') do |method|
      method.define_optional_argument('options')
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 707..715
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('GLib::UTF16') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('to_ucs4') do |method|
      method.define_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/glib.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 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::DateTime::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 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::TimeWithZone::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 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 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('Tree::Utils::TreeMergeHandler') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('merge') do |method|
      method.define_argument('other_tree')
Severity: Major
Found in lib/ruby-lint/definitions/gems/tree.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/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::Boolean') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

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

    klass.define_method('extended') do |method|
      method.define_argument('base')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.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 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('ActiveSupport::MessageEncryptor::NullSerializer') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('dump') do |method|
      method.define_argument('value')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.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 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('GLib::UCS4') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('to_utf16') do |method|
      method.define_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/glib.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 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::Persistable::Savable') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('save') 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 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 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('LibXML::XML::Schema::Namespaces') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('find_by_href') do |method|
      method.define_argument('href')
Severity: Major
Found in lib/ruby-lint/definitions/gems/lib_xml.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/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('DRbIdConv') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('to_id') do |method|
      method.define_argument('obj')
Severity: Major
Found in lib/ruby-lint/definitions/core/drb_id_conv.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/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
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('ActionMailer::TestHelper') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('assert_emails') do |method|
      method.define_argument('number')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_mailer.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_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::QueryCache::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('cache') do |method|
      method.define_block_argument('block')
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 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_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::Cyclic::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('recursively_embeds_many') 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 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 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

Severity
Category
Status
Source
Language