YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('RSpec::Core::Ordering::Custom') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('callable')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 14 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/hash.rb on lines 466..476
lib/ruby-lint/definitions/core/option_parser.rb on lines 533..543
lib/ruby-lint/definitions/core/option_parser.rb on lines 1003..1013
lib/ruby-lint/definitions/core/syck.rb on lines 871..881
lib/ruby-lint/definitions/core/syck.rb on lines 1173..1183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 535..545
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7324..7334
lib/ruby-lint/definitions/gems/rspec.rb on lines 3063..3073
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2152..2162
lib/ruby-lint/definitions/rails/active_support.rb on lines 2115..2125
lib/ruby-lint/definitions/rails/active_support.rb on lines 2549..2559
lib/ruby-lint/definitions/rails/active_support.rb on lines 3776..3786
lib/ruby-lint/definitions/rails/active_support.rb on lines 4080..4090
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1540..1550

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Sprockets::Railtie::OrderedOptions::Iterator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('state')
Severity: Major
Found in lib/ruby-lint/definitions/rails/sprockets.rb and 14 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/hash.rb on lines 466..476
lib/ruby-lint/definitions/core/option_parser.rb on lines 533..543
lib/ruby-lint/definitions/core/option_parser.rb on lines 1003..1013
lib/ruby-lint/definitions/core/syck.rb on lines 871..881
lib/ruby-lint/definitions/core/syck.rb on lines 1173..1183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 535..545
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7324..7334
lib/ruby-lint/definitions/gems/rspec.rb on lines 3063..3073
lib/ruby-lint/definitions/gems/rspec.rb on lines 7713..7723
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2152..2162
lib/ruby-lint/definitions/rails/active_support.rb on lines 2115..2125
lib/ruby-lint/definitions/rails/active_support.rb on lines 2549..2559
lib/ruby-lint/definitions/rails/active_support.rb on lines 3776..3786
lib/ruby-lint/definitions/rails/active_support.rb on lines 4080..4090

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('parent')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 14 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/hash.rb on lines 466..476
lib/ruby-lint/definitions/core/option_parser.rb on lines 533..543
lib/ruby-lint/definitions/core/option_parser.rb on lines 1003..1013
lib/ruby-lint/definitions/core/syck.rb on lines 871..881
lib/ruby-lint/definitions/core/syck.rb on lines 1173..1183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 535..545
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7324..7334
lib/ruby-lint/definitions/gems/rspec.rb on lines 7713..7723
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2152..2162
lib/ruby-lint/definitions/rails/active_support.rb on lines 2115..2125
lib/ruby-lint/definitions/rails/active_support.rb on lines 2549..2559
lib/ruby-lint/definitions/rails/active_support.rb on lines 3776..3786
lib/ruby-lint/definitions/rails/active_support.rb on lines 4080..4090
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1540..1550

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('state')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 14 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/hash.rb on lines 466..476
lib/ruby-lint/definitions/core/option_parser.rb on lines 533..543
lib/ruby-lint/definitions/core/option_parser.rb on lines 1003..1013
lib/ruby-lint/definitions/core/syck.rb on lines 871..881
lib/ruby-lint/definitions/core/syck.rb on lines 1173..1183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 535..545
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7324..7334
lib/ruby-lint/definitions/gems/rspec.rb on lines 3063..3073
lib/ruby-lint/definitions/gems/rspec.rb on lines 7713..7723
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2152..2162
lib/ruby-lint/definitions/rails/active_support.rb on lines 2115..2125
lib/ruby-lint/definitions/rails/active_support.rb on lines 2549..2559
lib/ruby-lint/definitions/rails/active_support.rb on lines 4080..4090
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1540..1550

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Mongoid::Relations::Metadata::Iterator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('state')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 14 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/hash.rb on lines 466..476
lib/ruby-lint/definitions/core/option_parser.rb on lines 533..543
lib/ruby-lint/definitions/core/option_parser.rb on lines 1003..1013
lib/ruby-lint/definitions/core/syck.rb on lines 871..881
lib/ruby-lint/definitions/core/syck.rb on lines 1173..1183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 535..545
lib/ruby-lint/definitions/gems/rspec.rb on lines 3063..3073
lib/ruby-lint/definitions/gems/rspec.rb on lines 7713..7723
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2152..2162
lib/ruby-lint/definitions/rails/active_support.rb on lines 2115..2125
lib/ruby-lint/definitions/rails/active_support.rb on lines 2549..2559
lib/ruby-lint/definitions/rails/active_support.rb on lines 3776..3786
lib/ruby-lint/definitions/rails/active_support.rb on lines 4080..4090
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1540..1550

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('RSpec::Core::Source::SyntaxHighlighter') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Syck::Set::Iterator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('state')
Severity: Major
Found in lib/ruby-lint/definitions/core/syck.rb and 14 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/hash.rb on lines 466..476
lib/ruby-lint/definitions/core/option_parser.rb on lines 533..543
lib/ruby-lint/definitions/core/option_parser.rb on lines 1003..1013
lib/ruby-lint/definitions/core/syck.rb on lines 1173..1183
lib/ruby-lint/definitions/gems/mongoid.rb on lines 535..545
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7324..7334
lib/ruby-lint/definitions/gems/rspec.rb on lines 3063..3073
lib/ruby-lint/definitions/gems/rspec.rb on lines 7713..7723
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2152..2162
lib/ruby-lint/definitions/rails/active_support.rb on lines 2115..2125
lib/ruby-lint/definitions/rails/active_support.rb on lines 2549..2559
lib/ruby-lint/definitions/rails/active_support.rb on lines 3776..3786
lib/ruby-lint/definitions/rails/active_support.rb on lines 4080..4090
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1540..1550

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Test::Unit::TestCaseNotificationSupport') 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/test.rb and 5 other locations - About 35 mins to fix
lib/ruby-lint/definitions/gems/test.rb on lines 1490..1500
lib/ruby-lint/definitions/gems/tree.rb on lines 160..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 1323..1333
lib/ruby-lint/definitions/rails/active_record.rb on lines 2396..2406
lib/ruby-lint/definitions/rails/active_record.rb on lines 10041..10051

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('OptionParser::Switch::OptionalArgument::NoArgument') do |klass|
    klass.inherits(defs.constant_proxy('OptionParser::Switch', RubyLint.registry))

    klass.define_method('incompatible_argument_styles') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/core/option_parser.rb and 6 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1213..1224
lib/ruby-lint/definitions/rails/active_record.rb on lines 630..641
lib/ruby-lint/definitions/rails/active_record.rb on lines 2513..2524
lib/ruby-lint/definitions/rails/active_record.rb on lines 10163..10174
lib/ruby-lint/definitions/rails/active_support.rb on lines 615..626
lib/ruby-lint/definitions/rails/rails.rb on lines 1400..1411

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActiveRecord::Base::ConfirmationValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('setup') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 5 other locations - About 35 mins to fix
lib/ruby-lint/definitions/gems/test.rb on lines 1490..1500
lib/ruby-lint/definitions/gems/test.rb on lines 2393..2403
lib/ruby-lint/definitions/gems/tree.rb on lines 160..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 1323..1333
lib/ruby-lint/definitions/rails/active_record.rb on lines 10041..10051

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActiveRecord::SchemaMigration::HasOneAssociation') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Associations::SingularAssociation', RubyLint.registry))

    klass.define_instance_method('delete') do |method|
      method.define_optional_argument('method')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 6 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1213..1224
lib/ruby-lint/definitions/core/option_parser.rb on lines 1238..1249
lib/ruby-lint/definitions/rails/active_record.rb on lines 630..641
lib/ruby-lint/definitions/rails/active_record.rb on lines 2513..2524
lib/ruby-lint/definitions/rails/active_support.rb on lines 615..626
lib/ruby-lint/definitions/rails/rails.rb on lines 1400..1411

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('OptionParser::Switch::NoArgument') do |klass|
    klass.inherits(defs.constant_proxy('OptionParser::Switch', RubyLint.registry))

    klass.define_method('incompatible_argument_styles') do |method|
      method.define_rest_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/core/option_parser.rb and 6 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1238..1249
lib/ruby-lint/definitions/rails/active_record.rb on lines 630..641
lib/ruby-lint/definitions/rails/active_record.rb on lines 2513..2524
lib/ruby-lint/definitions/rails/active_record.rb on lines 10163..10174
lib/ruby-lint/definitions/rails/active_support.rb on lines 615..626
lib/ruby-lint/definitions/rails/rails.rb on lines 1400..1411

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActiveModel::Validations::ConfirmationValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('setup') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 5 other locations - About 35 mins to fix
lib/ruby-lint/definitions/gems/test.rb on lines 1490..1500
lib/ruby-lint/definitions/gems/test.rb on lines 2393..2403
lib/ruby-lint/definitions/gems/tree.rb on lines 160..170
lib/ruby-lint/definitions/rails/active_record.rb on lines 2396..2406
lib/ruby-lint/definitions/rails/active_record.rb on lines 10041..10051

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActiveRecord::Associations::HasOneAssociation') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Associations::SingularAssociation', RubyLint.registry))

    klass.define_instance_method('delete') do |method|
      method.define_optional_argument('method')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 6 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1213..1224
lib/ruby-lint/definitions/core/option_parser.rb on lines 1238..1249
lib/ruby-lint/definitions/rails/active_record.rb on lines 2513..2524
lib/ruby-lint/definitions/rails/active_record.rb on lines 10163..10174
lib/ruby-lint/definitions/rails/active_support.rb on lines 615..626
lib/ruby-lint/definitions/rails/rails.rb on lines 1400..1411

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActiveRecord::Base::HasOneAssociation') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::Associations::SingularAssociation', RubyLint.registry))

    klass.define_instance_method('delete') do |method|
      method.define_optional_argument('method')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 6 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1213..1224
lib/ruby-lint/definitions/core/option_parser.rb on lines 1238..1249
lib/ruby-lint/definitions/rails/active_record.rb on lines 630..641
lib/ruby-lint/definitions/rails/active_record.rb on lines 10163..10174
lib/ruby-lint/definitions/rails/active_support.rb on lines 615..626
lib/ruby-lint/definitions/rails/rails.rb on lines 1400..1411

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('LibXML::XML::InputCallbacks') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('add_scheme') do |method|
      method.define_argument('arg1')
Severity: Major
Found in lib/ruby-lint/definitions/gems/lib_xml.rb and 3 other locations - About 35 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2990..3001
lib/ruby-lint/definitions/gems/celluloid.rb on lines 3759..3770
lib/ruby-lint/definitions/gems/test.rb on lines 1418..1429

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('cache_for') do |method|
      method.define_argument('local_cache_key')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 6 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1213..1224
lib/ruby-lint/definitions/core/option_parser.rb on lines 1238..1249
lib/ruby-lint/definitions/rails/active_record.rb on lines 630..641
lib/ruby-lint/definitions/rails/active_record.rb on lines 2513..2524
lib/ruby-lint/definitions/rails/active_record.rb on lines 10163..10174
lib/ruby-lint/definitions/rails/rails.rb on lines 1400..1411

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('ActiveRecord::SchemaMigration::ConfirmationValidator') do |klass|
    klass.inherits(defs.constant_proxy('ActiveModel::EachValidator', RubyLint.registry))

    klass.define_instance_method('setup') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 5 other locations - About 35 mins to fix
lib/ruby-lint/definitions/gems/test.rb on lines 1490..1500
lib/ruby-lint/definitions/gems/test.rb on lines 2393..2403
lib/ruby-lint/definitions/gems/tree.rb on lines 160..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 1323..1333
lib/ruby-lint/definitions/rails/active_record.rb on lines 2396..2406

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Rails::Initializable') 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/rails/rails.rb and 6 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/option_parser.rb on lines 1213..1224
lib/ruby-lint/definitions/core/option_parser.rb on lines 1238..1249
lib/ruby-lint/definitions/rails/active_record.rb on lines 630..641
lib/ruby-lint/definitions/rails/active_record.rb on lines 2513..2524
lib/ruby-lint/definitions/rails/active_record.rb on lines 10163..10174
lib/ruby-lint/definitions/rails/active_support.rb on lines 615..626

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('_layout_for') do |method|
      method.define_optional_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 4 other locations - About 35 mins to fix
lib/ruby-lint/definitions/rails/active_record.rb on lines 2085..2100
lib/ruby-lint/definitions/rails/active_record.rb on lines 5367..5382
lib/ruby-lint/definitions/rails/active_record.rb on lines 9730..9745
lib/ruby-lint/definitions/rails/arel.rb on lines 5751..5766

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 36.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language