YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('actor')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3544..3567

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

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

    klass.define_instance_method('content_tag') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_view.rb on lines 274..292
lib/ruby-lint/definitions/rails/action_view.rb on lines 2279..2297

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

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('RSpec::Core::Notifications::GroupNotification') do |klass|
    klass.inherits(defs.constant_proxy('Struct', RubyLint.registry))

    klass.define_method('[]') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/gems/rspec.rb on lines 6332..6350

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('column')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 2772..2791
lib/ruby-lint/definitions/rails/active_record.rb on lines 2828..2847
lib/ruby-lint/definitions/rails/active_record.rb on lines 10422..10441
lib/ruby-lint/definitions/rails/active_record.rb on lines 10478..10497

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('column')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 719..738
lib/ruby-lint/definitions/rails/active_record.rb on lines 2828..2847
lib/ruby-lint/definitions/rails/active_record.rb on lines 10422..10441
lib/ruby-lint/definitions/rails/active_record.rb on lines 10478..10497

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('sanitize') do |method|
      method.define_argument('html')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 785..802
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2647..2664
lib/ruby-lint/definitions/rails/action_view.rb on lines 1793..1810
lib/ruby-lint/definitions/rails/active_record.rb on lines 11725..11742

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('column')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 719..738
lib/ruby-lint/definitions/rails/active_record.rb on lines 2772..2791
lib/ruby-lint/definitions/rails/active_record.rb on lines 2828..2847
lib/ruby-lint/definitions/rails/active_record.rb on lines 10478..10497

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('associations')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 719..738
lib/ruby-lint/definitions/rails/active_record.rb on lines 2772..2791
lib/ruby-lint/definitions/rails/active_record.rb on lines 2828..2847
lib/ruby-lint/definitions/rails/active_record.rb on lines 10422..10441

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Rails::InfoController') do |klass|
    klass.inherits(defs.constant_proxy('ActionController::Base', RubyLint.registry))

    klass.define_method('_helpers')

Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1833..1858
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1871..1896
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2583..2608
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3542..3567

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

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('ActiveRecord::Base::HasAndBelongsToManyAssociation') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Associations::CollectionAssociation', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('owner')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 571..587
lib/ruby-lint/definitions/rails/active_record.rb on lines 10104..10120

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('sanitize') do |method|
      method.define_argument('html')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 785..802
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2647..2664
lib/ruby-lint/definitions/rails/action_view.rb on lines 6804..6821
lib/ruby-lint/definitions/rails/active_record.rb on lines 11725..11742

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('associations')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 719..738
lib/ruby-lint/definitions/rails/active_record.rb on lines 2772..2791
lib/ruby-lint/definitions/rails/active_record.rb on lines 10422..10441
lib/ruby-lint/definitions/rails/active_record.rb on lines 10478..10497

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('OpenSSL::Netscape::SPKI') 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 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1833..1858
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2583..2608
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3542..3567
lib/ruby-lint/definitions/rails/rails.rb on lines 1038..1063

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('OpenSSL::X509::Extension') 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 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1833..1858
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1871..1896
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2583..2608
lib/ruby-lint/definitions/rails/rails.rb on lines 1038..1063

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('execute_or_raise') do |method|
      method.define_argument('ids')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 785..802
lib/ruby-lint/definitions/rails/action_view.rb on lines 1793..1810
lib/ruby-lint/definitions/rails/action_view.rb on lines 6804..6821
lib/ruby-lint/definitions/rails/active_record.rb on lines 11725..11742

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('OpenSSL::HMAC') 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 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1871..1896
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2583..2608
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3542..3567
lib/ruby-lint/definitions/rails/rails.rb on lines 1038..1063

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('create!') do |method|
      method.define_optional_argument('attributes')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 785..802
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2647..2664
lib/ruby-lint/definitions/rails/action_view.rb on lines 1793..1810
lib/ruby-lint/definitions/rails/action_view.rb on lines 6804..6821

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('OpenSSL::PKey::EC::Point') 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 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1833..1858
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1871..1896
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3542..3567
lib/ruby-lint/definitions/rails/rails.rb on lines 1038..1063

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

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('ActiveRecord::SchemaMigration::HasAndBelongsToManyAssociation') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Associations::CollectionAssociation', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('owner')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 571..587
lib/ruby-lint/definitions/rails/active_record.rb on lines 2454..2470

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('sign_in') do |method|
      method.define_argument('resource_or_scope')
Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 4 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2647..2664
lib/ruby-lint/definitions/rails/action_view.rb on lines 1793..1810
lib/ruby-lint/definitions/rails/action_view.rb on lines 6804..6821
lib/ruby-lint/definitions/rails/active_record.rb on lines 11725..11742

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

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