YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('collection_name')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/syck.rb on lines 222..232
lib/ruby-lint/definitions/gems/devise.rb on lines 1753..1763
lib/ruby-lint/definitions/gems/devise.rb on lines 1920..1930
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8370..8380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8384..8394

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

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

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

    klass.define_instance_method('handle_dependency')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3299..3310
lib/ruby-lint/definitions/gems/celluloid.rb on lines 4463..4474
lib/ruby-lint/definitions/rails/active_record.rb on lines 411..422
lib/ruby-lint/definitions/rails/active_record.rb on lines 9582..9593
lib/ruby-lint/definitions/rails/active_support.rb on lines 1397..1408

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

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

    klass.define_instance_method('<<') do |method|
      method.define_argument('str')
Severity: Minor
Found in lib/ruby-lint/definitions/core/open_uri.rb and 3 other locations - About 25 mins to fix
lib/ruby-lint/definitions/gems/test.rb on lines 2445..2456
lib/ruby-lint/definitions/gems/test.rb on lines 2459..2470
lib/ruby-lint/definitions/rails/active_support.rb on lines 3552..3563

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

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

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

    klass.define_method('available_configs')

Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/syck.rb on lines 222..232
lib/ruby-lint/definitions/gems/devise.rb on lines 1920..1930
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2558..2568
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8370..8380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8384..8394

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

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

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

    klass.define_instance_method('collection_name')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/syck.rb on lines 222..232
lib/ruby-lint/definitions/gems/devise.rb on lines 1753..1763
lib/ruby-lint/definitions/gems/devise.rb on lines 1920..1930
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2558..2568
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8370..8380

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

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

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

    klass.define_instance_method('handle_dependency')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3299..3310
lib/ruby-lint/definitions/gems/celluloid.rb on lines 4463..4474
lib/ruby-lint/definitions/rails/active_record.rb on lines 1937..1948
lib/ruby-lint/definitions/rails/active_record.rb on lines 9582..9593
lib/ruby-lint/definitions/rails/active_support.rb on lines 1397..1408

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

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

  defs.define_constant('Celluloid::PoolManager::TaskFiber') do |klass|
    klass.inherits(defs.constant_proxy('Celluloid::Task', RubyLint.registry))

    klass.define_instance_method('create')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 4463..4474
lib/ruby-lint/definitions/rails/active_record.rb on lines 411..422
lib/ruby-lint/definitions/rails/active_record.rb on lines 1937..1948
lib/ruby-lint/definitions/rails/active_record.rb on lines 9582..9593
lib/ruby-lint/definitions/rails/active_support.rb on lines 1397..1408

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  defs.define_constant('ActiveSupport::OrderedHash') do |klass|
    klass.inherits(defs.constant_proxy('Hash', RubyLint.registry))

    klass.define_instance_method('encode_with') do |method|
      method.define_argument('coder')
Severity: Minor
Found in lib/ruby-lint/definitions/rails/active_support.rb and 3 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 41..52
lib/ruby-lint/definitions/gems/test.rb on lines 2445..2456
lib/ruby-lint/definitions/gems/test.rb on lines 2459..2470

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

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

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

    klass.define_method('available_configs')

Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/syck.rb on lines 222..232
lib/ruby-lint/definitions/gems/devise.rb on lines 1753..1763
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2558..2568
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8370..8380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8384..8394

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

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

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

    klass.define_instance_method('collection_name')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/syck.rb on lines 222..232
lib/ruby-lint/definitions/gems/devise.rb on lines 1753..1763
lib/ruby-lint/definitions/gems/devise.rb on lines 1920..1930
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2558..2568
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8384..8394

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

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

  defs.define_constant('ActiveSupport::Deprecation::Behavior') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('behavior')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3299..3310
lib/ruby-lint/definitions/gems/celluloid.rb on lines 4463..4474
lib/ruby-lint/definitions/rails/active_record.rb on lines 411..422
lib/ruby-lint/definitions/rails/active_record.rb on lines 1937..1948
lib/ruby-lint/definitions/rails/active_record.rb on lines 9582..9593

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

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

  defs.define_constant('Celluloid::TaskFiber') do |klass|
    klass.inherits(defs.constant_proxy('Celluloid::Task', RubyLint.registry))

    klass.define_instance_method('create')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3299..3310
lib/ruby-lint/definitions/rails/active_record.rb on lines 411..422
lib/ruby-lint/definitions/rails/active_record.rb on lines 1937..1948
lib/ruby-lint/definitions/rails/active_record.rb on lines 9582..9593
lib/ruby-lint/definitions/rails/active_support.rb on lines 1397..1408

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  defs.define_constant('Test::Unit::TestResultFailureSupport') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('add_failure') do |method|
      method.define_argument('failure')
Severity: Minor
Found in lib/ruby-lint/definitions/gems/test.rb and 3 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 41..52
lib/ruby-lint/definitions/gems/test.rb on lines 2445..2456
lib/ruby-lint/definitions/rails/active_support.rb on lines 3552..3563

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  defs.define_constant('Test::Unit::TestResultErrorSupport') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('add_error') do |method|
      method.define_argument('error')
Severity: Minor
Found in lib/ruby-lint/definitions/gems/test.rb and 3 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 41..52
lib/ruby-lint/definitions/gems/test.rb on lines 2459..2470
lib/ruby-lint/definitions/rails/active_support.rb on lines 3552..3563

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

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

    klass.define_instance_method('handler_for_rescue') do |method|
      method.define_argument('exception')
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 3147..3155
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::Pointer') do |klass|
    klass.inherits(defs.constant_proxy('Data', RubyLint.registry))

    klass.define_method('gtype') 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 3837..3845
lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 29.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  defs.define_constant('Mongoid::Extensions::Range::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 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::Relations::Bindings::Embedded::Many') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Relations::Binding', RubyLint.registry))

    klass.define_instance_method('bind_one') do |method|
      method.define_argument('doc')
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 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::BigDecimal::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 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::Date::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 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

Severity
Category
Status
Source
Language