YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('ActionMailer::Base::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_mailer.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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('ActionController::TestCase::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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::Reloader::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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('ActionController::Base::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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::Callbacks::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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('Rails::InfoController::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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::SchemaMigration::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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('Rails::WelcomeController::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 2054..2075
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179

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

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::Base::CallbackChain') do |klass|
    klass.inherits(defs.constant_proxy('Array', RubyLint.registry))

    klass.define_instance_method('append') do |method|
      method.define_rest_argument('callbacks')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 15 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_controller.rb on lines 589..610
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3191..3212
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 281..302
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3138..3159
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 514..535
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1056..1077
lib/ruby-lint/definitions/rails/action_view.rb on lines 5506..5527
lib/ruby-lint/definitions/rails/action_view.rb on lines 7030..7051
lib/ruby-lint/definitions/rails/active_model.rb on lines 1059..1080
lib/ruby-lint/definitions/rails/active_record.rb on lines 3546..3567
lib/ruby-lint/definitions/rails/active_record.rb on lines 9699..9720
lib/ruby-lint/definitions/rails/active_record.rb on lines 11406..11427
lib/ruby-lint/definitions/rails/active_support.rb on lines 4968..4989
lib/ruby-lint/definitions/rails/rails.rb on lines 1158..1179
lib/ruby-lint/definitions/rails/rails.rb on lines 2220..2241

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

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('Celluloid::PoolManager::FutureProxy') do |klass|
    klass.inherits(defs.constant_proxy('Celluloid::AbstractProxy', RubyLint.registry))

    klass.define_instance_method('__class__')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 518..537
lib/ruby-lint/definitions/gems/celluloid.rb on lines 997..1016
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1934..1953

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

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::NumericalityValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('check_validity!')

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_model.rb on lines 1458..1478
lib/ruby-lint/definitions/rails/active_record.rb on lines 2804..2824

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

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('Celluloid::FutureProxy') do |klass|
    klass.inherits(defs.constant_proxy('Celluloid::AbstractProxy', RubyLint.registry))

    klass.define_instance_method('__class__')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 518..537
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1934..1953
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2290..2309

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

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('ActionDispatch::Journey::NFA::Simulator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('=~') do |method|
      method.define_argument('string')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 1 other location - About 1 hr to fix
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1540..1561

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

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('Celluloid::AsyncProxy') do |klass|
    klass.inherits(defs.constant_proxy('Celluloid::AbstractProxy', RubyLint.registry))

    klass.define_instance_method('__class__')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 997..1016
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1934..1953
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2290..2309

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

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('Celluloid::PoolManager::AsyncProxy') do |klass|
    klass.inherits(defs.constant_proxy('Celluloid::AbstractProxy', RubyLint.registry))

    klass.define_instance_method('__class__')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 3 other locations - About 1 hr to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 518..537
lib/ruby-lint/definitions/gems/celluloid.rb on lines 997..1016
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2290..2309

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

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('ActiveModel::Validations::NumericalityValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('check_validity!')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 2 other locations - About 1 hr to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 2804..2824
lib/ruby-lint/definitions/rails/active_record.rb on lines 10454..10474

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

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::NumericalityValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('check_validity!')

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_model.rb on lines 1458..1478
lib/ruby-lint/definitions/rails/active_record.rb on lines 10454..10474

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

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