YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('Sprockets::UglifierCompressor') do |klass|
    klass.inherits(defs.constant_proxy('Tilt::Template', RubyLint.registry))

    klass.define_method('engine_initialized?')

Severity: Major
Found in lib/ruby-lint/definitions/rails/sprockets.rb and 6 other locations - About 40 mins to fix
lib/ruby-lint/definitions/rails/sprockets.rb on lines 394..407
lib/ruby-lint/definitions/rails/sprockets.rb on lines 617..630
lib/ruby-lint/definitions/rails/sprockets.rb on lines 633..646
lib/ruby-lint/definitions/rails/sprockets.rb on lines 732..745
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1624..1637
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1716..1729

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

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

  defs.define_constant('OpenSSL::OCSP::BasicResponse') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 5 other locations - About 40 mins to fix
lib/ruby-lint/definitions/core/syck.rb on lines 202..219
lib/ruby-lint/definitions/core/zlib.rb on lines 7..24
lib/ruby-lint/definitions/gems/devise.rb on lines 2104..2121
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6052..6069
lib/ruby-lint/definitions/gems/rspec.rb on lines 9726..9743

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('SignalException') do |klass|
    klass.inherits(defs.constant_proxy('Exception', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_optional_argument('signo')
Severity: Minor
Found in lib/ruby-lint/definitions/core/signal_exception.rb and 1 other location - About 40 mins to fix
lib/ruby-lint/definitions/core/system_exit.rb on lines 7..19

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 3 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3306..3315
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3643..3652
lib/ruby-lint/definitions/rails/active_support.rb on lines 1442..1451

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('SystemExit') do |klass|
    klass.inherits(defs.constant_proxy('Exception', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_optional_argument('first')
Severity: Minor
Found in lib/ruby-lint/definitions/core/system_exit.rb and 1 other location - About 40 mins to fix
lib/ruby-lint/definitions/core/signal_exception.rb on lines 7..19

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('klass')
Severity: Minor
Found in lib/ruby-lint/definitions/rails/active_record.rb and 1 other location - About 40 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 73..84

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Nokogiri::XML::ProcessingInstruction') do |klass|
    klass.inherits(defs.constant_proxy('Nokogiri::XML::Node', RubyLint.registry))

    klass.define_method('new')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 1 other location - About 40 mins to fix
lib/ruby-lint/definitions/rails/active_support.rb on lines 1428..1438

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Mongoid::Relations::Eager::HasAndBelongsToMany') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Relations::Eager::Base', RubyLint.registry))

    klass.define_instance_method('group_by_key')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 2 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1852..1865
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2104..2117

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 3 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3454..3463
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3643..3652
lib/ruby-lint/definitions/rails/active_support.rb on lines 1442..1451

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('account_update')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/devise.rb and 2 other locations - About 40 mins to fix
lib/ruby-lint/definitions/core/erb.rb on lines 143..156
lib/ruby-lint/definitions/core/gem.rb on lines 1386..1399

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Mongoid::Contextual::Memory::HasAndBelongsToMany') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Relations::Eager::Base', RubyLint.registry))

    klass.define_instance_method('group_by_key')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 2 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2104..2117
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6508..6521

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Mongoid::Contextual::Mongo::HasAndBelongsToMany') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Relations::Eager::Base', RubyLint.registry))

    klass.define_instance_method('group_by_key')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 2 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1852..1865
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6508..6521

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('OpenURI::HTTPRedirect') do |klass|
    klass.inherits(defs.constant_proxy('OpenURI::HTTPError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('message')
Severity: Minor
Found in lib/ruby-lint/definitions/core/open_uri.rb and 1 other location - About 40 mins to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 45..56

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActiveSupport::Deprecation::DeprecatedConstantProxy') do |klass|
    klass.inherits(defs.constant_proxy('ActiveSupport::Deprecation::DeprecationProxy', RubyLint.registry))

    klass.define_instance_method('class')

Severity: Minor
Found in lib/ruby-lint/definitions/rails/active_support.rb and 1 other location - About 40 mins to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6683..6693

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('empty?')

Severity: Minor
Found in lib/ruby-lint/definitions/core/erb.rb and 2 other locations - About 40 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1386..1399
lib/ruby-lint/definitions/gems/devise.rb on lines 2073..2086

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('home')

Severity: Minor
Found in lib/ruby-lint/definitions/core/gem.rb and 2 other locations - About 40 mins to fix
lib/ruby-lint/definitions/core/erb.rb on lines 143..156
lib/ruby-lint/definitions/gems/devise.rb on lines 2073..2086

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

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

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

    klass.define_instance_method('call') do |method|
      method.define_argument('env')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 15 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/tempfile.rb on lines 54..64
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5768..5778
lib/ruby-lint/definitions/gems/rspec.rb on lines 8788..8798
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1756..1766
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 355..365
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1258..1268
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3674..3684
lib/ruby-lint/definitions/rails/action_view.rb on lines 4443..4453
lib/ruby-lint/definitions/rails/active_record.rb on lines 3647..3657
lib/ruby-lint/definitions/rails/active_record.rb on lines 4070..4080
lib/ruby-lint/definitions/rails/active_record.rb on lines 6299..6309
lib/ruby-lint/definitions/rails/active_record.rb on lines 7419..7429
lib/ruby-lint/definitions/rails/active_record.rb on lines 8965..8975
lib/ruby-lint/definitions/rails/active_support.rb on lines 2798..2808
lib/ruby-lint/definitions/rails/rails.rb on lines 1658..1668

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

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

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

    klass.define_instance_method('call') do |method|
      method.define_argument('env')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 15 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/tempfile.rb on lines 54..64
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5768..5778
lib/ruby-lint/definitions/gems/rspec.rb on lines 8788..8798
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1756..1766
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 355..365
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 747..757
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1258..1268
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3674..3684
lib/ruby-lint/definitions/rails/action_view.rb on lines 4443..4453
lib/ruby-lint/definitions/rails/active_record.rb on lines 3647..3657
lib/ruby-lint/definitions/rails/active_record.rb on lines 4070..4080
lib/ruby-lint/definitions/rails/active_record.rb on lines 6299..6309
lib/ruby-lint/definitions/rails/active_record.rb on lines 7419..7429
lib/ruby-lint/definitions/rails/active_support.rb on lines 2798..2808
lib/ruby-lint/definitions/rails/rails.rb on lines 1658..1668

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

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

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

    klass.define_instance_method('each') do |method|
      method.define_block_argument('block')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 15 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/tempfile.rb on lines 54..64
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5768..5778
lib/ruby-lint/definitions/gems/rspec.rb on lines 8788..8798
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1756..1766
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 355..365
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 747..757
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1258..1268
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3674..3684
lib/ruby-lint/definitions/rails/active_record.rb on lines 3647..3657
lib/ruby-lint/definitions/rails/active_record.rb on lines 4070..4080
lib/ruby-lint/definitions/rails/active_record.rb on lines 6299..6309
lib/ruby-lint/definitions/rails/active_record.rb on lines 7419..7429
lib/ruby-lint/definitions/rails/active_record.rb on lines 8965..8975
lib/ruby-lint/definitions/rails/active_support.rb on lines 2798..2808
lib/ruby-lint/definitions/rails/rails.rb on lines 1658..1668

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

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

  defs.define_constant('ActiveRecord::ConnectionAdapters::AbstractAdapter::SchemaCreation') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('accept') do |method|
      method.define_argument('o')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 15 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/tempfile.rb on lines 54..64
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5768..5778
lib/ruby-lint/definitions/gems/rspec.rb on lines 8788..8798
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1756..1766
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 355..365
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 747..757
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1258..1268
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3674..3684
lib/ruby-lint/definitions/rails/action_view.rb on lines 4443..4453
lib/ruby-lint/definitions/rails/active_record.rb on lines 4070..4080
lib/ruby-lint/definitions/rails/active_record.rb on lines 6299..6309
lib/ruby-lint/definitions/rails/active_record.rb on lines 7419..7429
lib/ruby-lint/definitions/rails/active_record.rb on lines 8965..8975
lib/ruby-lint/definitions/rails/active_support.rb on lines 2798..2808
lib/ruby-lint/definitions/rails/rails.rb on lines 1658..1668

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

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