YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('Socket::SockAddr_In') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('sockaddrin')
Severity: Major
Found in lib/ruby-lint/definitions/core/socket.rb and 16 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 291..300
lib/ruby-lint/definitions/core/name_error.rb on lines 7..16
lib/ruby-lint/definitions/core/socket.rb on lines 2967..2976
lib/ruby-lint/definitions/core/socket.rb on lines 3069..3078
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1534..1543
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2790..2799
lib/ruby-lint/definitions/gems/devise.rb on lines 1733..1742
lib/ruby-lint/definitions/gems/test.rb on lines 593..602
lib/ruby-lint/definitions/gems/test.rb on lines 677..686
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1872..1881
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3422..3431
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1528..1537
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1625..1634
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1643..1652
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1878..1887
lib/ruby-lint/definitions/rails/active_record.rb on lines 11653..11662

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('after_teardown')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 15 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 341..354
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2338..2351
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2354..2367
lib/ruby-lint/definitions/core/syck.rb on lines 415..428
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1255..1268
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2511..2524
lib/ruby-lint/definitions/gems/glib.rb on lines 1389..1402
lib/ruby-lint/definitions/gems/glib.rb on lines 3262..3275
lib/ruby-lint/definitions/gems/gtk.rb on lines 14063..14076
lib/ruby-lint/definitions/gems/minitest.rb on lines 689..702
lib/ruby-lint/definitions/gems/minitest.rb on lines 756..769
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4630..4643
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2758..2771
lib/ruby-lint/definitions/rails/active_model.rb on lines 567..580
lib/ruby-lint/definitions/rails/rails.rb on lines 2112..2125

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('model')
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 16 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 291..300
lib/ruby-lint/definitions/core/name_error.rb on lines 7..16
lib/ruby-lint/definitions/core/socket.rb on lines 2967..2976
lib/ruby-lint/definitions/core/socket.rb on lines 3018..3027
lib/ruby-lint/definitions/core/socket.rb on lines 3069..3078
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1534..1543
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2790..2799
lib/ruby-lint/definitions/gems/devise.rb on lines 1733..1742
lib/ruby-lint/definitions/gems/test.rb on lines 593..602
lib/ruby-lint/definitions/gems/test.rb on lines 677..686
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1872..1881
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3422..3431
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1528..1537
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1625..1634
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1643..1652
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1878..1887

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

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

  defs.define_constant('Test::Unit::Assertions::AssertionMessage::DelayedLiteral') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('value')
Severity: Major
Found in lib/ruby-lint/definitions/gems/test.rb and 16 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 291..300
lib/ruby-lint/definitions/core/name_error.rb on lines 7..16
lib/ruby-lint/definitions/core/socket.rb on lines 2967..2976
lib/ruby-lint/definitions/core/socket.rb on lines 3018..3027
lib/ruby-lint/definitions/core/socket.rb on lines 3069..3078
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1534..1543
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2790..2799
lib/ruby-lint/definitions/gems/devise.rb on lines 1733..1742
lib/ruby-lint/definitions/gems/test.rb on lines 677..686
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1872..1881
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3422..3431
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1528..1537
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1625..1634
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1643..1652
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1878..1887
lib/ruby-lint/definitions/rails/active_record.rb on lines 11653..11662

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('closure?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/glib.rb and 15 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 341..354
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2338..2351
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2354..2367
lib/ruby-lint/definitions/core/syck.rb on lines 415..428
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1255..1268
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2511..2524
lib/ruby-lint/definitions/gems/glib.rb on lines 1389..1402
lib/ruby-lint/definitions/gems/gtk.rb on lines 14063..14076
lib/ruby-lint/definitions/gems/minitest.rb on lines 689..702
lib/ruby-lint/definitions/gems/minitest.rb on lines 756..769
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4630..4643
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2758..2771
lib/ruby-lint/definitions/rails/active_model.rb on lines 567..580
lib/ruby-lint/definitions/rails/active_record.rb on lines 11491..11504
lib/ruby-lint/definitions/rails/rails.rb on lines 2112..2125

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

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

  defs.define_constant('ActionDispatch::Journey::NFA::MatchData') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('memos')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_dispatch.rb and 16 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 291..300
lib/ruby-lint/definitions/core/name_error.rb on lines 7..16
lib/ruby-lint/definitions/core/socket.rb on lines 2967..2976
lib/ruby-lint/definitions/core/socket.rb on lines 3018..3027
lib/ruby-lint/definitions/core/socket.rb on lines 3069..3078
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1534..1543
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2790..2799
lib/ruby-lint/definitions/gems/devise.rb on lines 1733..1742
lib/ruby-lint/definitions/gems/test.rb on lines 593..602
lib/ruby-lint/definitions/gems/test.rb on lines 677..686
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1872..1881
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3422..3431
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1528..1537
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1625..1634
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1878..1887
lib/ruby-lint/definitions/rails/active_record.rb on lines 11653..11662

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Rails::WelcomeController') do |klass|
    klass.inherits(defs.constant_proxy('ActionController::Base', RubyLint.registry))

    klass.define_method('_helpers')

Severity: Major
Found in lib/ruby-lint/definitions/rails/rails.rb and 15 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 341..354
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2338..2351
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2354..2367
lib/ruby-lint/definitions/core/syck.rb on lines 415..428
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1255..1268
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2511..2524
lib/ruby-lint/definitions/gems/glib.rb on lines 1389..1402
lib/ruby-lint/definitions/gems/glib.rb on lines 3262..3275
lib/ruby-lint/definitions/gems/gtk.rb on lines 14063..14076
lib/ruby-lint/definitions/gems/minitest.rb on lines 689..702
lib/ruby-lint/definitions/gems/minitest.rb on lines 756..769
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4630..4643
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2758..2771
lib/ruby-lint/definitions/rails/active_model.rb on lines 567..580
lib/ruby-lint/definitions/rails/active_record.rb on lines 11491..11504

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Minitest::Test::LifecycleHooks') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('after_setup')

Severity: Major
Found in lib/ruby-lint/definitions/gems/minitest.rb and 15 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 341..354
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2338..2351
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2354..2367
lib/ruby-lint/definitions/core/syck.rb on lines 415..428
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1255..1268
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2511..2524
lib/ruby-lint/definitions/gems/glib.rb on lines 1389..1402
lib/ruby-lint/definitions/gems/glib.rb on lines 3262..3275
lib/ruby-lint/definitions/gems/gtk.rb on lines 14063..14076
lib/ruby-lint/definitions/gems/minitest.rb on lines 756..769
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4630..4643
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2758..2771
lib/ruby-lint/definitions/rails/active_model.rb on lines 567..580
lib/ruby-lint/definitions/rails/active_record.rb on lines 11491..11504
lib/ruby-lint/definitions/rails/rails.rb on lines 2112..2125

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('bare_object')

Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.rb and 15 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 341..354
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2338..2351
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2354..2367
lib/ruby-lint/definitions/core/syck.rb on lines 415..428
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1255..1268
lib/ruby-lint/definitions/gems/glib.rb on lines 1389..1402
lib/ruby-lint/definitions/gems/glib.rb on lines 3262..3275
lib/ruby-lint/definitions/gems/gtk.rb on lines 14063..14076
lib/ruby-lint/definitions/gems/minitest.rb on lines 689..702
lib/ruby-lint/definitions/gems/minitest.rb on lines 756..769
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4630..4643
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2758..2771
lib/ruby-lint/definitions/rails/active_model.rb on lines 567..580
lib/ruby-lint/definitions/rails/active_record.rb on lines 11491..11504
lib/ruby-lint/definitions/rails/rails.rb on lines 2112..2125

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

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

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

    klass.define_instance_method('initialize') do |method|
      method.define_argument('params')
Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.rb and 16 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 291..300
lib/ruby-lint/definitions/core/name_error.rb on lines 7..16
lib/ruby-lint/definitions/core/socket.rb on lines 2967..2976
lib/ruby-lint/definitions/core/socket.rb on lines 3018..3027
lib/ruby-lint/definitions/core/socket.rb on lines 3069..3078
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1534..1543
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2790..2799
lib/ruby-lint/definitions/gems/devise.rb on lines 1733..1742
lib/ruby-lint/definitions/gems/test.rb on lines 593..602
lib/ruby-lint/definitions/gems/test.rb on lines 677..686
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1872..1881
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1528..1537
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1625..1634
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1643..1652
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1878..1887
lib/ruby-lint/definitions/rails/active_record.rb on lines 11653..11662

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

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

  defs.define_constant('NameError') do |klass|
    klass.inherits(defs.constant_proxy('StandardError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_rest_argument('args')
Severity: Major
Found in lib/ruby-lint/definitions/core/name_error.rb and 16 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 291..300
lib/ruby-lint/definitions/core/socket.rb on lines 2967..2976
lib/ruby-lint/definitions/core/socket.rb on lines 3018..3027
lib/ruby-lint/definitions/core/socket.rb on lines 3069..3078
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1534..1543
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2790..2799
lib/ruby-lint/definitions/gems/devise.rb on lines 1733..1742
lib/ruby-lint/definitions/gems/test.rb on lines 593..602
lib/ruby-lint/definitions/gems/test.rb on lines 677..686
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1872..1881
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3422..3431
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1528..1537
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1625..1634
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1643..1652
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1878..1887
lib/ruby-lint/definitions/rails/active_record.rb on lines 11653..11662

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

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

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

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

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

Refactorings

Further Reading

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

  defs.define_constant('Gtk::RecentFilter::Flags') do |klass|
    klass.inherits(defs.constant_proxy('GLib::Flags', RubyLint.registry))

    klass.define_instance_method('age?')

Severity: Major
Found in lib/ruby-lint/definitions/gems/gtk.rb and 15 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 341..354
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2338..2351
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2354..2367
lib/ruby-lint/definitions/core/syck.rb on lines 415..428
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1255..1268
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2511..2524
lib/ruby-lint/definitions/gems/glib.rb on lines 1389..1402
lib/ruby-lint/definitions/gems/glib.rb on lines 3262..3275
lib/ruby-lint/definitions/gems/minitest.rb on lines 689..702
lib/ruby-lint/definitions/gems/minitest.rb on lines 756..769
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4630..4643
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2758..2771
lib/ruby-lint/definitions/rails/active_model.rb on lines 567..580
lib/ruby-lint/definitions/rails/active_record.rb on lines 11491..11504
lib/ruby-lint/definitions/rails/rails.rb on lines 2112..2125

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

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

  defs.define_constant('DRb::DRbRemoteError') do |klass|
    klass.inherits(defs.constant_proxy('DRb::DRbError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('error')
Severity: Major
Found in lib/ruby-lint/definitions/core/drb.rb and 16 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/name_error.rb on lines 7..16
lib/ruby-lint/definitions/core/socket.rb on lines 2967..2976
lib/ruby-lint/definitions/core/socket.rb on lines 3018..3027
lib/ruby-lint/definitions/core/socket.rb on lines 3069..3078
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1534..1543
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2790..2799
lib/ruby-lint/definitions/gems/devise.rb on lines 1733..1742
lib/ruby-lint/definitions/gems/test.rb on lines 593..602
lib/ruby-lint/definitions/gems/test.rb on lines 677..686
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1872..1881
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3422..3431
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1528..1537
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1625..1634
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1643..1652
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1878..1887
lib/ruby-lint/definitions/rails/active_record.rb on lines 11653..11662

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

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

  defs.define_constant('Socket::SockAddr_Un') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_optional_argument('filename')
Severity: Major
Found in lib/ruby-lint/definitions/core/socket.rb and 16 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 291..300
lib/ruby-lint/definitions/core/name_error.rb on lines 7..16
lib/ruby-lint/definitions/core/socket.rb on lines 2967..2976
lib/ruby-lint/definitions/core/socket.rb on lines 3018..3027
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1534..1543
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2790..2799
lib/ruby-lint/definitions/gems/devise.rb on lines 1733..1742
lib/ruby-lint/definitions/gems/test.rb on lines 593..602
lib/ruby-lint/definitions/gems/test.rb on lines 677..686
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1872..1881
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3422..3431
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1528..1537
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1625..1634
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1643..1652
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1878..1887
lib/ruby-lint/definitions/rails/active_record.rb on lines 11653..11662

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

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

  defs.define_constant('Socket::Servent') do |klass|
    klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('data')
Severity: Major
Found in lib/ruby-lint/definitions/core/socket.rb and 16 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/drb.rb on lines 291..300
lib/ruby-lint/definitions/core/name_error.rb on lines 7..16
lib/ruby-lint/definitions/core/socket.rb on lines 3018..3027
lib/ruby-lint/definitions/core/socket.rb on lines 3069..3078
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1534..1543
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2790..2799
lib/ruby-lint/definitions/gems/devise.rb on lines 1733..1742
lib/ruby-lint/definitions/gems/test.rb on lines 593..602
lib/ruby-lint/definitions/gems/test.rb on lines 677..686
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1872..1881
lib/ruby-lint/definitions/rails/action_controller.rb on lines 3422..3431
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1528..1537
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1625..1634
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1643..1652
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1878..1887
lib/ruby-lint/definitions/rails/active_record.rb on lines 11653..11662

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('emitter')

Severity: Major
Found in lib/ruby-lint/definitions/core/syck.rb and 15 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/open_ssl.rb on lines 341..354
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2338..2351
lib/ruby-lint/definitions/core/open_ssl.rb on lines 2354..2367
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1255..1268
lib/ruby-lint/definitions/gems/celluloid.rb on lines 2511..2524
lib/ruby-lint/definitions/gems/glib.rb on lines 1389..1402
lib/ruby-lint/definitions/gems/glib.rb on lines 3262..3275
lib/ruby-lint/definitions/gems/gtk.rb on lines 14063..14076
lib/ruby-lint/definitions/gems/minitest.rb on lines 689..702
lib/ruby-lint/definitions/gems/minitest.rb on lines 756..769
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4630..4643
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2758..2771
lib/ruby-lint/definitions/rails/active_model.rb on lines 567..580
lib/ruby-lint/definitions/rails/active_record.rb on lines 11491..11504
lib/ruby-lint/definitions/rails/rails.rb on lines 2112..2125

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('check_validity!')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/rails/active_model.rb on lines 1353..1361
lib/ruby-lint/definitions/rails/active_record.rb on lines 590..598
lib/ruby-lint/definitions/rails/active_record.rb on lines 2442..2450
lib/ruby-lint/definitions/rails/active_record.rb on lines 2473..2481
lib/ruby-lint/definitions/rails/active_record.rb on lines 10123..10131

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('check_validity!')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/rails/active_model.rb on lines 1353..1361
lib/ruby-lint/definitions/rails/active_record.rb on lines 590..598
lib/ruby-lint/definitions/rails/active_record.rb on lines 2473..2481
lib/ruby-lint/definitions/rails/active_record.rb on lines 10087..10095
lib/ruby-lint/definitions/rails/active_record.rb on lines 10123..10131

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

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

    klass.define_method('def_extend_command') do |method|
      method.define_argument('cmd_name')
Severity: Major
Found in lib/ruby-lint/definitions/core/irb.rb and 4 other locations - About 25 mins to fix
lib/ruby-lint/definitions/gems/minitest.rb on lines 439..448
lib/ruby-lint/definitions/rails/action_controller.rb on lines 831..840
lib/ruby-lint/definitions/rails/sprockets.rb on lines 377..386
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1612..1621

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

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

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

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

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

Refactorings

Further Reading

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

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

    klass.define_instance_method('handle_dependency')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_record.rb and 5 other locations - About 25 mins to fix
lib/ruby-lint/definitions/rails/active_model.rb on lines 1353..1361
lib/ruby-lint/definitions/rails/active_record.rb on lines 590..598
lib/ruby-lint/definitions/rails/active_record.rb on lines 2442..2450
lib/ruby-lint/definitions/rails/active_record.rb on lines 10087..10095
lib/ruby-lint/definitions/rails/active_record.rb on lines 10123..10131

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

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