YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('RSpec::Core::Formatters::DeprecationFormatter::RaiseErrorStream') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('puts') do |method|
      method.define_argument('message')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 13 other locations - About 30 mins to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 54..63
lib/ruby-lint/definitions/gems/test.rb on lines 2432..2441
lib/ruby-lint/definitions/rails/action_view.rb on lines 1742..1751
lib/ruby-lint/definitions/rails/action_view.rb on lines 3297..3306
lib/ruby-lint/definitions/rails/action_view.rb on lines 6677..6686
lib/ruby-lint/definitions/rails/active_model.rb on lines 890..899
lib/ruby-lint/definitions/rails/active_model.rb on lines 903..912
lib/ruby-lint/definitions/rails/active_record.rb on lines 59..68
lib/ruby-lint/definitions/rails/active_record.rb on lines 5509..5518
lib/ruby-lint/definitions/rails/active_record.rb on lines 8662..8671
lib/ruby-lint/definitions/rails/active_record.rb on lines 10805..10814
lib/ruby-lint/definitions/rails/active_support.rb on lines 5103..5112
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1693..1702

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

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

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

    klass.define_instance_method('raw') do |method|
      method.define_argument('stringish')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_view.rb and 13 other locations - About 30 mins to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 54..63
lib/ruby-lint/definitions/gems/rspec.rb on lines 2770..2779
lib/ruby-lint/definitions/gems/test.rb on lines 2432..2441
lib/ruby-lint/definitions/rails/action_view.rb on lines 3297..3306
lib/ruby-lint/definitions/rails/action_view.rb on lines 6677..6686
lib/ruby-lint/definitions/rails/active_model.rb on lines 890..899
lib/ruby-lint/definitions/rails/active_model.rb on lines 903..912
lib/ruby-lint/definitions/rails/active_record.rb on lines 59..68
lib/ruby-lint/definitions/rails/active_record.rb on lines 5509..5518
lib/ruby-lint/definitions/rails/active_record.rb on lines 8662..8671
lib/ruby-lint/definitions/rails/active_record.rb on lines 10805..10814
lib/ruby-lint/definitions/rails/active_support.rb on lines 5103..5112
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1693..1702

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

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

  defs.define_constant('ActiveModel::Serializers::JSON') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_json') do |method|
      method.define_optional_argument('options')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 13 other locations - About 30 mins to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 54..63
lib/ruby-lint/definitions/gems/rspec.rb on lines 2770..2779
lib/ruby-lint/definitions/gems/test.rb on lines 2432..2441
lib/ruby-lint/definitions/rails/action_view.rb on lines 1742..1751
lib/ruby-lint/definitions/rails/action_view.rb on lines 3297..3306
lib/ruby-lint/definitions/rails/action_view.rb on lines 6677..6686
lib/ruby-lint/definitions/rails/active_model.rb on lines 903..912
lib/ruby-lint/definitions/rails/active_record.rb on lines 59..68
lib/ruby-lint/definitions/rails/active_record.rb on lines 5509..5518
lib/ruby-lint/definitions/rails/active_record.rb on lines 8662..8671
lib/ruby-lint/definitions/rails/active_record.rb on lines 10805..10814
lib/ruby-lint/definitions/rails/active_support.rb on lines 5103..5112
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1693..1702

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

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

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

    klass.define_instance_method('const_missing') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 13 other locations - About 30 mins to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 54..63
lib/ruby-lint/definitions/gems/rspec.rb on lines 2770..2779
lib/ruby-lint/definitions/gems/test.rb on lines 2432..2441
lib/ruby-lint/definitions/rails/action_view.rb on lines 1742..1751
lib/ruby-lint/definitions/rails/action_view.rb on lines 3297..3306
lib/ruby-lint/definitions/rails/action_view.rb on lines 6677..6686
lib/ruby-lint/definitions/rails/active_model.rb on lines 890..899
lib/ruby-lint/definitions/rails/active_model.rb on lines 903..912
lib/ruby-lint/definitions/rails/active_record.rb on lines 59..68
lib/ruby-lint/definitions/rails/active_record.rb on lines 8662..8671
lib/ruby-lint/definitions/rails/active_record.rb on lines 10805..10814
lib/ruby-lint/definitions/rails/active_support.rb on lines 5103..5112
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1693..1702

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

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

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

    klass.define_instance_method('const_missing') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 13 other locations - About 30 mins to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 54..63
lib/ruby-lint/definitions/gems/rspec.rb on lines 2770..2779
lib/ruby-lint/definitions/gems/test.rb on lines 2432..2441
lib/ruby-lint/definitions/rails/action_view.rb on lines 1742..1751
lib/ruby-lint/definitions/rails/action_view.rb on lines 3297..3306
lib/ruby-lint/definitions/rails/action_view.rb on lines 6677..6686
lib/ruby-lint/definitions/rails/active_model.rb on lines 890..899
lib/ruby-lint/definitions/rails/active_model.rb on lines 903..912
lib/ruby-lint/definitions/rails/active_record.rb on lines 59..68
lib/ruby-lint/definitions/rails/active_record.rb on lines 5509..5518
lib/ruby-lint/definitions/rails/active_record.rb on lines 10805..10814
lib/ruby-lint/definitions/rails/active_support.rb on lines 5103..5112
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1693..1702

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

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

    klass.define_instance_method('read_attribute_for_serialization') do |method|
      method.define_argument('message')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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

    klass.define_method('expand_cache_key') do |method|
      method.define_argument('key')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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('RSpec::Core::AnonymousExampleGroup::ContextHookMemoized') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('fetch_or_store') do |method|
      method.define_argument('key')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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

    klass.define_method('build_multipart') do |method|
      method.define_argument('params')
Severity: Major
Found in lib/ruby-lint/definitions/gems/sinatra.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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

    klass.define_instance_method('open') do |method|
      method.define_rest_argument('rest')
Severity: Major
Found in lib/ruby-lint/definitions/core/open_uri.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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

    klass.define_instance_method('data') do |method|
      method.define_rest_argument('arguments')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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('RSpec::Core::ExampleGroup::ContextHookMemoized') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('fetch_or_store') do |method|
      method.define_argument('key')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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('RSpec::Core::MemoizedHelpers::ContextHookMemoized') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('fetch_or_store') do |method|
      method.define_argument('key')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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('ActiveSupport::Testing::Deprecation') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('assert_deprecated') do |method|
      method.define_optional_argument('match')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152

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

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('Devise::Controllers::StoreLocation') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('store_location_for') do |method|
      method.define_argument('resource_or_scope')
Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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('Sinatra::Application::Multipart') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('build_multipart') do |method|
      method.define_argument('params')
Severity: Major
Found in lib/ruby-lint/definitions/gems/sinatra.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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('Test::Unit::Data::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('data') do |method|
      method.define_rest_argument('arguments')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 11 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

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

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

    klass.define_method('from_response') do |method|
      method.define_argument('response')
Severity: Minor
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 1 other location - About 30 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 7..20

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

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

    klass.define_method('Digest') do |method|
      method.define_argument('name')
Severity: Minor
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 1 other location - About 30 mins to fix
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 4406..4419

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

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('RSpec::Core::Configuration::DeprecationReporterBuffer') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('deprecation') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 6 other locations - About 30 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1745..1755
lib/ruby-lint/definitions/gems/gtk.rb on lines 15416..15426
lib/ruby-lint/definitions/gems/gtk.rb on lines 20261..20271
lib/ruby-lint/definitions/gems/mongoid.rb on lines 4622..4632
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 960..970
lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1081..1091

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

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