YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('setup') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 11 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5483..5493
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6080..6090
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2221..2231
lib/ruby-lint/definitions/rails/action_controller.rb on lines 929..939
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3276..3286
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 49..59
lib/ruby-lint/definitions/rails/action_view.rb on lines 6755..6765
lib/ruby-lint/definitions/rails/active_model.rb on lines 1249..1259
lib/ruby-lint/definitions/rails/active_record.rb on lines 3125..3135
lib/ruby-lint/definitions/rails/active_record.rb on lines 7374..7384
lib/ruby-lint/definitions/rails/active_record.rb on lines 10775..10785

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

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

    klass.define_instance_method('assert_redirected_to') do |method|
      method.define_optional_argument('options')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 11 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 5483..5493
lib/ruby-lint/definitions/gems/mongoid.rb on lines 6080..6090
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2221..2231
lib/ruby-lint/definitions/rails/action_controller.rb on lines 929..939
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 49..59
lib/ruby-lint/definitions/rails/action_view.rb on lines 6755..6765
lib/ruby-lint/definitions/rails/active_model.rb on lines 1249..1259
lib/ruby-lint/definitions/rails/active_record.rb on lines 3125..3135
lib/ruby-lint/definitions/rails/active_record.rb on lines 7374..7384
lib/ruby-lint/definitions/rails/active_record.rb on lines 10775..10785
lib/ruby-lint/definitions/rails/active_support.rb on lines 5228..5238

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

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

    klass.define_instance_method('reload') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 7 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/glib.rb on lines 3011..3023
lib/ruby-lint/definitions/gems/tree.rb on lines 174..186
lib/ruby-lint/definitions/rails/active_model.rb on lines 856..868
lib/ruby-lint/definitions/rails/active_record.rb on lines 875..887
lib/ruby-lint/definitions/rails/active_record.rb on lines 2415..2427
lib/ruby-lint/definitions/rails/active_record.rb on lines 2614..2626
lib/ruby-lint/definitions/rails/active_record.rb on lines 10264..10276

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

    klass.define_instance_method('future')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 5 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 828..840
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1341..1353
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2185..2197
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2597..2609
lib/ruby-lint/definitions/rails/active_record.rb on lines 10845..10857

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

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

    klass.define_instance_method('reload') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 7 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/glib.rb on lines 3011..3023
lib/ruby-lint/definitions/gems/tree.rb on lines 174..186
lib/ruby-lint/definitions/rails/active_model.rb on lines 856..868
lib/ruby-lint/definitions/rails/active_record.rb on lines 2415..2427
lib/ruby-lint/definitions/rails/active_record.rb on lines 2614..2626
lib/ruby-lint/definitions/rails/active_record.rb on lines 10060..10072
lib/ruby-lint/definitions/rails/active_record.rb on lines 10264..10276

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

  defs.define_constant('Sprockets::SassCompressor') 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 1677..1690
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('Celluloid::ExitEvent') do |klass|
    klass.inherits(defs.constant_proxy('Celluloid::SystemEvent', RubyLint.registry))

    klass.define_instance_method('actor')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 5 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 982..994
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1341..1353
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2185..2197
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2597..2609
lib/ruby-lint/definitions/rails/active_record.rb on lines 10845..10857

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

    klass.define_instance_method('authentication_hash')

Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 5 other locations - About 40 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1909..1926
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/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 6 locations. Consider refactoring.
Open

  defs.define_constant('Zlib') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('adler32')

Severity: Major
Found in lib/ruby-lint/definitions/core/zlib.rb and 5 other locations - About 40 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1909..1926
lib/ruby-lint/definitions/core/syck.rb on lines 202..219
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 4 locations. Consider refactoring.
Open

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('instance')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.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 3454..3463
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3643..3652

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::InverseNotFound') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Errors::MongoidError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('base')
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 3454..3463
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 8 locations. Consider refactoring.
Open

  defs.define_constant('Tree::Utils::JSONConverter') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('included') do |method|
      method.define_argument('base')
Severity: Major
Found in lib/ruby-lint/definitions/gems/tree.rb and 7 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/glib.rb on lines 3011..3023
lib/ruby-lint/definitions/rails/active_model.rb on lines 856..868
lib/ruby-lint/definitions/rails/active_record.rb on lines 875..887
lib/ruby-lint/definitions/rails/active_record.rb on lines 2415..2427
lib/ruby-lint/definitions/rails/active_record.rb on lines 2614..2626
lib/ruby-lint/definitions/rails/active_record.rb on lines 10060..10072
lib/ruby-lint/definitions/rails/active_record.rb on lines 10264..10276

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

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

    klass.define_method('default_namespace')

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 1624..1637
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1677..1690
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 7 locations. Consider refactoring.
Open

  defs.define_constant('Sprockets::YUICompressor') 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 1677..1690

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

    klass.define_instance_method('actor')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 5 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 828..840
lib/ruby-lint/definitions/gems/celluloid.rb on lines 982..994
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1341..1353
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2597..2609
lib/ruby-lint/definitions/rails/active_record.rb on lines 10845..10857

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

  defs.define_constant('Sprockets::EjsTemplate') 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 732..745
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1624..1637
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1677..1690
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('Celluloid::LinkingResponse') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('actor')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 5 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 828..840
lib/ruby-lint/definitions/gems/celluloid.rb on lines 982..994
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2185..2197
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2597..2609
lib/ruby-lint/definitions/rails/active_record.rb on lines 10845..10857

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

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

    klass.define_method('parse') do |method|
      method.define_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/glib.rb and 7 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/tree.rb on lines 174..186
lib/ruby-lint/definitions/rails/active_model.rb on lines 856..868
lib/ruby-lint/definitions/rails/active_record.rb on lines 875..887
lib/ruby-lint/definitions/rails/active_record.rb on lines 2415..2427
lib/ruby-lint/definitions/rails/active_record.rb on lines 2614..2626
lib/ruby-lint/definitions/rails/active_record.rb on lines 10060..10072
lib/ruby-lint/definitions/rails/active_record.rb on lines 10264..10276

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

  defs.define_constant('Sprockets::EcoTemplate') 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 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 1677..1690
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 8 locations. Consider refactoring.
Open

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

    klass.define_instance_method('authenticate') do |method|
      method.define_argument('unencrypted_password')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 7 other locations - About 40 mins to fix
lib/ruby-lint/definitions/gems/glib.rb on lines 3011..3023
lib/ruby-lint/definitions/gems/tree.rb on lines 174..186
lib/ruby-lint/definitions/rails/active_model.rb on lines 856..868
lib/ruby-lint/definitions/rails/active_record.rb on lines 875..887
lib/ruby-lint/definitions/rails/active_record.rb on lines 2415..2427
lib/ruby-lint/definitions/rails/active_record.rb on lines 10060..10072
lib/ruby-lint/definitions/rails/active_record.rb on lines 10264..10276

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

Severity
Category
Status
Source
Language