YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('atom_feed') do |method|
      method.define_optional_argument('options')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('pending') do |method|
      method.define_optional_argument('description')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('property') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_method('find') do |method|
      method.define_argument('object')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_method('flat_map') do |method|
      method.define_argument('array')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_method('wrap') do |method|
      method.define_argument('line')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Mongoid::Errors::MongoidError') do |klass|
    klass.inherits(defs.constant_proxy('StandardError', RubyLint.registry))

    klass.define_instance_method('compose_message') do |method|
      method.define_argument('key')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_method('def_erb_method') do |method|
      method.define_argument('methodname')
Severity: Major
Found in lib/ruby-lint/definitions/core/erb.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_method('gtype')

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('epsilon')

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('gid')

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('all?')

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_method('set_name_cache') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Devise::Models::Registerable::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('new_with_session') do |method|
      method.define_argument('params')
Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('flag') do |method|
      method.define_argument('object')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_method('range') do |method|
      method.define_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/lib_xml.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('OptionParser::Switch::RequiredArgument') 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 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('atom_feed') do |method|
      method.define_optional_argument('options')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_method('filter_backtrace') do |method|
      method.define_argument('backtrace')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 3675..3680
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActionView::OptimizedFileSystemResolver') do |klass|
    klass.inherits(defs.constant_proxy('ActionView::FileSystemResolver', RubyLint.registry))

    klass.define_instance_method('build_query') do |method|
      method.define_argument('path')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 39 other locations - About 15 mins to fix
lib/ruby-lint/definitions/core/abbrev.rb on lines 7..12
lib/ruby-lint/definitions/core/erb.rb on lines 255..260
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2774..2779
lib/ruby-lint/definitions/core/option_parser.rb on lines 1263..1268
lib/ruby-lint/definitions/core/option_parser.rb on lines 1282..1287
lib/ruby-lint/definitions/core/uri.rb on lines 1051..1056
lib/ruby-lint/definitions/core/uri.rb on lines 1319..1324
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2837..2842
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3606..3611
lib/ruby-lint/definitions/gems/devise.rb on lines 1824..1829
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6807..6812
lib/ruby-lint/definitions/gems/mongoid.rb on lines 762..767
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3693..3698
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4187..4192
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6376..6381
lib/ruby-lint/definitions/gems/mongoid.rb on lines 8524..8529
lib/ruby-lint/definitions/gems/rspec.rb on lines 92..97
lib/ruby-lint/definitions/gems/rspec.rb on lines 2217..2222
lib/ruby-lint/definitions/gems/rspec.rb on lines 2226..2231
lib/ruby-lint/definitions/gems/rspec.rb on lines 6514..6519
lib/ruby-lint/definitions/gems/test.rb on lines 1918..1923
lib/ruby-lint/definitions/gems/test.rb on lines 2602..2607
lib/ruby-lint/definitions/gems/test.rb on lines 2626..2631
lib/ruby-lint/definitions/rails/action_controller.rb on lines 967..972
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1015..1020
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2670..2675
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 659..664
lib/ruby-lint/definitions/rails/action_view.rb on lines 526..531
lib/ruby-lint/definitions/rails/action_view.rb on lines 5274..5279
lib/ruby-lint/definitions/rails/active_record.rb on lines 36..41
lib/ruby-lint/definitions/rails/active_record.rb on lines 1877..1882
lib/ruby-lint/definitions/rails/active_record.rb on lines 5610..5615
lib/ruby-lint/definitions/rails/active_record.rb on lines 9522..9527
lib/ruby-lint/definitions/rails/active_support.rb on lines 701..706
lib/ruby-lint/definitions/rails/active_support.rb on lines 1500..1505
lib/ruby-lint/definitions/rails/active_support.rb on lines 4319..4324
lib/ruby-lint/definitions/rails/active_support.rb on lines 5166..5171
lib/ruby-lint/definitions/rails/arel.rb on lines 7948..7953
lib/ruby-lint/definitions/rails/rails.rb on lines 667..672

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language