YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('attributes_hash')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

  defs.define_constant('Mongoid::Atomic::Paths::Embedded') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('delete_modifier')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_instance_method('blank?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_instance_method('force_size?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/gtk.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_instance_method('attribute')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734

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

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

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

    klass.define_method('[]')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

  defs.define_constant('OpenSSL::OCSP::CertificateId') 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 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/syck.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_instance_method('inspect')

Severity: Major
Found in lib/ruby-lint/definitions/core/encoding.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

  defs.define_constant('LibXML::XML::Dtd') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('external_id')

Severity: Major
Found in lib/ruby-lint/definitions/gems/lib_xml.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

  defs.define_constant('GLib::Timer') do |klass|
    klass.inherits(defs.constant_proxy('GLib::Boxed', RubyLint.registry))

    klass.define_instance_method('continue')

Severity: Major
Found in lib/ruby-lint/definitions/gems/glib.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

  defs.define_constant('OpenSSL::PKCS7::RecipientInfo') 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 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

  defs.define_constant('JSON::Ext::Parser') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/json.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/syck.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/json.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_instance_method('no_month_change?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/gtk.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

  defs.define_constant('Encoding::UndefinedConversionError') do |klass|
    klass.inherits(defs.constant_proxy('EncodingError', RubyLint.registry))

    klass.define_instance_method('destination_encoding')

Severity: Major
Found in lib/ruby-lint/definitions/core/encoding.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_instance_method('changed')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

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

    klass.define_instance_method('blank?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 19 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
lib/ruby-lint/definitions/core/json.rb on lines 288..299
lib/ruby-lint/definitions/core/json.rb on lines 414..425
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
lib/ruby-lint/definitions/core/syck.rb on lines 252..263
lib/ruby-lint/definitions/core/syck.rb on lines 637..648
lib/ruby-lint/definitions/gems/glib.rb on lines 3586..3597
lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

    klass.define_instance_method('benchmark') do |method|
      method.define_optional_argument('message')
Severity: Minor
Found in lib/ruby-lint/definitions/rails/active_support.rb and 4 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/rb_config.rb on lines 7..15
lib/ruby-lint/definitions/gems/rspec.rb on lines 899..907
lib/ruby-lint/definitions/gems/rspec.rb on lines 4208..4216
lib/ruby-lint/definitions/rails/action_controller.rb on lines 7..15

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

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