YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

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

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

  defs.define_constant('Arel::Nodes::SqlLiteral::Complexifier') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('convert')

Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/rspec.rb on lines 7840..7848
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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

  defs.define_constant('RSpec::Core::Pending::SkipDeclaredInExample') do |klass|
    klass.inherits(defs.constant_proxy('StandardError', RubyLint.registry))

    klass.define_instance_method('argument')

Severity: Major
Found in lib/ruby-lint/definitions/gems/rspec.rb and 34 other locations - About 25 mins to fix
lib/ruby-lint/definitions/core/gem.rb on lines 1282..1290
lib/ruby-lint/definitions/core/webrick.rb on lines 2190..2198
lib/ruby-lint/definitions/core/webrick.rb on lines 2222..2230
lib/ruby-lint/definitions/gems/celluloid.rb on lines 176..184
lib/ruby-lint/definitions/gems/celluloid.rb on lines 1683..1691
lib/ruby-lint/definitions/gems/devise.rb on lines 1145..1153
lib/ruby-lint/definitions/gems/devise.rb on lines 2124..2132
lib/ruby-lint/definitions/gems/devise.rb on lines 2144..2152
lib/ruby-lint/definitions/gems/devise.rb on lines 2162..2170
lib/ruby-lint/definitions/gems/devise.rb on lines 2182..2190
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 882..890
lib/ruby-lint/definitions/gems/rspec.rb on lines 200..208
lib/ruby-lint/definitions/gems/rspec.rb on lines 1935..1943
lib/ruby-lint/definitions/gems/rspec.rb on lines 3051..3059
lib/ruby-lint/definitions/gems/test.rb on lines 767..775
lib/ruby-lint/definitions/gems/test.rb on lines 2381..2389
lib/ruby-lint/definitions/gems/test.rb on lines 2585..2593
lib/ruby-lint/definitions/rails/action_view.rb on lines 3769..3777
lib/ruby-lint/definitions/rails/action_view.rb on lines 3797..3805
lib/ruby-lint/definitions/rails/active_record.rb on lines 7031..7039
lib/ruby-lint/definitions/rails/active_support.rb on lines 1680..1688
lib/ruby-lint/definitions/rails/active_support.rb on lines 2327..2335
lib/ruby-lint/definitions/rails/active_support.rb on lines 2742..2750
lib/ruby-lint/definitions/rails/active_support.rb on lines 2770..2778
lib/ruby-lint/definitions/rails/active_support.rb on lines 4554..4562
lib/ruby-lint/definitions/rails/active_support.rb on lines 4582..4590
lib/ruby-lint/definitions/rails/active_support.rb on lines 4610..4618
lib/ruby-lint/definitions/rails/active_support.rb on lines 4638..4646
lib/ruby-lint/definitions/rails/arel.rb on lines 2055..2063
lib/ruby-lint/definitions/rails/arel.rb on lines 2083..2091
lib/ruby-lint/definitions/rails/arel.rb on lines 5522..5530
lib/ruby-lint/definitions/rails/arel.rb on lines 5550..5558
lib/ruby-lint/definitions/rails/arel.rb on lines 7040..7048
lib/ruby-lint/definitions/rails/arel.rb on lines 7068..7076

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('Celluloid::PoolManager::NamingRequest') do |klass|
    klass.inherits(defs.constant_proxy('Celluloid::SystemEvent', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.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/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('Nokogiri::XML::ElementContent') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('children')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.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/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::GTG::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 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('Devise::Models::MissingAttribute') do |klass|
    klass.inherits(defs.constant_proxy('StandardError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('attributes')
Severity: Major
Found in lib/ruby-lint/definitions/gems/devise.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/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('ActiveModel::Lint::Tests') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('test_errors_aref')

Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.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_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('ActionController::RequestForgeryProtection') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('form_authenticity_param')

Severity: Major
Found in lib/ruby-lint/definitions/rails/action_controller.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/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::Builder') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('ast')
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 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('ActionController::ParameterMissing') do |klass|
    klass.inherits(defs.constant_proxy('KeyError', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('param')
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 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('OpenSSL::ASN1::ObjectId') do |klass|
    klass.inherits(defs.constant_proxy('OpenSSL::ASN1::Primitive', RubyLint.registry))

    klass.define_method('register')

Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.rb and 15 other locations - About 25 mins to fix
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
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('OpenSSL::PKCS7::Signer') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.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 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
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('OpenSSL::PKCS7::SignerInfo') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('allocate')

Severity: Major
Found in lib/ruby-lint/definitions/core/open_ssl.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/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
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::Parser::Dummy') do |klass|
    klass.inherits(defs.constant_proxy('ActionDispatch::Journey::Nodes::Literal', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_optional_argument('x')
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 1643..1652
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('Minitest::Unit::TestCase::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 689..702
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::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 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 17 locations. Consider refactoring.
Open

  defs.define_constant('Celluloid::NamingRequest') do |klass|
    klass.inherits(defs.constant_proxy('Celluloid::SystemEvent', RubyLint.registry))

    klass.define_instance_method('initialize') do |method|
      method.define_argument('name')
Severity: Major
Found in lib/ruby-lint/definitions/gems/celluloid.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 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('Test::Unit::Assertions::AssertionMessage::Literal') 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 593..602
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::IOCondition') do |klass|
    klass.inherits(defs.constant_proxy('GLib::Flags', RubyLint.registry))

    klass.define_instance_method('err?')

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

Severity
Category
Status
Source
Language