YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('ActiveRecord::MigrationProxy::Passwd') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('dir')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 38 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 434..449
lib/ruby-lint/definitions/core/digest.rb on lines 17..32
lib/ruby-lint/definitions/core/etc.rb on lines 102..117
lib/ruby-lint/definitions/core/irb.rb on lines 352..367
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2100..2115
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2168..2183
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3365..3380
lib/ruby-lint/definitions/core/webrick.rb on lines 557..572
lib/ruby-lint/definitions/gems/gtk.rb on lines 3589..3604
lib/ruby-lint/definitions/gems/gtk.rb on lines 3706..3721
lib/ruby-lint/definitions/gems/gtk.rb on lines 3768..3783
lib/ruby-lint/definitions/gems/gtk.rb on lines 3900..3915
lib/ruby-lint/definitions/gems/gtk.rb on lines 3994..4009
lib/ruby-lint/definitions/gems/gtk.rb on lines 4056..4071
lib/ruby-lint/definitions/gems/gtk.rb on lines 4118..4133
lib/ruby-lint/definitions/gems/gtk.rb on lines 4632..4647
lib/ruby-lint/definitions/gems/gtk.rb on lines 4714..4729
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2110..2125
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6298..6313
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1359..1374
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2348..2363
lib/ruby-lint/definitions/rails/active_model.rb on lines 186..201
lib/ruby-lint/definitions/rails/active_record.rb on lines 3924..3939
lib/ruby-lint/definitions/rails/active_record.rb on lines 4529..4544
lib/ruby-lint/definitions/rails/active_record.rb on lines 5826..5841
lib/ruby-lint/definitions/rails/active_record.rb on lines 6608..6623
lib/ruby-lint/definitions/rails/active_record.rb on lines 7127..7142
lib/ruby-lint/definitions/rails/arel.rb on lines 92..107
lib/ruby-lint/definitions/rails/arel.rb on lines 235..250
lib/ruby-lint/definitions/rails/arel.rb on lines 378..393
lib/ruby-lint/definitions/rails/arel.rb on lines 521..536
lib/ruby-lint/definitions/rails/arel.rb on lines 664..679
lib/ruby-lint/definitions/rails/arel.rb on lines 807..822
lib/ruby-lint/definitions/rails/arel.rb on lines 950..965
lib/ruby-lint/definitions/rails/arel.rb on lines 1093..1108
lib/ruby-lint/definitions/rails/arel.rb on lines 6929..6944
lib/ruby-lint/definitions/rails/arel.rb on lines 7350..7365
lib/ruby-lint/definitions/rails/sprockets.rb on lines 931..946

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

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

  defs.define_constant('ActiveRecord::NullMigration::Passwd') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('dir')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 38 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 434..449
lib/ruby-lint/definitions/core/digest.rb on lines 17..32
lib/ruby-lint/definitions/core/etc.rb on lines 102..117
lib/ruby-lint/definitions/core/irb.rb on lines 352..367
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2100..2115
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2168..2183
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3365..3380
lib/ruby-lint/definitions/core/webrick.rb on lines 557..572
lib/ruby-lint/definitions/gems/gtk.rb on lines 3589..3604
lib/ruby-lint/definitions/gems/gtk.rb on lines 3706..3721
lib/ruby-lint/definitions/gems/gtk.rb on lines 3768..3783
lib/ruby-lint/definitions/gems/gtk.rb on lines 3900..3915
lib/ruby-lint/definitions/gems/gtk.rb on lines 3994..4009
lib/ruby-lint/definitions/gems/gtk.rb on lines 4056..4071
lib/ruby-lint/definitions/gems/gtk.rb on lines 4118..4133
lib/ruby-lint/definitions/gems/gtk.rb on lines 4632..4647
lib/ruby-lint/definitions/gems/gtk.rb on lines 4714..4729
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2110..2125
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6298..6313
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1359..1374
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2348..2363
lib/ruby-lint/definitions/rails/active_model.rb on lines 186..201
lib/ruby-lint/definitions/rails/active_record.rb on lines 3924..3939
lib/ruby-lint/definitions/rails/active_record.rb on lines 4529..4544
lib/ruby-lint/definitions/rails/active_record.rb on lines 5826..5841
lib/ruby-lint/definitions/rails/active_record.rb on lines 6608..6623
lib/ruby-lint/definitions/rails/active_record.rb on lines 6783..6798
lib/ruby-lint/definitions/rails/arel.rb on lines 92..107
lib/ruby-lint/definitions/rails/arel.rb on lines 235..250
lib/ruby-lint/definitions/rails/arel.rb on lines 378..393
lib/ruby-lint/definitions/rails/arel.rb on lines 521..536
lib/ruby-lint/definitions/rails/arel.rb on lines 664..679
lib/ruby-lint/definitions/rails/arel.rb on lines 807..822
lib/ruby-lint/definitions/rails/arel.rb on lines 950..965
lib/ruby-lint/definitions/rails/arel.rb on lines 1093..1108
lib/ruby-lint/definitions/rails/arel.rb on lines 6929..6944
lib/ruby-lint/definitions/rails/arel.rb on lines 7350..7365
lib/ruby-lint/definitions/rails/sprockets.rb on lines 931..946

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

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

  defs.define_constant('Gtk::CellRendererText::State') do |klass|
    klass.inherits(defs.constant_proxy('GLib::Flags', RubyLint.registry))

    klass.define_instance_method('expandable?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/gtk.rb and 38 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 434..449
lib/ruby-lint/definitions/core/digest.rb on lines 17..32
lib/ruby-lint/definitions/core/etc.rb on lines 102..117
lib/ruby-lint/definitions/core/irb.rb on lines 352..367
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2100..2115
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2168..2183
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3365..3380
lib/ruby-lint/definitions/core/webrick.rb on lines 557..572
lib/ruby-lint/definitions/gems/gtk.rb on lines 3589..3604
lib/ruby-lint/definitions/gems/gtk.rb on lines 3706..3721
lib/ruby-lint/definitions/gems/gtk.rb on lines 3768..3783
lib/ruby-lint/definitions/gems/gtk.rb on lines 3900..3915
lib/ruby-lint/definitions/gems/gtk.rb on lines 3994..4009
lib/ruby-lint/definitions/gems/gtk.rb on lines 4056..4071
lib/ruby-lint/definitions/gems/gtk.rb on lines 4118..4133
lib/ruby-lint/definitions/gems/gtk.rb on lines 4714..4729
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2110..2125
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6298..6313
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1359..1374
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2348..2363
lib/ruby-lint/definitions/rails/active_model.rb on lines 186..201
lib/ruby-lint/definitions/rails/active_record.rb on lines 3924..3939
lib/ruby-lint/definitions/rails/active_record.rb on lines 4529..4544
lib/ruby-lint/definitions/rails/active_record.rb on lines 5826..5841
lib/ruby-lint/definitions/rails/active_record.rb on lines 6608..6623
lib/ruby-lint/definitions/rails/active_record.rb on lines 6783..6798
lib/ruby-lint/definitions/rails/active_record.rb on lines 7127..7142
lib/ruby-lint/definitions/rails/arel.rb on lines 92..107
lib/ruby-lint/definitions/rails/arel.rb on lines 235..250
lib/ruby-lint/definitions/rails/arel.rb on lines 378..393
lib/ruby-lint/definitions/rails/arel.rb on lines 521..536
lib/ruby-lint/definitions/rails/arel.rb on lines 664..679
lib/ruby-lint/definitions/rails/arel.rb on lines 807..822
lib/ruby-lint/definitions/rails/arel.rb on lines 950..965
lib/ruby-lint/definitions/rails/arel.rb on lines 1093..1108
lib/ruby-lint/definitions/rails/arel.rb on lines 6929..6944
lib/ruby-lint/definitions/rails/arel.rb on lines 7350..7365
lib/ruby-lint/definitions/rails/sprockets.rb on lines 931..946

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

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

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

    klass.define_instance_method('each')

Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 9 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/no_method_error.rb on lines 7..18
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3963..3974
lib/ruby-lint/definitions/rails/action_controller.rb on lines 711..722
lib/ruby-lint/definitions/rails/action_controller.rb on lines 953..964
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1941..1952
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2579..2590
lib/ruby-lint/definitions/rails/active_support.rb on lines 5206..5217
lib/ruby-lint/definitions/rails/rails.rb on lines 1280..1291
lib/ruby-lint/definitions/rails/rails.rb on lines 2342..2353

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

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

  defs.define_constant('ActionDispatch::Journey::Parser::Or') do |klass|
    klass.inherits(defs.constant_proxy('ActionDispatch::Journey::Nodes::Node', RubyLint.registry))

    klass.define_instance_method('children')

Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 9 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/no_method_error.rb on lines 7..18
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3963..3974
lib/ruby-lint/definitions/rails/action_controller.rb on lines 711..722
lib/ruby-lint/definitions/rails/action_controller.rb on lines 953..964
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2579..2590
lib/ruby-lint/definitions/rails/action_view.rb on lines 7152..7163
lib/ruby-lint/definitions/rails/active_support.rb on lines 5206..5217
lib/ruby-lint/definitions/rails/rails.rb on lines 1280..1291
lib/ruby-lint/definitions/rails/rails.rb on lines 2342..2353

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

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

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

    klass.define_instance_method('each')

Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 9 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/no_method_error.rb on lines 7..18
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3963..3974
lib/ruby-lint/definitions/rails/action_controller.rb on lines 953..964
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1941..1952
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2579..2590
lib/ruby-lint/definitions/rails/action_view.rb on lines 7152..7163
lib/ruby-lint/definitions/rails/active_support.rb on lines 5206..5217
lib/ruby-lint/definitions/rails/rails.rb on lines 1280..1291
lib/ruby-lint/definitions/rails/rails.rb on lines 2342..2353

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 9 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/resolv.rb on lines 737..745
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3516..3524
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3564..3572
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2262..2270
lib/ruby-lint/definitions/rails/active_record.rb on lines 5950..5958
lib/ruby-lint/definitions/rails/active_record.rb on lines 5962..5970
lib/ruby-lint/definitions/rails/active_record.rb on lines 6039..6047
lib/ruby-lint/definitions/rails/active_support.rb on lines 1455..1463
lib/ruby-lint/definitions/rails/arel.rb on lines 2095..2103

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('value')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 7 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 60..70
lib/ruby-lint/definitions/rails/action_controller.rb on lines 23..33
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2826..2836
lib/ruby-lint/definitions/rails/action_view.rb on lines 7423..7433
lib/ruby-lint/definitions/rails/active_record.rb on lines 10868..10878
lib/ruby-lint/definitions/rails/active_support.rb on lines 1467..1477
lib/ruby-lint/definitions/rails/active_support.rb on lines 5597..5607

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

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

  defs.define_constant('Mongoid::Contextual::Mongo::HasMany') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Relations::Eager::Base', RubyLint.registry))

    klass.define_instance_method('group_by_key')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 4 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/condition_variable.rb on lines 7..18
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1869..1880
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6525..6536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7440..7451

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

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

  defs.define_constant('Arel::Nodes::Count') do |klass|
    klass.inherits(defs.constant_proxy('Arel::Nodes::Function', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('expr')
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 9 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/resolv.rb on lines 737..745
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3499..3507
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3516..3524
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3564..3572
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2262..2270
lib/ruby-lint/definitions/rails/active_record.rb on lines 5950..5958
lib/ruby-lint/definitions/rails/active_record.rb on lines 5962..5970
lib/ruby-lint/definitions/rails/active_record.rb on lines 6039..6047
lib/ruby-lint/definitions/rails/active_support.rb on lines 1455..1463

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

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

    klass.define_instance_method('dependency')

Severity: Major
Found in lib/ruby-lint/definitions/core/gem.rb and 5 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 3076..3085
lib/ruby-lint/definitions/gems/celluloid.rb on lines 624..633
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2003..2012
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2913..2922
lib/ruby-lint/definitions/rails/arel.rb on lines 3790..3799

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

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

  defs.define_constant('Mongoid::Contextual::Memory::HasMany') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Relations::Eager::Base', RubyLint.registry))

    klass.define_instance_method('group_by_key')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 4 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/condition_variable.rb on lines 7..18
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2121..2132
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6525..6536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7440..7451

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

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

  defs.define_constant('ConditionVariable') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('broadcast')

Severity: Major
Found in lib/ruby-lint/definitions/core/condition_variable.rb and 4 other locations - About 35 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1869..1880
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2121..2132
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6525..6536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7440..7451

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 9 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/resolv.rb on lines 737..745
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3499..3507
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3564..3572
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2262..2270
lib/ruby-lint/definitions/rails/active_record.rb on lines 5950..5958
lib/ruby-lint/definitions/rails/active_record.rb on lines 5962..5970
lib/ruby-lint/definitions/rails/active_record.rb on lines 6039..6047
lib/ruby-lint/definitions/rails/active_support.rb on lines 1455..1463
lib/ruby-lint/definitions/rails/arel.rb on lines 2095..2103

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('message')
Severity: Major
Found in lib/ruby-lint/definitions/core/open_uri.rb and 7 other locations - About 35 mins to fix
lib/ruby-lint/definitions/gems/test.rb on lines 689..699
lib/ruby-lint/definitions/rails/action_controller.rb on lines 23..33
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2826..2836
lib/ruby-lint/definitions/rails/action_view.rb on lines 7423..7433
lib/ruby-lint/definitions/rails/active_record.rb on lines 10868..10878
lib/ruby-lint/definitions/rails/active_support.rb on lines 1467..1477
lib/ruby-lint/definitions/rails/active_support.rb on lines 5597..5607

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

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

  defs.define_constant('Resolv::DNS::Requester::Sender') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('msg')
Severity: Major
Found in lib/ruby-lint/definitions/core/resolv.rb and 9 other locations - About 35 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3499..3507
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3516..3524
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3564..3572
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2262..2270
lib/ruby-lint/definitions/rails/active_record.rb on lines 5950..5958
lib/ruby-lint/definitions/rails/active_record.rb on lines 5962..5970
lib/ruby-lint/definitions/rails/active_record.rb on lines 6039..6047
lib/ruby-lint/definitions/rails/active_support.rb on lines 1455..1463
lib/ruby-lint/definitions/rails/arel.rb on lines 2095..2103

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

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

    klass.define_instance_method('dispatch')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 5 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 3063..3072
lib/ruby-lint/definitions/core/gem.rb on lines 3076..3085
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2003..2012
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2913..2922
lib/ruby-lint/definitions/rails/arel.rb on lines 3790..3799

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

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

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

    klass.define_instance_method('__evolve_object_id__')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 4 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/condition_variable.rb on lines 7..18
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1869..1880
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2121..2132
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6525..6536

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('number')
Severity: Minor
Found in lib/ruby-lint/definitions/rails/action_view.rb and 2 other locations - About 35 mins to fix
lib/ruby-lint/definitions/rails/action_view.rb on lines 1630..1641
lib/ruby-lint/definitions/rails/action_view.rb on lines 3268..3279

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

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

  defs.define_constant('ActiveSupport::Testing::RemoteError') do |klass|
    klass.inherits(defs.constant_proxy('StandardError', RubyLint.registry))

    klass.define_instance_method('backtrace')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 9 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/no_method_error.rb on lines 7..18
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3963..3974
lib/ruby-lint/definitions/rails/action_controller.rb on lines 711..722
lib/ruby-lint/definitions/rails/action_controller.rb on lines 953..964
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1941..1952
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2579..2590
lib/ruby-lint/definitions/rails/action_view.rb on lines 7152..7163
lib/ruby-lint/definitions/rails/rails.rb on lines 1280..1291
lib/ruby-lint/definitions/rails/rails.rb on lines 2342..2353

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

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