YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('add_pending') do |method|
      method.define_argument('pending')
Severity: Minor
Found in lib/ruby-lint/definitions/gems/test.rb and 5 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/prime.rb on lines 250..259
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1288..1297
lib/ruby-lint/definitions/gems/test.rb on lines 2473..2482
lib/ruby-lint/definitions/gems/test.rb on lines 2485..2494
lib/ruby-lint/definitions/rails/active_record.rb on lines 235..244

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('accept')

Severity: Minor
Found in lib/ruby-lint/definitions/core/socket.rb and 2 other locations - About 20 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 4759..4767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5866..5874

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('association') do |method|
      method.define_argument('name')
Severity: Minor
Found in lib/ruby-lint/definitions/rails/active_record.rb and 5 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/prime.rb on lines 250..259
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1288..1297
lib/ruby-lint/definitions/gems/test.rb on lines 2473..2482
lib/ruby-lint/definitions/gems/test.rb on lines 2485..2494
lib/ruby-lint/definitions/gems/test.rb on lines 2497..2506

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('__autosaving__')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 2 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/socket.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/celluloid.rb on lines 4759..4767

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('broadcast')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 2 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/socket.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5866..5874

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_method('delegate') do |method|
      method.define_rest_argument('methods')
Severity: Minor
Found in lib/ruby-lint/definitions/gems/sinatra.rb and 5 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/prime.rb on lines 250..259
lib/ruby-lint/definitions/gems/test.rb on lines 2473..2482
lib/ruby-lint/definitions/gems/test.rb on lines 2485..2494
lib/ruby-lint/definitions/gems/test.rb on lines 2497..2506
lib/ruby-lint/definitions/rails/active_record.rb on lines 235..244

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('config')

Severity: Minor
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 4 other locations - About 20 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5463..5472
lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 81..90
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1757..1766
lib/ruby-lint/definitions/rails/active_support.rb on lines 864..873

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

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

    klass.define_instance_method('encrypted')

Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.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/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::Integer::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 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('RSpec::Support::Ruby') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('jruby?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.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/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::Attribute::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 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('ActiveRecord::MigrationProxy::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 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('RSpec::Core::SharedExampleGroup::TopLevelDSL') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('definitions')

Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.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 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('Mongoid::Criteria::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 1422..1431
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('IRB::DefaultEncodings::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/core/irb.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/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
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::TrialDivisionGenerator') 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 184..193
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('ActiveRecord::ConnectionAdapters::ColumnDefinition::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 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('JSON::Ext::Generator::GeneratorMethods::String') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('included')

Severity: Major
Found in lib/ruby-lint/definitions/core/json.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/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
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::Undefined::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 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('ActiveRecord::ConnectionAdapters::IndexDefinition::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 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

Severity
Category
Status
Source
Language