YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('OptionParser::Switch::PlacedArgument') do |klass|
    klass.inherits(defs.constant_proxy('OptionParser::Switch', RubyLint.registry))

    klass.define_instance_method('parse') do |method|
      method.define_argument('arg')
Severity: Major
Found in lib/ruby-lint/definitions/core/option_parser.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('ActiveModel::Validations::WithValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('validate_each') do |method|
      method.define_argument('record')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('ActiveRecord::SchemaMigration::AbsenceValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('validate_each') do |method|
      method.define_argument('record')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('ActiveRecord::Validations::AssociatedValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('validate_each') do |method|
      method.define_argument('record')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('Gtk::IMContextSimple') do |klass|
    klass.inherits(defs.constant_proxy('Gtk::IMContext', RubyLint.registry))

    klass.define_instance_method('add_table') do |method|
      method.define_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/gtk.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('RSpec::Core::Invocations::Bisect') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('call') do |method|
      method.define_argument('options')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('OptionParser::Switch::OptionalArgument') do |klass|
    klass.inherits(defs.constant_proxy('OptionParser::Switch', RubyLint.registry))

    klass.define_instance_method('parse') do |method|
      method.define_argument('arg')
Severity: Major
Found in lib/ruby-lint/definitions/core/option_parser.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

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

    klass.define_instance_method('method_missing') do |method|
      method.define_argument('method')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

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

    klass.define_instance_method('positionally') do |method|
      method.define_argument('selector')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

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

    klass.define_instance_method('validate_each') do |method|
      method.define_argument('document')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('ActiveModel::Validations::AbsenceValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('validate_each') do |method|
      method.define_argument('record')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('ActiveRecord::Base::AssociatedValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('validate_each') do |method|
      method.define_argument('record')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

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

    klass.define_instance_method('method_missing') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('Mongoid::Indexable::Validators::Options') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('validate') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('Mongoid::Validatable::AssociatedValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('validate_each') do |method|
      method.define_argument('document')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('Mongoid::Validatable::PresenceValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('validate_each') do |method|
      method.define_argument('document')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('ActiveModel::Validations::PresenceValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('validate_each') do |method|
      method.define_argument('record')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

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

    klass.define_instance_method('display_backtrace') do |method|
      method.define_argument('backtrace')
Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1253..1259
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

  defs.define_constant('OptionParser::Switch::OptionalArgument::PlacedArgument') do |klass|
    klass.inherits(defs.constant_proxy('OptionParser::Switch', RubyLint.registry))

    klass.define_instance_method('parse') do |method|
      method.define_argument('arg')
Severity: Major
Found in lib/ruby-lint/definitions/core/option_parser.rb and 28 other locations - About 20 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1228..1234
lib/ruby-lint/definitions/core/option_parser.rb on lines 1272..1278
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3849..3855
lib/ruby-lint/definitions/gems/gtk.rb on lines 8530..8536
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4717..4723
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5174..5180
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5659..5665
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8823..8829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8875..8881
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8909..8915
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 700..706
lib/ruby-lint/definitions/gems/rspec.rb on lines 4847..4853
lib/ruby-lint/definitions/gems/rspec.rb on lines 4857..4863
lib/ruby-lint/definitions/gems/rspec.rb on lines 5069..5075
lib/ruby-lint/definitions/rails/action_view.rb on lines 4433..4439
lib/ruby-lint/definitions/rails/active_model.rb on lines 1213..1219
lib/ruby-lint/definitions/rails/active_model.rb on lines 1492..1498
lib/ruby-lint/definitions/rails/active_model.rb on lines 1502..1508
lib/ruby-lint/definitions/rails/active_record.rb on lines 72..78
lib/ruby-lint/definitions/rails/active_record.rb on lines 1578..1584
lib/ruby-lint/definitions/rails/active_record.rb on lines 1641..1647
lib/ruby-lint/definitions/rails/active_record.rb on lines 3115..3121
lib/ruby-lint/definitions/rails/active_record.rb on lines 8675..8681
lib/ruby-lint/definitions/rails/active_record.rb on lines 9223..9229
lib/ruby-lint/definitions/rails/active_record.rb on lines 9286..9292
lib/ruby-lint/definitions/rails/active_record.rb on lines 10765..10771
lib/ruby-lint/definitions/rails/active_record.rb on lines 11715..11721
lib/ruby-lint/definitions/rails/active_support.rb on lines 4152..4158

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

    klass.define_method('new')

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 710..721
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

Severity
Category
Status
Source
Language