YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('Syck::Scalar') do |klass|
    klass.inherits(defs.constant_proxy('Syck::Node', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/syck.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Arel::Attributes::Time::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

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

    klass.define_instance_method('ascending?')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

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

    klass.define_instance_method('collection')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

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

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

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

    klass.define_instance_method('to_key')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Prime::Generator23') do |klass|
    klass.inherits(defs.constant_proxy('Prime::PseudoPrimeGenerator', RubyLint.registry))

    klass.define_instance_method('initialize')

Severity: Major
Found in lib/ruby-lint/definitions/core/prime.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher::AttributeMethodMatch::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Sprockets::ProcessedAsset::DependencyFile::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/rails/sprockets.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347

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

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

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

    klass.define_instance_method('ascending?')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Sinatra::ExtendedRack::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/gems/sinatra.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Arel::Attributes::Decimal::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('GLib::Param::Char::Double') do |klass|
    klass.inherits(defs.constant_proxy('GLib::Param', RubyLint.registry))

    klass.define_instance_method('epsilon')

Severity: Major
Found in lib/ruby-lint/definitions/gems/glib.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Nokogiri::XML::Notation::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Arel::Attributes::Float::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('ActionController::ParamsWrapper::Options::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Nokogiri::XML::AttributeDecl') do |klass|
    klass.inherits(defs.constant_proxy('Nokogiri::XML::Node', RubyLint.registry))

    klass.define_instance_method('attribute_type')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Arel::SelectManager::Row::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

  defs.define_constant('Arel::Visitors::Dot::Edge::Group') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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

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

    klass.define_instance_method('gid')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 54 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/csv.rb on lines 422..431
lib/ruby-lint/definitions/core/etc.rb on lines 90..99
lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
lib/ruby-lint/definitions/core/irb.rb on lines 340..349
lib/ruby-lint/definitions/core/json.rb on lines 194..203
lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
lib/ruby-lint/definitions/core/prime.rb on lines 95..104
lib/ruby-lint/definitions/core/prime.rb on lines 184..193
lib/ruby-lint/definitions/core/prime.rb on lines 399..408
lib/ruby-lint/definitions/core/syck.rb on lines 625..634
lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1347..1356
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

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