YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('Mongoid::Errors::InvalidSetPolymorphicRelation') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Errors::MongoidError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 9 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/resolv.rb on lines 737..745
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3499..3507
lib/ruby-lint/definitions/gems/mongoid.rb on lines 3516..3524
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2262..2270
lib/ruby-lint/definitions/rails/active_record.rb on lines 5950..5958
lib/ruby-lint/definitions/rails/active_record.rb on lines 5962..5970
lib/ruby-lint/definitions/rails/active_record.rb on lines 6039..6047
lib/ruby-lint/definitions/rails/active_support.rb on lines 1455..1463
lib/ruby-lint/definitions/rails/arel.rb on lines 2095..2103

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('xml')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 7 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/open_uri.rb on lines 60..70
lib/ruby-lint/definitions/gems/test.rb on lines 689..699
lib/ruby-lint/definitions/rails/action_controller.rb on lines 23..33
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2826..2836
lib/ruby-lint/definitions/rails/action_view.rb on lines 7423..7433
lib/ruby-lint/definitions/rails/active_record.rb on lines 10868..10878
lib/ruby-lint/definitions/rails/active_support.rb on lines 1467..1477

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

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

    klass.define_instance_method('failures')

Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 5 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 3063..3072
lib/ruby-lint/definitions/core/gem.rb on lines 3076..3085
lib/ruby-lint/definitions/gems/celluloid.rb on lines 624..633
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2003..2012
lib/ruby-lint/definitions/rails/arel.rb on lines 3790..3799

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

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('Mongoid::Relations::Eager::HasMany') do |klass|
    klass.inherits(defs.constant_proxy('Mongoid::Relations::Eager::Base', RubyLint.registry))

    klass.define_instance_method('group_by_key')

Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 4 other locations - About 35 mins to fix
lib/ruby-lint/definitions/core/condition_variable.rb on lines 7..18
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1869..1880
lib/ruby-lint/definitions/gems/mongoid.rb on lines 2121..2132
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7440..7451

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

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

    klass.define_instance_method('defaults')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 35 mins to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7654..7666

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

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

    klass.define_instance_method('exit_code')

Severity: Minor
Found in lib/ruby-lint/definitions/core/gem.rb and 1 other location - About 35 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 854..864

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

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

  module Presenter
    ##
    # {RubyLint::Presenter::Text} formats a instance of {RubyLint::Report} into
    # a text based, human readable format.
    #
Severity: Minor
Found in lib/ruby-lint/presenter/text.rb and 1 other location - About 35 mins to fix
lib/ruby-lint/presenter/emacs.rb on lines 2..35

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('number')
Severity: Minor
Found in lib/ruby-lint/definitions/rails/action_view.rb and 2 other locations - About 35 mins to fix
lib/ruby-lint/definitions/rails/action_view.rb on lines 3268..3279
lib/ruby-lint/definitions/rails/action_view.rb on lines 6557..6568

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

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

    klass.define_instance_method('conflict')

Severity: Minor
Found in lib/ruby-lint/definitions/core/gem.rb and 1 other location - About 35 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 3049..3059

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

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

  module Presenter
    ##
    # {RubyLint::Presenter::Emacs} formats a instance of {RubyLint::Report} into
    # a format parsable by Emacs compile mode
    #
Severity: Minor
Found in lib/ruby-lint/presenter/emacs.rb and 1 other location - About 35 mins to fix
lib/ruby-lint/presenter/text.rb on lines 2..36

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

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

    klass.define_method('parse_stylesheet_doc')

Severity: Minor
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 1 other location - About 35 mins to fix
lib/ruby-lint/definitions/gems/mongoid.rb on lines 1043..1055

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

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::AssociationRelation::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 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::TestCase::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 1742..1751
lib/ruby-lint/definitions/rails/action_view.rb on lines 3297..3306
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('Nokogiri::CSS') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('parse') do |method|
      method.define_argument('selector')
Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 13 other locations - About 30 mins to fix
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 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::Xml') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('from_xml') do |method|
      method.define_argument('xml')
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 890..899
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('ActiveSupport::Testing::Declarative') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('extended') do |method|
      method.define_argument('klass')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.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 8662..8671
lib/ruby-lint/definitions/rails/active_record.rb on lines 10805..10814
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('Sprockets::Utils') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('normalize_extension') do |method|
      method.define_argument('extension')
Severity: Major
Found in lib/ruby-lint/definitions/rails/sprockets.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 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

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

    klass.define_instance_method('serializable_hash') do |method|
      method.define_optional_argument('options')
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 8662..8671
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('Test::Unit::TestCasePendingSupport') 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 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/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

Severity
Category
Status
Source
Language