YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('broadcast') do |method|
      method.define_optional_argument('value')
Severity: Minor
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 40 mins to fix
lib/ruby-lint/definitions/gems/celluloid.rb on lines 735..750

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

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('ActionDispatch::Assertions::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_dispatch.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_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 12 locations. Consider refactoring.
Open

  defs.define_constant('Mongoid::Persistable::Creatable::ClassMethods') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('create') do |method|
      method.define_optional_argument('attributes')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 11 other locations - About 40 mins to fix
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
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 12 locations. Consider refactoring.
Open

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

    klass.define_instance_method('create') do |method|
      method.define_optional_argument('attributes')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 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 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 12 locations. Consider refactoring.
Open

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

    klass.define_instance_method('raw_write_attribute') do |method|
      method.define_argument('attr_name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.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_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 12 locations. Consider refactoring.
Open

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

    klass.define_instance_method('after_validation') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.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_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 12 locations. Consider refactoring.
Open

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

    klass.define_instance_method('send_data') do |method|
      method.define_argument('data')
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 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
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 12 locations. Consider refactoring.
Open

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

    klass.define_instance_method('builder') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.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/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
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 12 locations. Consider refactoring.
Open

  defs.define_constant('ActionView::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_view.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/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 12 locations. Consider refactoring.
Open

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

    klass.define_instance_method('raw_write_attribute') do |method|
      method.define_argument('attr_name')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.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 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 12 locations. Consider refactoring.
Open

  defs.define_constant('Nokogiri::HTML::SAX::Parser') do |klass|
    klass.inherits(defs.constant_proxy('Nokogiri::XML::SAX::Parser', RubyLint.registry))

    klass.define_instance_method('parse_file') do |method|
      method.define_argument('filename')
Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.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/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
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::Base::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 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 6 locations. Consider refactoring.
Open

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

    klass.define_instance_method('default')

Severity: Major
Found in lib/ruby-lint/definitions/gems/lib_xml.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/devise.rb on lines 2104..2121
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('Syck::Emitter') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/syck.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/zlib.rb on lines 7..24
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 6 locations. Consider refactoring.
Open

  defs.define_constant('ActiveRecord::StaleObjectError') do |klass|
    klass.inherits(defs.constant_proxy('ActiveRecord::ActiveRecordError', RubyLint.registry))

    klass.define_instance_method('attempted_action')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.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 2185..2197
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2597..2609

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::ClosureCompressor') 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 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
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::PoolManager::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 1341..1353
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2185..2197
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('ActiveModel::SecurePassword::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_model.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_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 8 locations. Consider refactoring.
Open

  defs.define_constant('ActiveRecord::SchemaMigration::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 2614..2626
lib/ruby-lint/definitions/rails/active_record.rb on lines 10060..10072

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

    klass.define_method('caller_locations_supported?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.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/devise.rb on lines 2104..2121
lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6052..6069

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