YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('Gem::FilePermissionError') do |klass|
    klass.inherits(defs.constant_proxy('Gem::Exception', RubyLint.registry))

    klass.define_instance_method('directory')

Severity: Major
Found in lib/ruby-lint/definitions/core/gem.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

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

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

  defs.define_constant('Devise::Strategies::Base::NULL_STORE') do |klass|
    klass.inherits(defs.constant_proxy('Rack::Session::Abstract::SessionHash', RubyLint.registry))

    klass.define_instance_method('exists?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

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

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

  defs.define_constant('Devise::Strategies::DatabaseAuthenticatable::NULL_STORE') do |klass|
    klass.inherits(defs.constant_proxy('Rack::Session::Abstract::SessionHash', RubyLint.registry))

    klass.define_instance_method('exists?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

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

    klass.define_instance_method('build')

Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

  defs.define_constant('RSpec::Core::ExampleGroup::SkipDeclaredInExample') do |klass|
    klass.inherits(defs.constant_proxy('StandardError', RubyLint.registry))

    klass.define_instance_method('argument')

Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

  defs.define_constant('Arel::SqlLiteral::Rationalizer') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048

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

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

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

    klass.define_instance_method('cause')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

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

    klass.define_instance_method('create')

Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

  defs.define_constant('RSpec::Core::AnonymousExampleGroup::SkipDeclaredInExample') do |klass|
    klass.inherits(defs.constant_proxy('StandardError', RubyLint.registry))

    klass.define_instance_method('argument')

Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

  defs.define_constant('Arel::Nodes::BindParam::Rationalizer') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

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

    klass.define_instance_method('inheritable_copy')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

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

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

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

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

  defs.define_constant('Arel::Nodes::BindParam::Complexifier') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

  defs.define_constant('Arel::SqlLiteral::Complexifier') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

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

    klass.define_instance_method('get')

Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

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

    klass.define_instance_method('extract_tag')

Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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

  defs.define_constant('WEBrick::HTTPUtils::FormData::Complexifier') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/core/webrick.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

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