YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('delete') do |method|
      method.define_argument('group')
Severity: Minor
Found in lib/ruby-lint/definitions/core/pretty_print.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/core/pp.rb on lines 78..94

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

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('Resolv::DNS::Resource::DomainName') do |klass|
    klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))

    klass.define_method('decode_rdata') do |method|
      method.define_argument('msg')
Severity: Major
Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/drb.rb on lines 545..562
lib/ruby-lint/definitions/core/resolv.rb on lines 943..960

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

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('OpenSSL::SSL::Session') 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 4 other locations - About 55 mins to fix
lib/ruby-lint/definitions/gems/gtk.rb on lines 22158..22181
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6082..6105
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2319..2342
lib/ruby-lint/definitions/rails/active_record.rb on lines 4256..4279

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

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('ActiveModel::Validations::LengthValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('check_validity!')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 2 other locations - About 55 mins to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 2720..2734
lib/ruby-lint/definitions/rails/active_record.rb on lines 10370..10384

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

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('Gtk::UIManager::ItemType') do |klass|
    klass.inherits(defs.constant_proxy('GLib::Flags', RubyLint.registry))

    klass.define_instance_method('accelerator?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/gtk.rb and 4 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3275..3298
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6082..6105
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2319..2342
lib/ruby-lint/definitions/rails/active_record.rb on lines 4256..4279

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

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

    klass.define_instance_method('annotation')

Severity: Major
Found in lib/ruby-lint/definitions/gems/lib_xml.rb and 4 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3275..3298
lib/ruby-lint/definitions/gems/gtk.rb on lines 22158..22181
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2319..2342
lib/ruby-lint/definitions/rails/active_record.rb on lines 4256..4279

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

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('ActiveRecord::Base::LengthValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('check_validity!')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 55 mins to fix
lib/ruby-lint/definitions/rails/active_model.rb on lines 1425..1439
lib/ruby-lint/definitions/rails/active_record.rb on lines 10370..10384

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

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('ActiveRecord::SchemaMigration::LengthValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('check_validity!')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 55 mins to fix
lib/ruby-lint/definitions/rails/active_model.rb on lines 1425..1439
lib/ruby-lint/definitions/rails/active_record.rb on lines 2720..2734

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

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

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

    klass.define_instance_method('call')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 55 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 583..599

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

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

    klass.define_instance_method('expected?') do |method|
      method.define_argument('actual_exception')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 2 other locations - About 55 mins to fix
lib/ruby-lint/definitions/gems/test.rb on lines 2046..2060
lib/ruby-lint/definitions/rails/action_view.rb on lines 2032..2046

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

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

    klass.define_instance_method('expected?') do |method|
      method.define_argument('actual_exception')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 2 other locations - About 55 mins to fix
lib/ruby-lint/definitions/gems/test.rb on lines 454..468
lib/ruby-lint/definitions/rails/action_view.rb on lines 2032..2046

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

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

    klass.define_instance_method('allowed_index_name_length')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 4 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3275..3298
lib/ruby-lint/definitions/gems/gtk.rb on lines 22158..22181
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6082..6105
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2319..2342

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

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

    klass.define_method('instance')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 4 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3275..3298
lib/ruby-lint/definitions/gems/gtk.rb on lines 22158..22181
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6082..6105
lib/ruby-lint/definitions/rails/active_record.rb on lines 4256..4279

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

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

  defs.define_constant('ActiveRecord::DynamicMatchers::FindLastBy') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::DynamicMatchers::Method', RubyLint.registry))
    klass.inherits(defs.constant_proxy('ActiveRecord::DynamicMatchers::DeprecationWarning', RubyLint.registry))
    klass.inherits(defs.constant_proxy('ActiveRecord::DynamicMatchers::DeprecatedFinder', RubyLint.registry))
    klass.inherits(defs.constant_proxy('ActiveRecord::DynamicMatchers::Finder', RubyLint.registry))
Severity: Minor
Found in lib/ruby-lint/definitions/rails/active_record.rb and 1 other location - About 55 mins to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 5637..5649

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActionView::DependencyTracker::ERBTracker') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('call') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 2 other locations - About 55 mins to fix
lib/ruby-lint/definitions/gems/test.rb on lines 454..468
lib/ruby-lint/definitions/gems/test.rb on lines 2046..2060

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

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

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

    klass.define_instance_method('call')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 55 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1962..1978

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

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

  defs.define_constant('ActiveRecord::DynamicMatchers::FindAllBy') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::DynamicMatchers::Method', RubyLint.registry))
    klass.inherits(defs.constant_proxy('ActiveRecord::DynamicMatchers::DeprecationWarning', RubyLint.registry))
    klass.inherits(defs.constant_proxy('ActiveRecord::DynamicMatchers::DeprecatedFinder', RubyLint.registry))
    klass.inherits(defs.constant_proxy('ActiveRecord::DynamicMatchers::Finder', RubyLint.registry))
Severity: Minor
Found in lib/ruby-lint/definitions/rails/active_record.rb and 1 other location - About 55 mins to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 5682..5694

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

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

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

    klass.define_instance_method('<=>') do |method|
      method.define_argument('other')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 191 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/array.rb on lines 417..433
lib/ruby-lint/definitions/core/basic_socket.rb on lines 486..502
lib/ruby-lint/definitions/core/cgi.rb on lines 135..151
lib/ruby-lint/definitions/core/csv.rb on lines 457..473
lib/ruby-lint/definitions/core/csv.rb on lines 699..715
lib/ruby-lint/definitions/core/csv.rb on lines 718..734
lib/ruby-lint/definitions/core/csv.rb on lines 865..881
lib/ruby-lint/definitions/core/enumerable.rb on lines 167..183
lib/ruby-lint/definitions/core/file.rb on lines 1213..1229
lib/ruby-lint/definitions/core/gem.rb on lines 830..846
lib/ruby-lint/definitions/core/hash.rb on lines 490..506
lib/ruby-lint/definitions/core/io.rb on lines 746..762
lib/ruby-lint/definitions/core/ipsocket.rb on lines 440..456
lib/ruby-lint/definitions/core/irb.rb on lines 375..391
lib/ruby-lint/definitions/core/matrix.rb on lines 494..510
lib/ruby-lint/definitions/core/open_ssl.rb on lines 196..212
lib/ruby-lint/definitions/core/open_ssl.rb on lines 444..460
lib/ruby-lint/definitions/core/open_ssl.rb on lines 503..519
lib/ruby-lint/definitions/core/open_ssl.rb on lines 812..828
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1221..1237
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3256..3272
lib/ruby-lint/definitions/core/option_parser.rb on lines 557..573
lib/ruby-lint/definitions/core/option_parser.rb on lines 1027..1043
lib/ruby-lint/definitions/core/prime.rb on lines 142..158
lib/ruby-lint/definitions/core/prime.rb on lines 231..247
lib/ruby-lint/definitions/core/prime.rb on lines 332..348
lib/ruby-lint/definitions/core/prime.rb on lines 351..367
lib/ruby-lint/definitions/core/prime.rb on lines 446..462
lib/ruby-lint/definitions/core/range.rb on lines 137..153
lib/ruby-lint/definitions/core/set.rb on lines 216..232
lib/ruby-lint/definitions/core/socket.rb on lines 3126..3142
lib/ruby-lint/definitions/core/sorted_set.rb on lines 64..80
lib/ruby-lint/definitions/core/string_io.rb on lines 319..335
lib/ruby-lint/definitions/core/struct.rb on lines 158..174
lib/ruby-lint/definitions/core/syck.rb on lines 396..412
lib/ruby-lint/definitions/core/syck.rb on lines 509..525
lib/ruby-lint/definitions/core/syck.rb on lines 895..911
lib/ruby-lint/definitions/core/syck.rb on lines 1197..1213
lib/ruby-lint/definitions/core/tcpserver.rb on lines 427..443
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 441..457
lib/ruby-lint/definitions/core/udpsocket.rb on lines 442..458
lib/ruby-lint/definitions/core/unixserver.rb on lines 426..442
lib/ruby-lint/definitions/core/unixsocket.rb on lines 455..471
lib/ruby-lint/definitions/core/vector.rb on lines 201..217
lib/ruby-lint/definitions/core/webrick.rb on lines 580..596
lib/ruby-lint/definitions/core/zlib.rb on lines 291..307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 569..585
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1551..1567
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1672..1688
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1894..1910
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2146..2162
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2234..2250
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2350..2366
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3159..3175
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5744..5760
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7358..7374
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8182..8198
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1072..1088
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1306..1322
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2133..2149
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2569..2585
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2794..2810
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3104..3120
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3323..3339
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3542..3558
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3779..3795
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4125..4141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4378..4394
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4596..4612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4877..4893
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5144..5160
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5363..5379
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5899..5915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6157..6173
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6321..6337
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6876..6892
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7022..7038
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7560..7576
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1382..1398
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2186..2202
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2371..2387
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 511..527
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 881..897
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1202..1218
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2501..2517
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2787..2803
lib/ruby-lint/definitions/rails/action_view.rb on lines 4069..4085
lib/ruby-lint/definitions/rails/active_model.rb on lines 209..225
lib/ruby-lint/definitions/rails/active_model.rb on lines 530..546
lib/ruby-lint/definitions/rails/active_record.rb on lines 3947..3963
lib/ruby-lint/definitions/rails/active_record.rb on lines 4552..4568
lib/ruby-lint/definitions/rails/active_record.rb on lines 6631..6647
lib/ruby-lint/definitions/rails/active_record.rb on lines 6806..6822
lib/ruby-lint/definitions/rails/active_record.rb on lines 7150..7166
lib/ruby-lint/definitions/rails/active_record.rb on lines 8816..8832
lib/ruby-lint/definitions/rails/active_support.rb on lines 1280..1296
lib/ruby-lint/definitions/rails/active_support.rb on lines 1753..1769
lib/ruby-lint/definitions/rails/active_support.rb on lines 2139..2155
lib/ruby-lint/definitions/rails/active_support.rb on lines 3800..3816
lib/ruby-lint/definitions/rails/active_support.rb on lines 4104..4120
lib/ruby-lint/definitions/rails/arel.rb on lines 115..131
lib/ruby-lint/definitions/rails/arel.rb on lines 258..274
lib/ruby-lint/definitions/rails/arel.rb on lines 401..417
lib/ruby-lint/definitions/rails/arel.rb on lines 544..560
lib/ruby-lint/definitions/rails/arel.rb on lines 687..703
lib/ruby-lint/definitions/rails/arel.rb on lines 830..846
lib/ruby-lint/definitions/rails/arel.rb on lines 973..989
lib/ruby-lint/definitions/rails/arel.rb on lines 1116..1132
lib/ruby-lint/definitions/rails/arel.rb on lines 1238..1254
lib/ruby-lint/definitions/rails/arel.rb on lines 1506..1522
lib/ruby-lint/definitions/rails/arel.rb on lines 1587..1603
lib/ruby-lint/definitions/rails/arel.rb on lines 1646..1662
lib/ruby-lint/definitions/rails/arel.rb on lines 1712..1728
lib/ruby-lint/definitions/rails/arel.rb on lines 1771..1787
lib/ruby-lint/definitions/rails/arel.rb on lines 1830..1846
lib/ruby-lint/definitions/rails/arel.rb on lines 1889..1905
lib/ruby-lint/definitions/rails/arel.rb on lines 1948..1964
lib/ruby-lint/definitions/rails/arel.rb on lines 2031..2047
lib/ruby-lint/definitions/rails/arel.rb on lines 2142..2158
lib/ruby-lint/definitions/rails/arel.rb on lines 2206..2222
lib/ruby-lint/definitions/rails/arel.rb on lines 2279..2295
lib/ruby-lint/definitions/rails/arel.rb on lines 2345..2361
lib/ruby-lint/definitions/rails/arel.rb on lines 2409..2425
lib/ruby-lint/definitions/rails/arel.rb on lines 2468..2484
lib/ruby-lint/definitions/rails/arel.rb on lines 2533..2549
lib/ruby-lint/definitions/rails/arel.rb on lines 2592..2608
lib/ruby-lint/definitions/rails/arel.rb on lines 2656..2672
lib/ruby-lint/definitions/rails/arel.rb on lines 2715..2731
lib/ruby-lint/definitions/rails/arel.rb on lines 2774..2790
lib/ruby-lint/definitions/rails/arel.rb on lines 2865..2881
lib/ruby-lint/definitions/rails/arel.rb on lines 2929..2945
lib/ruby-lint/definitions/rails/arel.rb on lines 2993..3009
lib/ruby-lint/definitions/rails/arel.rb on lines 3084..3100
lib/ruby-lint/definitions/rails/arel.rb on lines 3143..3159
lib/ruby-lint/definitions/rails/arel.rb on lines 3202..3218
lib/ruby-lint/definitions/rails/arel.rb on lines 3261..3277
lib/ruby-lint/definitions/rails/arel.rb on lines 3321..3337
lib/ruby-lint/definitions/rails/arel.rb on lines 3380..3396
lib/ruby-lint/definitions/rails/arel.rb on lines 3439..3455
lib/ruby-lint/definitions/rails/arel.rb on lines 3512..3528
lib/ruby-lint/definitions/rails/arel.rb on lines 3571..3587
lib/ruby-lint/definitions/rails/arel.rb on lines 3653..3669
lib/ruby-lint/definitions/rails/arel.rb on lines 3712..3728
lib/ruby-lint/definitions/rails/arel.rb on lines 3771..3787
lib/ruby-lint/definitions/rails/arel.rb on lines 3838..3854
lib/ruby-lint/definitions/rails/arel.rb on lines 3897..3913
lib/ruby-lint/definitions/rails/arel.rb on lines 3956..3972
lib/ruby-lint/definitions/rails/arel.rb on lines 4015..4031
lib/ruby-lint/definitions/rails/arel.rb on lines 4074..4090
lib/ruby-lint/definitions/rails/arel.rb on lines 4133..4149
lib/ruby-lint/definitions/rails/arel.rb on lines 4192..4208
lib/ruby-lint/definitions/rails/arel.rb on lines 4251..4267
lib/ruby-lint/definitions/rails/arel.rb on lines 4316..4332
lib/ruby-lint/definitions/rails/arel.rb on lines 4396..4412
lib/ruby-lint/definitions/rails/arel.rb on lines 4474..4490
lib/ruby-lint/definitions/rails/arel.rb on lines 4552..4568
lib/ruby-lint/definitions/rails/arel.rb on lines 4611..4627
lib/ruby-lint/definitions/rails/arel.rb on lines 4670..4686
lib/ruby-lint/definitions/rails/arel.rb on lines 4729..4745
lib/ruby-lint/definitions/rails/arel.rb on lines 4788..4804
lib/ruby-lint/definitions/rails/arel.rb on lines 4847..4863
lib/ruby-lint/definitions/rails/arel.rb on lines 4906..4922
lib/ruby-lint/definitions/rails/arel.rb on lines 4965..4981
lib/ruby-lint/definitions/rails/arel.rb on lines 5024..5040
lib/ruby-lint/definitions/rails/arel.rb on lines 5092..5108
lib/ruby-lint/definitions/rails/arel.rb on lines 5156..5172
lib/ruby-lint/definitions/rails/arel.rb on lines 5220..5236
lib/ruby-lint/definitions/rails/arel.rb on lines 5284..5300
lib/ruby-lint/definitions/rails/arel.rb on lines 5398..5414
lib/ruby-lint/definitions/rails/arel.rb on lines 5494..5510
lib/ruby-lint/definitions/rails/arel.rb on lines 5608..5624
lib/ruby-lint/definitions/rails/arel.rb on lines 5673..5689
lib/ruby-lint/definitions/rails/arel.rb on lines 5732..5748
lib/ruby-lint/definitions/rails/arel.rb on lines 5804..5820
lib/ruby-lint/definitions/rails/arel.rb on lines 5863..5879
lib/ruby-lint/definitions/rails/arel.rb on lines 5927..5943
lib/ruby-lint/definitions/rails/arel.rb on lines 6007..6023
lib/ruby-lint/definitions/rails/arel.rb on lines 6066..6082
lib/ruby-lint/definitions/rails/arel.rb on lines 6125..6141
lib/ruby-lint/definitions/rails/arel.rb on lines 6193..6209
lib/ruby-lint/definitions/rails/arel.rb on lines 6287..6303
lib/ruby-lint/definitions/rails/arel.rb on lines 6360..6376
lib/ruby-lint/definitions/rails/arel.rb on lines 6456..6472
lib/ruby-lint/definitions/rails/arel.rb on lines 6516..6532
lib/ruby-lint/definitions/rails/arel.rb on lines 6575..6591
lib/ruby-lint/definitions/rails/arel.rb on lines 6952..6968
lib/ruby-lint/definitions/rails/arel.rb on lines 7373..7389
lib/ruby-lint/definitions/rails/rails.rb on lines 986..1002
lib/ruby-lint/definitions/rails/rails.rb on lines 1584..1600
lib/ruby-lint/definitions/rails/sprockets.rb on lines 954..970
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1564..1580

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

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

  defs.define_constant('ActionView::PathSet::SortedElement') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('<=>') do |method|
      method.define_argument('other')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 191 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/array.rb on lines 417..433
lib/ruby-lint/definitions/core/basic_socket.rb on lines 486..502
lib/ruby-lint/definitions/core/cgi.rb on lines 135..151
lib/ruby-lint/definitions/core/csv.rb on lines 457..473
lib/ruby-lint/definitions/core/csv.rb on lines 699..715
lib/ruby-lint/definitions/core/csv.rb on lines 718..734
lib/ruby-lint/definitions/core/csv.rb on lines 865..881
lib/ruby-lint/definitions/core/enumerable.rb on lines 167..183
lib/ruby-lint/definitions/core/file.rb on lines 1213..1229
lib/ruby-lint/definitions/core/gem.rb on lines 830..846
lib/ruby-lint/definitions/core/hash.rb on lines 490..506
lib/ruby-lint/definitions/core/io.rb on lines 746..762
lib/ruby-lint/definitions/core/ipsocket.rb on lines 440..456
lib/ruby-lint/definitions/core/irb.rb on lines 375..391
lib/ruby-lint/definitions/core/matrix.rb on lines 494..510
lib/ruby-lint/definitions/core/open_ssl.rb on lines 196..212
lib/ruby-lint/definitions/core/open_ssl.rb on lines 444..460
lib/ruby-lint/definitions/core/open_ssl.rb on lines 503..519
lib/ruby-lint/definitions/core/open_ssl.rb on lines 812..828
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1221..1237
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3256..3272
lib/ruby-lint/definitions/core/option_parser.rb on lines 557..573
lib/ruby-lint/definitions/core/option_parser.rb on lines 1027..1043
lib/ruby-lint/definitions/core/prime.rb on lines 142..158
lib/ruby-lint/definitions/core/prime.rb on lines 231..247
lib/ruby-lint/definitions/core/prime.rb on lines 332..348
lib/ruby-lint/definitions/core/prime.rb on lines 351..367
lib/ruby-lint/definitions/core/prime.rb on lines 446..462
lib/ruby-lint/definitions/core/range.rb on lines 137..153
lib/ruby-lint/definitions/core/set.rb on lines 216..232
lib/ruby-lint/definitions/core/socket.rb on lines 3126..3142
lib/ruby-lint/definitions/core/sorted_set.rb on lines 64..80
lib/ruby-lint/definitions/core/string_io.rb on lines 319..335
lib/ruby-lint/definitions/core/struct.rb on lines 158..174
lib/ruby-lint/definitions/core/syck.rb on lines 396..412
lib/ruby-lint/definitions/core/syck.rb on lines 509..525
lib/ruby-lint/definitions/core/syck.rb on lines 895..911
lib/ruby-lint/definitions/core/syck.rb on lines 1197..1213
lib/ruby-lint/definitions/core/tcpserver.rb on lines 427..443
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 441..457
lib/ruby-lint/definitions/core/udpsocket.rb on lines 442..458
lib/ruby-lint/definitions/core/unixserver.rb on lines 426..442
lib/ruby-lint/definitions/core/unixsocket.rb on lines 455..471
lib/ruby-lint/definitions/core/vector.rb on lines 201..217
lib/ruby-lint/definitions/core/webrick.rb on lines 580..596
lib/ruby-lint/definitions/core/zlib.rb on lines 291..307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 569..585
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1551..1567
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1672..1688
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1894..1910
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2146..2162
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2234..2250
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2350..2366
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3159..3175
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5744..5760
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7358..7374
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8182..8198
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1072..1088
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1306..1322
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2133..2149
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2569..2585
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2794..2810
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3104..3120
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3323..3339
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3542..3558
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3779..3795
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4125..4141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4378..4394
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4596..4612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4877..4893
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5144..5160
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5363..5379
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5899..5915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6157..6173
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6321..6337
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6876..6892
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7022..7038
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7560..7576
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1382..1398
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2186..2202
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2371..2387
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 511..527
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 881..897
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1202..1218
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2501..2517
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2787..2803
lib/ruby-lint/definitions/rails/active_model.rb on lines 209..225
lib/ruby-lint/definitions/rails/active_model.rb on lines 530..546
lib/ruby-lint/definitions/rails/active_record.rb on lines 3947..3963
lib/ruby-lint/definitions/rails/active_record.rb on lines 4552..4568
lib/ruby-lint/definitions/rails/active_record.rb on lines 6631..6647
lib/ruby-lint/definitions/rails/active_record.rb on lines 6806..6822
lib/ruby-lint/definitions/rails/active_record.rb on lines 7150..7166
lib/ruby-lint/definitions/rails/active_record.rb on lines 8816..8832
lib/ruby-lint/definitions/rails/active_support.rb on lines 1280..1296
lib/ruby-lint/definitions/rails/active_support.rb on lines 1753..1769
lib/ruby-lint/definitions/rails/active_support.rb on lines 2139..2155
lib/ruby-lint/definitions/rails/active_support.rb on lines 2573..2589
lib/ruby-lint/definitions/rails/active_support.rb on lines 3800..3816
lib/ruby-lint/definitions/rails/active_support.rb on lines 4104..4120
lib/ruby-lint/definitions/rails/arel.rb on lines 115..131
lib/ruby-lint/definitions/rails/arel.rb on lines 258..274
lib/ruby-lint/definitions/rails/arel.rb on lines 401..417
lib/ruby-lint/definitions/rails/arel.rb on lines 544..560
lib/ruby-lint/definitions/rails/arel.rb on lines 687..703
lib/ruby-lint/definitions/rails/arel.rb on lines 830..846
lib/ruby-lint/definitions/rails/arel.rb on lines 973..989
lib/ruby-lint/definitions/rails/arel.rb on lines 1116..1132
lib/ruby-lint/definitions/rails/arel.rb on lines 1238..1254
lib/ruby-lint/definitions/rails/arel.rb on lines 1506..1522
lib/ruby-lint/definitions/rails/arel.rb on lines 1587..1603
lib/ruby-lint/definitions/rails/arel.rb on lines 1646..1662
lib/ruby-lint/definitions/rails/arel.rb on lines 1712..1728
lib/ruby-lint/definitions/rails/arel.rb on lines 1771..1787
lib/ruby-lint/definitions/rails/arel.rb on lines 1830..1846
lib/ruby-lint/definitions/rails/arel.rb on lines 1889..1905
lib/ruby-lint/definitions/rails/arel.rb on lines 1948..1964
lib/ruby-lint/definitions/rails/arel.rb on lines 2031..2047
lib/ruby-lint/definitions/rails/arel.rb on lines 2142..2158
lib/ruby-lint/definitions/rails/arel.rb on lines 2206..2222
lib/ruby-lint/definitions/rails/arel.rb on lines 2279..2295
lib/ruby-lint/definitions/rails/arel.rb on lines 2345..2361
lib/ruby-lint/definitions/rails/arel.rb on lines 2409..2425
lib/ruby-lint/definitions/rails/arel.rb on lines 2468..2484
lib/ruby-lint/definitions/rails/arel.rb on lines 2533..2549
lib/ruby-lint/definitions/rails/arel.rb on lines 2592..2608
lib/ruby-lint/definitions/rails/arel.rb on lines 2656..2672
lib/ruby-lint/definitions/rails/arel.rb on lines 2715..2731
lib/ruby-lint/definitions/rails/arel.rb on lines 2774..2790
lib/ruby-lint/definitions/rails/arel.rb on lines 2865..2881
lib/ruby-lint/definitions/rails/arel.rb on lines 2929..2945
lib/ruby-lint/definitions/rails/arel.rb on lines 2993..3009
lib/ruby-lint/definitions/rails/arel.rb on lines 3084..3100
lib/ruby-lint/definitions/rails/arel.rb on lines 3143..3159
lib/ruby-lint/definitions/rails/arel.rb on lines 3202..3218
lib/ruby-lint/definitions/rails/arel.rb on lines 3261..3277
lib/ruby-lint/definitions/rails/arel.rb on lines 3321..3337
lib/ruby-lint/definitions/rails/arel.rb on lines 3380..3396
lib/ruby-lint/definitions/rails/arel.rb on lines 3439..3455
lib/ruby-lint/definitions/rails/arel.rb on lines 3512..3528
lib/ruby-lint/definitions/rails/arel.rb on lines 3571..3587
lib/ruby-lint/definitions/rails/arel.rb on lines 3653..3669
lib/ruby-lint/definitions/rails/arel.rb on lines 3712..3728
lib/ruby-lint/definitions/rails/arel.rb on lines 3771..3787
lib/ruby-lint/definitions/rails/arel.rb on lines 3838..3854
lib/ruby-lint/definitions/rails/arel.rb on lines 3897..3913
lib/ruby-lint/definitions/rails/arel.rb on lines 3956..3972
lib/ruby-lint/definitions/rails/arel.rb on lines 4015..4031
lib/ruby-lint/definitions/rails/arel.rb on lines 4074..4090
lib/ruby-lint/definitions/rails/arel.rb on lines 4133..4149
lib/ruby-lint/definitions/rails/arel.rb on lines 4192..4208
lib/ruby-lint/definitions/rails/arel.rb on lines 4251..4267
lib/ruby-lint/definitions/rails/arel.rb on lines 4316..4332
lib/ruby-lint/definitions/rails/arel.rb on lines 4396..4412
lib/ruby-lint/definitions/rails/arel.rb on lines 4474..4490
lib/ruby-lint/definitions/rails/arel.rb on lines 4552..4568
lib/ruby-lint/definitions/rails/arel.rb on lines 4611..4627
lib/ruby-lint/definitions/rails/arel.rb on lines 4670..4686
lib/ruby-lint/definitions/rails/arel.rb on lines 4729..4745
lib/ruby-lint/definitions/rails/arel.rb on lines 4788..4804
lib/ruby-lint/definitions/rails/arel.rb on lines 4847..4863
lib/ruby-lint/definitions/rails/arel.rb on lines 4906..4922
lib/ruby-lint/definitions/rails/arel.rb on lines 4965..4981
lib/ruby-lint/definitions/rails/arel.rb on lines 5024..5040
lib/ruby-lint/definitions/rails/arel.rb on lines 5092..5108
lib/ruby-lint/definitions/rails/arel.rb on lines 5156..5172
lib/ruby-lint/definitions/rails/arel.rb on lines 5220..5236
lib/ruby-lint/definitions/rails/arel.rb on lines 5284..5300
lib/ruby-lint/definitions/rails/arel.rb on lines 5398..5414
lib/ruby-lint/definitions/rails/arel.rb on lines 5494..5510
lib/ruby-lint/definitions/rails/arel.rb on lines 5608..5624
lib/ruby-lint/definitions/rails/arel.rb on lines 5673..5689
lib/ruby-lint/definitions/rails/arel.rb on lines 5732..5748
lib/ruby-lint/definitions/rails/arel.rb on lines 5804..5820
lib/ruby-lint/definitions/rails/arel.rb on lines 5863..5879
lib/ruby-lint/definitions/rails/arel.rb on lines 5927..5943
lib/ruby-lint/definitions/rails/arel.rb on lines 6007..6023
lib/ruby-lint/definitions/rails/arel.rb on lines 6066..6082
lib/ruby-lint/definitions/rails/arel.rb on lines 6125..6141
lib/ruby-lint/definitions/rails/arel.rb on lines 6193..6209
lib/ruby-lint/definitions/rails/arel.rb on lines 6287..6303
lib/ruby-lint/definitions/rails/arel.rb on lines 6360..6376
lib/ruby-lint/definitions/rails/arel.rb on lines 6456..6472
lib/ruby-lint/definitions/rails/arel.rb on lines 6516..6532
lib/ruby-lint/definitions/rails/arel.rb on lines 6575..6591
lib/ruby-lint/definitions/rails/arel.rb on lines 6952..6968
lib/ruby-lint/definitions/rails/arel.rb on lines 7373..7389
lib/ruby-lint/definitions/rails/rails.rb on lines 986..1002
lib/ruby-lint/definitions/rails/rails.rb on lines 1584..1600
lib/ruby-lint/definitions/rails/sprockets.rb on lines 954..970
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1564..1580

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

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

  defs.define_constant('Arel::Attributes::Decimal::SortedElement') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('<=>') do |method|
      method.define_argument('other')
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 191 other locations - About 55 mins to fix
lib/ruby-lint/definitions/core/array.rb on lines 417..433
lib/ruby-lint/definitions/core/basic_socket.rb on lines 486..502
lib/ruby-lint/definitions/core/cgi.rb on lines 135..151
lib/ruby-lint/definitions/core/csv.rb on lines 457..473
lib/ruby-lint/definitions/core/csv.rb on lines 699..715
lib/ruby-lint/definitions/core/csv.rb on lines 718..734
lib/ruby-lint/definitions/core/csv.rb on lines 865..881
lib/ruby-lint/definitions/core/enumerable.rb on lines 167..183
lib/ruby-lint/definitions/core/file.rb on lines 1213..1229
lib/ruby-lint/definitions/core/gem.rb on lines 830..846
lib/ruby-lint/definitions/core/hash.rb on lines 490..506
lib/ruby-lint/definitions/core/io.rb on lines 746..762
lib/ruby-lint/definitions/core/ipsocket.rb on lines 440..456
lib/ruby-lint/definitions/core/irb.rb on lines 375..391
lib/ruby-lint/definitions/core/matrix.rb on lines 494..510
lib/ruby-lint/definitions/core/open_ssl.rb on lines 196..212
lib/ruby-lint/definitions/core/open_ssl.rb on lines 444..460
lib/ruby-lint/definitions/core/open_ssl.rb on lines 503..519
lib/ruby-lint/definitions/core/open_ssl.rb on lines 812..828
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1221..1237
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3256..3272
lib/ruby-lint/definitions/core/option_parser.rb on lines 557..573
lib/ruby-lint/definitions/core/option_parser.rb on lines 1027..1043
lib/ruby-lint/definitions/core/prime.rb on lines 142..158
lib/ruby-lint/definitions/core/prime.rb on lines 231..247
lib/ruby-lint/definitions/core/prime.rb on lines 332..348
lib/ruby-lint/definitions/core/prime.rb on lines 351..367
lib/ruby-lint/definitions/core/prime.rb on lines 446..462
lib/ruby-lint/definitions/core/range.rb on lines 137..153
lib/ruby-lint/definitions/core/set.rb on lines 216..232
lib/ruby-lint/definitions/core/socket.rb on lines 3126..3142
lib/ruby-lint/definitions/core/sorted_set.rb on lines 64..80
lib/ruby-lint/definitions/core/string_io.rb on lines 319..335
lib/ruby-lint/definitions/core/struct.rb on lines 158..174
lib/ruby-lint/definitions/core/syck.rb on lines 396..412
lib/ruby-lint/definitions/core/syck.rb on lines 509..525
lib/ruby-lint/definitions/core/syck.rb on lines 895..911
lib/ruby-lint/definitions/core/syck.rb on lines 1197..1213
lib/ruby-lint/definitions/core/tcpserver.rb on lines 427..443
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 441..457
lib/ruby-lint/definitions/core/udpsocket.rb on lines 442..458
lib/ruby-lint/definitions/core/unixserver.rb on lines 426..442
lib/ruby-lint/definitions/core/unixsocket.rb on lines 455..471
lib/ruby-lint/definitions/core/vector.rb on lines 201..217
lib/ruby-lint/definitions/core/webrick.rb on lines 580..596
lib/ruby-lint/definitions/core/zlib.rb on lines 291..307
lib/ruby-lint/definitions/gems/mongoid.rb on lines 569..585
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1551..1567
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1672..1688
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1894..1910
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2146..2162
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2234..2250
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2350..2366
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3159..3175
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5744..5760
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7358..7374
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8182..8198
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1072..1088
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1306..1322
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2133..2149
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2569..2585
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2794..2810
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3104..3120
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3323..3339
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3542..3558
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3779..3795
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4125..4141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4378..4394
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4596..4612
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4877..4893
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5144..5160
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5363..5379
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5899..5915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6157..6173
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6321..6337
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6876..6892
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7022..7038
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7560..7576
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1382..1398
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2186..2202
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2371..2387
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 511..527
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 881..897
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1202..1218
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2501..2517
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2787..2803
lib/ruby-lint/definitions/rails/action_view.rb on lines 4069..4085
lib/ruby-lint/definitions/rails/active_model.rb on lines 209..225
lib/ruby-lint/definitions/rails/active_model.rb on lines 530..546
lib/ruby-lint/definitions/rails/active_record.rb on lines 3947..3963
lib/ruby-lint/definitions/rails/active_record.rb on lines 4552..4568
lib/ruby-lint/definitions/rails/active_record.rb on lines 6631..6647
lib/ruby-lint/definitions/rails/active_record.rb on lines 6806..6822
lib/ruby-lint/definitions/rails/active_record.rb on lines 7150..7166
lib/ruby-lint/definitions/rails/active_record.rb on lines 8816..8832
lib/ruby-lint/definitions/rails/active_support.rb on lines 1280..1296
lib/ruby-lint/definitions/rails/active_support.rb on lines 1753..1769
lib/ruby-lint/definitions/rails/active_support.rb on lines 2139..2155
lib/ruby-lint/definitions/rails/active_support.rb on lines 2573..2589
lib/ruby-lint/definitions/rails/active_support.rb on lines 3800..3816
lib/ruby-lint/definitions/rails/active_support.rb on lines 4104..4120
lib/ruby-lint/definitions/rails/arel.rb on lines 115..131
lib/ruby-lint/definitions/rails/arel.rb on lines 258..274
lib/ruby-lint/definitions/rails/arel.rb on lines 544..560
lib/ruby-lint/definitions/rails/arel.rb on lines 687..703
lib/ruby-lint/definitions/rails/arel.rb on lines 830..846
lib/ruby-lint/definitions/rails/arel.rb on lines 973..989
lib/ruby-lint/definitions/rails/arel.rb on lines 1116..1132
lib/ruby-lint/definitions/rails/arel.rb on lines 1238..1254
lib/ruby-lint/definitions/rails/arel.rb on lines 1506..1522
lib/ruby-lint/definitions/rails/arel.rb on lines 1587..1603
lib/ruby-lint/definitions/rails/arel.rb on lines 1646..1662
lib/ruby-lint/definitions/rails/arel.rb on lines 1712..1728
lib/ruby-lint/definitions/rails/arel.rb on lines 1771..1787
lib/ruby-lint/definitions/rails/arel.rb on lines 1830..1846
lib/ruby-lint/definitions/rails/arel.rb on lines 1889..1905
lib/ruby-lint/definitions/rails/arel.rb on lines 1948..1964
lib/ruby-lint/definitions/rails/arel.rb on lines 2031..2047
lib/ruby-lint/definitions/rails/arel.rb on lines 2142..2158
lib/ruby-lint/definitions/rails/arel.rb on lines 2206..2222
lib/ruby-lint/definitions/rails/arel.rb on lines 2279..2295
lib/ruby-lint/definitions/rails/arel.rb on lines 2345..2361
lib/ruby-lint/definitions/rails/arel.rb on lines 2409..2425
lib/ruby-lint/definitions/rails/arel.rb on lines 2468..2484
lib/ruby-lint/definitions/rails/arel.rb on lines 2533..2549
lib/ruby-lint/definitions/rails/arel.rb on lines 2592..2608
lib/ruby-lint/definitions/rails/arel.rb on lines 2656..2672
lib/ruby-lint/definitions/rails/arel.rb on lines 2715..2731
lib/ruby-lint/definitions/rails/arel.rb on lines 2774..2790
lib/ruby-lint/definitions/rails/arel.rb on lines 2865..2881
lib/ruby-lint/definitions/rails/arel.rb on lines 2929..2945
lib/ruby-lint/definitions/rails/arel.rb on lines 2993..3009
lib/ruby-lint/definitions/rails/arel.rb on lines 3084..3100
lib/ruby-lint/definitions/rails/arel.rb on lines 3143..3159
lib/ruby-lint/definitions/rails/arel.rb on lines 3202..3218
lib/ruby-lint/definitions/rails/arel.rb on lines 3261..3277
lib/ruby-lint/definitions/rails/arel.rb on lines 3321..3337
lib/ruby-lint/definitions/rails/arel.rb on lines 3380..3396
lib/ruby-lint/definitions/rails/arel.rb on lines 3439..3455
lib/ruby-lint/definitions/rails/arel.rb on lines 3512..3528
lib/ruby-lint/definitions/rails/arel.rb on lines 3571..3587
lib/ruby-lint/definitions/rails/arel.rb on lines 3653..3669
lib/ruby-lint/definitions/rails/arel.rb on lines 3712..3728
lib/ruby-lint/definitions/rails/arel.rb on lines 3771..3787
lib/ruby-lint/definitions/rails/arel.rb on lines 3838..3854
lib/ruby-lint/definitions/rails/arel.rb on lines 3897..3913
lib/ruby-lint/definitions/rails/arel.rb on lines 3956..3972
lib/ruby-lint/definitions/rails/arel.rb on lines 4015..4031
lib/ruby-lint/definitions/rails/arel.rb on lines 4074..4090
lib/ruby-lint/definitions/rails/arel.rb on lines 4133..4149
lib/ruby-lint/definitions/rails/arel.rb on lines 4192..4208
lib/ruby-lint/definitions/rails/arel.rb on lines 4251..4267
lib/ruby-lint/definitions/rails/arel.rb on lines 4316..4332
lib/ruby-lint/definitions/rails/arel.rb on lines 4396..4412
lib/ruby-lint/definitions/rails/arel.rb on lines 4474..4490
lib/ruby-lint/definitions/rails/arel.rb on lines 4552..4568
lib/ruby-lint/definitions/rails/arel.rb on lines 4611..4627
lib/ruby-lint/definitions/rails/arel.rb on lines 4670..4686
lib/ruby-lint/definitions/rails/arel.rb on lines 4729..4745
lib/ruby-lint/definitions/rails/arel.rb on lines 4788..4804
lib/ruby-lint/definitions/rails/arel.rb on lines 4847..4863
lib/ruby-lint/definitions/rails/arel.rb on lines 4906..4922
lib/ruby-lint/definitions/rails/arel.rb on lines 4965..4981
lib/ruby-lint/definitions/rails/arel.rb on lines 5024..5040
lib/ruby-lint/definitions/rails/arel.rb on lines 5092..5108
lib/ruby-lint/definitions/rails/arel.rb on lines 5156..5172
lib/ruby-lint/definitions/rails/arel.rb on lines 5220..5236
lib/ruby-lint/definitions/rails/arel.rb on lines 5284..5300
lib/ruby-lint/definitions/rails/arel.rb on lines 5398..5414
lib/ruby-lint/definitions/rails/arel.rb on lines 5494..5510
lib/ruby-lint/definitions/rails/arel.rb on lines 5608..5624
lib/ruby-lint/definitions/rails/arel.rb on lines 5673..5689
lib/ruby-lint/definitions/rails/arel.rb on lines 5732..5748
lib/ruby-lint/definitions/rails/arel.rb on lines 5804..5820
lib/ruby-lint/definitions/rails/arel.rb on lines 5863..5879
lib/ruby-lint/definitions/rails/arel.rb on lines 5927..5943
lib/ruby-lint/definitions/rails/arel.rb on lines 6007..6023
lib/ruby-lint/definitions/rails/arel.rb on lines 6066..6082
lib/ruby-lint/definitions/rails/arel.rb on lines 6125..6141
lib/ruby-lint/definitions/rails/arel.rb on lines 6193..6209
lib/ruby-lint/definitions/rails/arel.rb on lines 6287..6303
lib/ruby-lint/definitions/rails/arel.rb on lines 6360..6376
lib/ruby-lint/definitions/rails/arel.rb on lines 6456..6472
lib/ruby-lint/definitions/rails/arel.rb on lines 6516..6532
lib/ruby-lint/definitions/rails/arel.rb on lines 6575..6591
lib/ruby-lint/definitions/rails/arel.rb on lines 6952..6968
lib/ruby-lint/definitions/rails/arel.rb on lines 7373..7389
lib/ruby-lint/definitions/rails/rails.rb on lines 986..1002
lib/ruby-lint/definitions/rails/rails.rb on lines 1584..1600
lib/ruby-lint/definitions/rails/sprockets.rb on lines 954..970
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1564..1580

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

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