YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

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

  defs.define_constant('Arel::Attributes::Time::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::Addition::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::DeleteStatement::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::DistinctOn::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::Equality::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::In::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::NamedWindow::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher::AttributeMethodMatch::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_model.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::CurrentRow::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::Exists::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::LessThanOrEqual::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('ActiveSupport::HashWithIndifferentAccess::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('ActiveSupport::InheritableOptions::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/active_support.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Attributes::Attribute::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::Count::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::Group::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::Having::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Nodes::InsertStatement::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Sprockets::ProcessedAsset::DependencyFile::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/sprockets.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 617..648
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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

  defs.define_constant('Arel::Attributes::Integer::Enumerator') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))

    klass.define_instance_method('each') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/rails/arel.rb and 179 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/array.rb on lines 382..413
lib/ruby-lint/definitions/core/basic_socket.rb on lines 188..219
lib/ruby-lint/definitions/core/cgi.rb on lines 100..131
lib/ruby-lint/definitions/core/csv.rb on lines 326..357
lib/ruby-lint/definitions/core/csv.rb on lines 387..418
lib/ruby-lint/definitions/core/csv.rb on lines 664..695
lib/ruby-lint/definitions/core/csv.rb on lines 830..861
lib/ruby-lint/definitions/core/enumerator.rb on lines 7..38
lib/ruby-lint/definitions/core/file.rb on lines 619..650
lib/ruby-lint/definitions/core/gem.rb on lines 795..826
lib/ruby-lint/definitions/core/hash.rb on lines 431..462
lib/ruby-lint/definitions/core/io.rb on lines 530..561
lib/ruby-lint/definitions/core/ipsocket.rb on lines 142..173
lib/ruby-lint/definitions/core/irb.rb on lines 305..336
lib/ruby-lint/definitions/core/matrix.rb on lines 335..366
lib/ruby-lint/definitions/core/open_ssl.rb on lines 161..192
lib/ruby-lint/definitions/core/open_ssl.rb on lines 409..440
lib/ruby-lint/definitions/core/open_ssl.rb on lines 468..499
lib/ruby-lint/definitions/core/open_ssl.rb on lines 777..808
lib/ruby-lint/definitions/core/open_ssl.rb on lines 1186..1217
lib/ruby-lint/definitions/core/open_ssl.rb on lines 3221..3252
lib/ruby-lint/definitions/core/option_parser.rb on lines 498..529
lib/ruby-lint/definitions/core/option_parser.rb on lines 968..999
lib/ruby-lint/definitions/core/prime.rb on lines 60..91
lib/ruby-lint/definitions/core/prime.rb on lines 107..138
lib/ruby-lint/definitions/core/prime.rb on lines 196..227
lib/ruby-lint/definitions/core/prime.rb on lines 297..328
lib/ruby-lint/definitions/core/prime.rb on lines 411..442
lib/ruby-lint/definitions/core/range.rb on lines 102..133
lib/ruby-lint/definitions/core/set.rb on lines 176..207
lib/ruby-lint/definitions/core/socket.rb on lines 1510..1541
lib/ruby-lint/definitions/core/sorted_set.rb on lines 24..55
lib/ruby-lint/definitions/core/string_io.rb on lines 284..315
lib/ruby-lint/definitions/core/struct.rb on lines 123..154
lib/ruby-lint/definitions/core/syck.rb on lines 361..392
lib/ruby-lint/definitions/core/syck.rb on lines 474..505
lib/ruby-lint/definitions/core/syck.rb on lines 836..867
lib/ruby-lint/definitions/core/syck.rb on lines 1138..1169
lib/ruby-lint/definitions/core/tcpserver.rb on lines 129..160
lib/ruby-lint/definitions/core/tcpsocket.rb on lines 143..174
lib/ruby-lint/definitions/core/udpsocket.rb on lines 144..175
lib/ruby-lint/definitions/core/unixserver.rb on lines 128..159
lib/ruby-lint/definitions/core/unixsocket.rb on lines 157..188
lib/ruby-lint/definitions/core/vector.rb on lines 146..177
lib/ruby-lint/definitions/core/webrick.rb on lines 510..541
lib/ruby-lint/definitions/core/zlib.rb on lines 238..269
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 948..979
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1197..1228
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1993..2024
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2460..2491
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2685..2716
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2995..3026
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3214..3245
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3433..3464
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3670..3701
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4001..4032
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4269..4300
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4487..4518
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4768..4799
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5020..5051
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5254..5285
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5844..5875
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6122..6153
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6181..6212
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6767..6798
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6987..7018
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7451..7482
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2117..2148
lib/ruby-lint/definitions/rails/action_controller.rb on lines 2301..2332
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 476..507
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 846..877
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1162..1193
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2466..2497
lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2720..2751
lib/ruby-lint/definitions/rails/action_view.rb on lines 4034..4065
lib/ruby-lint/definitions/rails/active_model.rb on lines 139..170
lib/ruby-lint/definitions/rails/active_model.rb on lines 495..526
lib/ruby-lint/definitions/rails/active_record.rb on lines 3877..3908
lib/ruby-lint/definitions/rails/active_record.rb on lines 4482..4513
lib/ruby-lint/definitions/rails/active_record.rb on lines 6561..6592
lib/ruby-lint/definitions/rails/active_record.rb on lines 6736..6767
lib/ruby-lint/definitions/rails/active_record.rb on lines 7080..7111
lib/ruby-lint/definitions/rails/active_record.rb on lines 8781..8812
lib/ruby-lint/definitions/rails/active_support.rb on lines 1245..1276
lib/ruby-lint/definitions/rails/active_support.rb on lines 1718..1749
lib/ruby-lint/definitions/rails/active_support.rb on lines 2080..2111
lib/ruby-lint/definitions/rails/active_support.rb on lines 2514..2545
lib/ruby-lint/definitions/rails/active_support.rb on lines 3741..3772
lib/ruby-lint/definitions/rails/active_support.rb on lines 4045..4076
lib/ruby-lint/definitions/rails/arel.rb on lines 45..76
lib/ruby-lint/definitions/rails/arel.rb on lines 188..219
lib/ruby-lint/definitions/rails/arel.rb on lines 331..362
lib/ruby-lint/definitions/rails/arel.rb on lines 474..505
lib/ruby-lint/definitions/rails/arel.rb on lines 760..791
lib/ruby-lint/definitions/rails/arel.rb on lines 903..934
lib/ruby-lint/definitions/rails/arel.rb on lines 1046..1077
lib/ruby-lint/definitions/rails/arel.rb on lines 1203..1234
lib/ruby-lint/definitions/rails/arel.rb on lines 1471..1502
lib/ruby-lint/definitions/rails/arel.rb on lines 1552..1583
lib/ruby-lint/definitions/rails/arel.rb on lines 1611..1642
lib/ruby-lint/definitions/rails/arel.rb on lines 1677..1708
lib/ruby-lint/definitions/rails/arel.rb on lines 1736..1767
lib/ruby-lint/definitions/rails/arel.rb on lines 1795..1826
lib/ruby-lint/definitions/rails/arel.rb on lines 1854..1885
lib/ruby-lint/definitions/rails/arel.rb on lines 1913..1944
lib/ruby-lint/definitions/rails/arel.rb on lines 1996..2027
lib/ruby-lint/definitions/rails/arel.rb on lines 2107..2138
lib/ruby-lint/definitions/rails/arel.rb on lines 2171..2202
lib/ruby-lint/definitions/rails/arel.rb on lines 2244..2275
lib/ruby-lint/definitions/rails/arel.rb on lines 2310..2341
lib/ruby-lint/definitions/rails/arel.rb on lines 2374..2405
lib/ruby-lint/definitions/rails/arel.rb on lines 2433..2464
lib/ruby-lint/definitions/rails/arel.rb on lines 2498..2529
lib/ruby-lint/definitions/rails/arel.rb on lines 2557..2588
lib/ruby-lint/definitions/rails/arel.rb on lines 2621..2652
lib/ruby-lint/definitions/rails/arel.rb on lines 2680..2711
lib/ruby-lint/definitions/rails/arel.rb on lines 2739..2770
lib/ruby-lint/definitions/rails/arel.rb on lines 2830..2861
lib/ruby-lint/definitions/rails/arel.rb on lines 2894..2925
lib/ruby-lint/definitions/rails/arel.rb on lines 2958..2989
lib/ruby-lint/definitions/rails/arel.rb on lines 3049..3080
lib/ruby-lint/definitions/rails/arel.rb on lines 3108..3139
lib/ruby-lint/definitions/rails/arel.rb on lines 3167..3198
lib/ruby-lint/definitions/rails/arel.rb on lines 3226..3257
lib/ruby-lint/definitions/rails/arel.rb on lines 3286..3317
lib/ruby-lint/definitions/rails/arel.rb on lines 3345..3376
lib/ruby-lint/definitions/rails/arel.rb on lines 3404..3435
lib/ruby-lint/definitions/rails/arel.rb on lines 3477..3508
lib/ruby-lint/definitions/rails/arel.rb on lines 3536..3567
lib/ruby-lint/definitions/rails/arel.rb on lines 3618..3649
lib/ruby-lint/definitions/rails/arel.rb on lines 3677..3708
lib/ruby-lint/definitions/rails/arel.rb on lines 3736..3767
lib/ruby-lint/definitions/rails/arel.rb on lines 3803..3834
lib/ruby-lint/definitions/rails/arel.rb on lines 3862..3893
lib/ruby-lint/definitions/rails/arel.rb on lines 3921..3952
lib/ruby-lint/definitions/rails/arel.rb on lines 3980..4011
lib/ruby-lint/definitions/rails/arel.rb on lines 4039..4070
lib/ruby-lint/definitions/rails/arel.rb on lines 4098..4129
lib/ruby-lint/definitions/rails/arel.rb on lines 4157..4188
lib/ruby-lint/definitions/rails/arel.rb on lines 4216..4247
lib/ruby-lint/definitions/rails/arel.rb on lines 4281..4312
lib/ruby-lint/definitions/rails/arel.rb on lines 4361..4392
lib/ruby-lint/definitions/rails/arel.rb on lines 4439..4470
lib/ruby-lint/definitions/rails/arel.rb on lines 4517..4548
lib/ruby-lint/definitions/rails/arel.rb on lines 4576..4607
lib/ruby-lint/definitions/rails/arel.rb on lines 4635..4666
lib/ruby-lint/definitions/rails/arel.rb on lines 4694..4725
lib/ruby-lint/definitions/rails/arel.rb on lines 4753..4784
lib/ruby-lint/definitions/rails/arel.rb on lines 4812..4843
lib/ruby-lint/definitions/rails/arel.rb on lines 4871..4902
lib/ruby-lint/definitions/rails/arel.rb on lines 4930..4961
lib/ruby-lint/definitions/rails/arel.rb on lines 4989..5020
lib/ruby-lint/definitions/rails/arel.rb on lines 5057..5088
lib/ruby-lint/definitions/rails/arel.rb on lines 5121..5152
lib/ruby-lint/definitions/rails/arel.rb on lines 5185..5216
lib/ruby-lint/definitions/rails/arel.rb on lines 5249..5280
lib/ruby-lint/definitions/rails/arel.rb on lines 5363..5394
lib/ruby-lint/definitions/rails/arel.rb on lines 5459..5490
lib/ruby-lint/definitions/rails/arel.rb on lines 5573..5604
lib/ruby-lint/definitions/rails/arel.rb on lines 5638..5669
lib/ruby-lint/definitions/rails/arel.rb on lines 5697..5728
lib/ruby-lint/definitions/rails/arel.rb on lines 5769..5800
lib/ruby-lint/definitions/rails/arel.rb on lines 5828..5859
lib/ruby-lint/definitions/rails/arel.rb on lines 5892..5923
lib/ruby-lint/definitions/rails/arel.rb on lines 5972..6003
lib/ruby-lint/definitions/rails/arel.rb on lines 6031..6062
lib/ruby-lint/definitions/rails/arel.rb on lines 6090..6121
lib/ruby-lint/definitions/rails/arel.rb on lines 6158..6189
lib/ruby-lint/definitions/rails/arel.rb on lines 6252..6283
lib/ruby-lint/definitions/rails/arel.rb on lines 6325..6356
lib/ruby-lint/definitions/rails/arel.rb on lines 6421..6452
lib/ruby-lint/definitions/rails/arel.rb on lines 6481..6512
lib/ruby-lint/definitions/rails/arel.rb on lines 6540..6571
lib/ruby-lint/definitions/rails/arel.rb on lines 6882..6913
lib/ruby-lint/definitions/rails/arel.rb on lines 7303..7334
lib/ruby-lint/definitions/rails/rails.rb on lines 951..982
lib/ruby-lint/definitions/rails/rails.rb on lines 1549..1580
lib/ruby-lint/definitions/rails/sprockets.rb on lines 884..915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1505..1536

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

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