YorickPeterse/ruby-lint

View on GitHub
lib/ruby-lint/definitions/gems/sinatra.rb

Summary

Maintainability
F
1 wk
Test Coverage

File sinatra.rb has 1375 lines of code (exceeds 250 allowed). Consider refactoring.
Open

RubyLint.registry.register('Sinatra') do |defs|
  defs.define_constant('Sinatra') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('helpers') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/gems/sinatra.rb - About 3 days to fix

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

      defs.define_constant('Sinatra::Application::OkJson') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('abbrev') do |method|
          method.define_argument('s')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 1 day to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 1094..1216

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Base::OkJson') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('abbrev') do |method|
          method.define_argument('s')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 1 day to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 238..360

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Base::HeaderHash') do |klass|
        klass.inherits(defs.constant_proxy('Hash', RubyLint.registry))
    
        klass.define_method('new') do |method|
          method.define_optional_argument('hash')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 3 hrs to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 139..197

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Application::HeaderHash') do |klass|
        klass.inherits(defs.constant_proxy('Hash', RubyLint.registry))
    
        klass.define_method('new') do |method|
          method.define_optional_argument('hash')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 3 hrs to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 995..1053

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

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

      defs.define_constant('Sinatra::ExtendedRack::Tms') do |klass|
        klass.inherits(defs.constant_proxy('Struct', RubyLint.registry))
    
        klass.define_method('[]') do |method|
          method.define_rest_argument('args')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 23 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/core/csv.rb on lines 476..522
    lib/ruby-lint/definitions/core/irb.rb on lines 394..440
    lib/ruby-lint/definitions/core/webrick.rb on lines 599..645
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2152..2198
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6340..6386
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2390..2436
    lib/ruby-lint/definitions/rails/active_model.rb on lines 228..274
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3966..4012
    lib/ruby-lint/definitions/rails/active_record.rb on lines 4571..4617
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6650..6696
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6825..6871
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7169..7215
    lib/ruby-lint/definitions/rails/arel.rb on lines 134..180
    lib/ruby-lint/definitions/rails/arel.rb on lines 277..323
    lib/ruby-lint/definitions/rails/arel.rb on lines 420..466
    lib/ruby-lint/definitions/rails/arel.rb on lines 563..609
    lib/ruby-lint/definitions/rails/arel.rb on lines 706..752
    lib/ruby-lint/definitions/rails/arel.rb on lines 849..895
    lib/ruby-lint/definitions/rails/arel.rb on lines 992..1038
    lib/ruby-lint/definitions/rails/arel.rb on lines 1135..1181
    lib/ruby-lint/definitions/rails/arel.rb on lines 6971..7017
    lib/ruby-lint/definitions/rails/arel.rb on lines 7392..7438
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 973..1019

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Application::Stream') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('defer') do |method|
          method.define_rest_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 2 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 1230..1266
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 1562..1598

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Helpers::Stream') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('defer') do |method|
          method.define_rest_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 2 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 374..410
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 1230..1266

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Base::Stream') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('defer') do |method|
          method.define_rest_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 2 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 374..410
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 1562..1598

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::ExtendedRack::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/gems/sinatra.rb and 11 other locations - About 2 hrs to fix
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 496..531
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 1512..1547
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 1633..1668
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 1813..1848
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 2065..2100
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 2195..2230
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 2311..2346
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 2584..2619
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5705..5740
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7285..7320
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 8143..8178

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Application::Context') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('app')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 947..971

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Base::Context') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('app')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 91..115

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Base::KeySpaceConstrainedParams') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('[]') do |method|
          method.define_argument('key')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 200..222

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Application::KeySpaceConstrainedParams') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('[]') do |method|
          method.define_argument('key')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 1056..1078

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

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

      defs.define_constant('Sinatra::ExtendedRack::SortedElement') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('<=>') do |method|
          method.define_argument('other')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 191 other locations - About 55 mins to fix
    lib/ruby-lint/definitions/core/array.rb on lines 417..433
    lib/ruby-lint/definitions/core/basic_socket.rb on lines 486..502
    lib/ruby-lint/definitions/core/cgi.rb on lines 135..151
    lib/ruby-lint/definitions/core/csv.rb on lines 457..473
    lib/ruby-lint/definitions/core/csv.rb on lines 699..715
    lib/ruby-lint/definitions/core/csv.rb on lines 718..734
    lib/ruby-lint/definitions/core/csv.rb on lines 865..881
    lib/ruby-lint/definitions/core/enumerable.rb on lines 167..183
    lib/ruby-lint/definitions/core/file.rb on lines 1213..1229
    lib/ruby-lint/definitions/core/gem.rb on lines 830..846
    lib/ruby-lint/definitions/core/hash.rb on lines 490..506
    lib/ruby-lint/definitions/core/io.rb on lines 746..762
    lib/ruby-lint/definitions/core/ipsocket.rb on lines 440..456
    lib/ruby-lint/definitions/core/irb.rb on lines 375..391
    lib/ruby-lint/definitions/core/matrix.rb on lines 494..510
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 196..212
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 444..460
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 503..519
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 812..828
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 1221..1237
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 3256..3272
    lib/ruby-lint/definitions/core/option_parser.rb on lines 557..573
    lib/ruby-lint/definitions/core/option_parser.rb on lines 1027..1043
    lib/ruby-lint/definitions/core/prime.rb on lines 142..158
    lib/ruby-lint/definitions/core/prime.rb on lines 231..247
    lib/ruby-lint/definitions/core/prime.rb on lines 332..348
    lib/ruby-lint/definitions/core/prime.rb on lines 351..367
    lib/ruby-lint/definitions/core/prime.rb on lines 446..462
    lib/ruby-lint/definitions/core/range.rb on lines 137..153
    lib/ruby-lint/definitions/core/set.rb on lines 216..232
    lib/ruby-lint/definitions/core/socket.rb on lines 3126..3142
    lib/ruby-lint/definitions/core/sorted_set.rb on lines 64..80
    lib/ruby-lint/definitions/core/string_io.rb on lines 319..335
    lib/ruby-lint/definitions/core/struct.rb on lines 158..174
    lib/ruby-lint/definitions/core/syck.rb on lines 396..412
    lib/ruby-lint/definitions/core/syck.rb on lines 509..525
    lib/ruby-lint/definitions/core/syck.rb on lines 895..911
    lib/ruby-lint/definitions/core/syck.rb on lines 1197..1213
    lib/ruby-lint/definitions/core/tcpserver.rb on lines 427..443
    lib/ruby-lint/definitions/core/tcpsocket.rb on lines 441..457
    lib/ruby-lint/definitions/core/udpsocket.rb on lines 442..458
    lib/ruby-lint/definitions/core/unixserver.rb on lines 426..442
    lib/ruby-lint/definitions/core/unixsocket.rb on lines 455..471
    lib/ruby-lint/definitions/core/vector.rb on lines 201..217
    lib/ruby-lint/definitions/core/webrick.rb on lines 580..596
    lib/ruby-lint/definitions/core/zlib.rb on lines 291..307
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 569..585
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 1551..1567
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 1672..1688
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 1894..1910
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 2146..2162
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 2234..2250
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 2350..2366
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 3159..3175
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5744..5760
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7358..7374
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 8182..8198
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1072..1088
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1306..1322
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2133..2149
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2569..2585
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2794..2810
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3104..3120
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3323..3339
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3542..3558
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3779..3795
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4125..4141
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4378..4394
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4596..4612
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4877..4893
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5144..5160
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5363..5379
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5899..5915
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6157..6173
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6321..6337
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6876..6892
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7022..7038
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7560..7576
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2186..2202
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2371..2387
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 511..527
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 881..897
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1202..1218
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2501..2517
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2787..2803
    lib/ruby-lint/definitions/rails/action_view.rb on lines 4069..4085
    lib/ruby-lint/definitions/rails/active_model.rb on lines 209..225
    lib/ruby-lint/definitions/rails/active_model.rb on lines 530..546
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3947..3963
    lib/ruby-lint/definitions/rails/active_record.rb on lines 4552..4568
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6631..6647
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6806..6822
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7150..7166
    lib/ruby-lint/definitions/rails/active_record.rb on lines 8816..8832
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1280..1296
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1753..1769
    lib/ruby-lint/definitions/rails/active_support.rb on lines 2139..2155
    lib/ruby-lint/definitions/rails/active_support.rb on lines 2573..2589
    lib/ruby-lint/definitions/rails/active_support.rb on lines 3800..3816
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4104..4120
    lib/ruby-lint/definitions/rails/arel.rb on lines 115..131
    lib/ruby-lint/definitions/rails/arel.rb on lines 258..274
    lib/ruby-lint/definitions/rails/arel.rb on lines 401..417
    lib/ruby-lint/definitions/rails/arel.rb on lines 544..560
    lib/ruby-lint/definitions/rails/arel.rb on lines 687..703
    lib/ruby-lint/definitions/rails/arel.rb on lines 830..846
    lib/ruby-lint/definitions/rails/arel.rb on lines 973..989
    lib/ruby-lint/definitions/rails/arel.rb on lines 1116..1132
    lib/ruby-lint/definitions/rails/arel.rb on lines 1238..1254
    lib/ruby-lint/definitions/rails/arel.rb on lines 1506..1522
    lib/ruby-lint/definitions/rails/arel.rb on lines 1587..1603
    lib/ruby-lint/definitions/rails/arel.rb on lines 1646..1662
    lib/ruby-lint/definitions/rails/arel.rb on lines 1712..1728
    lib/ruby-lint/definitions/rails/arel.rb on lines 1771..1787
    lib/ruby-lint/definitions/rails/arel.rb on lines 1830..1846
    lib/ruby-lint/definitions/rails/arel.rb on lines 1889..1905
    lib/ruby-lint/definitions/rails/arel.rb on lines 1948..1964
    lib/ruby-lint/definitions/rails/arel.rb on lines 2031..2047
    lib/ruby-lint/definitions/rails/arel.rb on lines 2142..2158
    lib/ruby-lint/definitions/rails/arel.rb on lines 2206..2222
    lib/ruby-lint/definitions/rails/arel.rb on lines 2279..2295
    lib/ruby-lint/definitions/rails/arel.rb on lines 2345..2361
    lib/ruby-lint/definitions/rails/arel.rb on lines 2409..2425
    lib/ruby-lint/definitions/rails/arel.rb on lines 2468..2484
    lib/ruby-lint/definitions/rails/arel.rb on lines 2533..2549
    lib/ruby-lint/definitions/rails/arel.rb on lines 2592..2608
    lib/ruby-lint/definitions/rails/arel.rb on lines 2656..2672
    lib/ruby-lint/definitions/rails/arel.rb on lines 2715..2731
    lib/ruby-lint/definitions/rails/arel.rb on lines 2774..2790
    lib/ruby-lint/definitions/rails/arel.rb on lines 2865..2881
    lib/ruby-lint/definitions/rails/arel.rb on lines 2929..2945
    lib/ruby-lint/definitions/rails/arel.rb on lines 2993..3009
    lib/ruby-lint/definitions/rails/arel.rb on lines 3084..3100
    lib/ruby-lint/definitions/rails/arel.rb on lines 3143..3159
    lib/ruby-lint/definitions/rails/arel.rb on lines 3202..3218
    lib/ruby-lint/definitions/rails/arel.rb on lines 3261..3277
    lib/ruby-lint/definitions/rails/arel.rb on lines 3321..3337
    lib/ruby-lint/definitions/rails/arel.rb on lines 3380..3396
    lib/ruby-lint/definitions/rails/arel.rb on lines 3439..3455
    lib/ruby-lint/definitions/rails/arel.rb on lines 3512..3528
    lib/ruby-lint/definitions/rails/arel.rb on lines 3571..3587
    lib/ruby-lint/definitions/rails/arel.rb on lines 3653..3669
    lib/ruby-lint/definitions/rails/arel.rb on lines 3712..3728
    lib/ruby-lint/definitions/rails/arel.rb on lines 3771..3787
    lib/ruby-lint/definitions/rails/arel.rb on lines 3838..3854
    lib/ruby-lint/definitions/rails/arel.rb on lines 3897..3913
    lib/ruby-lint/definitions/rails/arel.rb on lines 3956..3972
    lib/ruby-lint/definitions/rails/arel.rb on lines 4015..4031
    lib/ruby-lint/definitions/rails/arel.rb on lines 4074..4090
    lib/ruby-lint/definitions/rails/arel.rb on lines 4133..4149
    lib/ruby-lint/definitions/rails/arel.rb on lines 4192..4208
    lib/ruby-lint/definitions/rails/arel.rb on lines 4251..4267
    lib/ruby-lint/definitions/rails/arel.rb on lines 4316..4332
    lib/ruby-lint/definitions/rails/arel.rb on lines 4396..4412
    lib/ruby-lint/definitions/rails/arel.rb on lines 4474..4490
    lib/ruby-lint/definitions/rails/arel.rb on lines 4552..4568
    lib/ruby-lint/definitions/rails/arel.rb on lines 4611..4627
    lib/ruby-lint/definitions/rails/arel.rb on lines 4670..4686
    lib/ruby-lint/definitions/rails/arel.rb on lines 4729..4745
    lib/ruby-lint/definitions/rails/arel.rb on lines 4788..4804
    lib/ruby-lint/definitions/rails/arel.rb on lines 4847..4863
    lib/ruby-lint/definitions/rails/arel.rb on lines 4906..4922
    lib/ruby-lint/definitions/rails/arel.rb on lines 4965..4981
    lib/ruby-lint/definitions/rails/arel.rb on lines 5024..5040
    lib/ruby-lint/definitions/rails/arel.rb on lines 5092..5108
    lib/ruby-lint/definitions/rails/arel.rb on lines 5156..5172
    lib/ruby-lint/definitions/rails/arel.rb on lines 5220..5236
    lib/ruby-lint/definitions/rails/arel.rb on lines 5284..5300
    lib/ruby-lint/definitions/rails/arel.rb on lines 5398..5414
    lib/ruby-lint/definitions/rails/arel.rb on lines 5494..5510
    lib/ruby-lint/definitions/rails/arel.rb on lines 5608..5624
    lib/ruby-lint/definitions/rails/arel.rb on lines 5673..5689
    lib/ruby-lint/definitions/rails/arel.rb on lines 5732..5748
    lib/ruby-lint/definitions/rails/arel.rb on lines 5804..5820
    lib/ruby-lint/definitions/rails/arel.rb on lines 5863..5879
    lib/ruby-lint/definitions/rails/arel.rb on lines 5927..5943
    lib/ruby-lint/definitions/rails/arel.rb on lines 6007..6023
    lib/ruby-lint/definitions/rails/arel.rb on lines 6066..6082
    lib/ruby-lint/definitions/rails/arel.rb on lines 6125..6141
    lib/ruby-lint/definitions/rails/arel.rb on lines 6193..6209
    lib/ruby-lint/definitions/rails/arel.rb on lines 6287..6303
    lib/ruby-lint/definitions/rails/arel.rb on lines 6360..6376
    lib/ruby-lint/definitions/rails/arel.rb on lines 6456..6472
    lib/ruby-lint/definitions/rails/arel.rb on lines 6516..6532
    lib/ruby-lint/definitions/rails/arel.rb on lines 6575..6591
    lib/ruby-lint/definitions/rails/arel.rb on lines 6952..6968
    lib/ruby-lint/definitions/rails/arel.rb on lines 7373..7389
    lib/ruby-lint/definitions/rails/rails.rb on lines 986..1002
    lib/ruby-lint/definitions/rails/rails.rb on lines 1584..1600
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 954..970
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 1564..1580

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::ShowExceptions') do |klass|
        klass.inherits(defs.constant_proxy('Rack::ShowExceptions', RubyLint.registry))
    
        klass.define_instance_method('call') do |method|
          method.define_argument('env')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 15 other locations - About 35 mins to fix
    lib/ruby-lint/definitions/core/tempfile.rb on lines 54..64
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5768..5778
    lib/ruby-lint/definitions/gems/rspec.rb on lines 8788..8798
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 355..365
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 747..757
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1258..1268
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 3674..3684
    lib/ruby-lint/definitions/rails/action_view.rb on lines 4443..4453
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3647..3657
    lib/ruby-lint/definitions/rails/active_record.rb on lines 4070..4080
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6299..6309
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7419..7429
    lib/ruby-lint/definitions/rails/active_record.rb on lines 8965..8975
    lib/ruby-lint/definitions/rails/active_support.rb on lines 2798..2808
    lib/ruby-lint/definitions/rails/rails.rb on lines 1658..1668

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

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

      defs.define_constant('Sinatra::ExtendedRack::Passwd') do |klass|
        klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))
    
        klass.define_instance_method('dir')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 38 other locations - About 35 mins to fix
    lib/ruby-lint/definitions/core/csv.rb on lines 434..449
    lib/ruby-lint/definitions/core/digest.rb on lines 17..32
    lib/ruby-lint/definitions/core/etc.rb on lines 102..117
    lib/ruby-lint/definitions/core/irb.rb on lines 352..367
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 2100..2115
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 2168..2183
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 3365..3380
    lib/ruby-lint/definitions/core/webrick.rb on lines 557..572
    lib/ruby-lint/definitions/gems/gtk.rb on lines 3589..3604
    lib/ruby-lint/definitions/gems/gtk.rb on lines 3706..3721
    lib/ruby-lint/definitions/gems/gtk.rb on lines 3768..3783
    lib/ruby-lint/definitions/gems/gtk.rb on lines 3900..3915
    lib/ruby-lint/definitions/gems/gtk.rb on lines 3994..4009
    lib/ruby-lint/definitions/gems/gtk.rb on lines 4056..4071
    lib/ruby-lint/definitions/gems/gtk.rb on lines 4118..4133
    lib/ruby-lint/definitions/gems/gtk.rb on lines 4632..4647
    lib/ruby-lint/definitions/gems/gtk.rb on lines 4714..4729
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2110..2125
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6298..6313
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2348..2363
    lib/ruby-lint/definitions/rails/active_model.rb on lines 186..201
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3924..3939
    lib/ruby-lint/definitions/rails/active_record.rb on lines 4529..4544
    lib/ruby-lint/definitions/rails/active_record.rb on lines 5826..5841
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6608..6623
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6783..6798
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7127..7142
    lib/ruby-lint/definitions/rails/arel.rb on lines 92..107
    lib/ruby-lint/definitions/rails/arel.rb on lines 235..250
    lib/ruby-lint/definitions/rails/arel.rb on lines 378..393
    lib/ruby-lint/definitions/rails/arel.rb on lines 521..536
    lib/ruby-lint/definitions/rails/arel.rb on lines 664..679
    lib/ruby-lint/definitions/rails/arel.rb on lines 807..822
    lib/ruby-lint/definitions/rails/arel.rb on lines 950..965
    lib/ruby-lint/definitions/rails/arel.rb on lines 1093..1108
    lib/ruby-lint/definitions/rails/arel.rb on lines 6929..6944
    lib/ruby-lint/definitions/rails/arel.rb on lines 7350..7365
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 931..946

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 34.

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Application::Multipart') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('build_multipart') do |method|
          method.define_argument('params')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 11 other locations - About 30 mins to fix
    lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
    lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
    lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
    lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
    lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 1081..1090
    lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
    lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
    lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
    lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
    lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 33.

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Base::Multipart') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('build_multipart') do |method|
          method.define_argument('params')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 11 other locations - About 30 mins to fix
    lib/ruby-lint/definitions/core/open_uri.rb on lines 143..152
    lib/ruby-lint/definitions/gems/devise.rb on lines 806..815
    lib/ruby-lint/definitions/gems/rspec.rb on lines 157..166
    lib/ruby-lint/definitions/gems/rspec.rb on lines 1892..1901
    lib/ruby-lint/definitions/gems/rspec.rb on lines 5157..5166
    lib/ruby-lint/definitions/gems/sinatra.rb on lines 225..234
    lib/ruby-lint/definitions/gems/test.rb on lines 1159..1168
    lib/ruby-lint/definitions/gems/test.rb on lines 2194..2203
    lib/ruby-lint/definitions/rails/active_model.rb on lines 872..881
    lib/ruby-lint/definitions/rails/active_support.rb on lines 143..152
    lib/ruby-lint/definitions/rails/active_support.rb on lines 5116..5125

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 33.

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('Sinatra::Delegator') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('delegate') do |method|
          method.define_rest_argument('methods')
    Severity: Minor
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 5 other locations - About 20 mins to fix
    lib/ruby-lint/definitions/core/prime.rb on lines 250..259
    lib/ruby-lint/definitions/gems/test.rb on lines 2473..2482
    lib/ruby-lint/definitions/gems/test.rb on lines 2485..2494
    lib/ruby-lint/definitions/gems/test.rb on lines 2497..2506
    lib/ruby-lint/definitions/rails/active_record.rb on lines 235..244

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

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

      defs.define_constant('Sinatra::ExtendedRack::Group') do |klass|
        klass.inherits(defs.constant_proxy('Rubinius::FFI::Struct', RubyLint.registry))
    
        klass.define_instance_method('gid')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/sinatra.rb and 54 other locations - About 15 mins to fix
    lib/ruby-lint/definitions/core/csv.rb on lines 422..431
    lib/ruby-lint/definitions/core/etc.rb on lines 90..99
    lib/ruby-lint/definitions/core/gem.rb on lines 1354..1363
    lib/ruby-lint/definitions/core/irb.rb on lines 340..349
    lib/ruby-lint/definitions/core/json.rb on lines 194..203
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 367..376
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 2621..2630
    lib/ruby-lint/definitions/core/prime.rb on lines 95..104
    lib/ruby-lint/definitions/core/prime.rb on lines 184..193
    lib/ruby-lint/definitions/core/prime.rb on lines 399..408
    lib/ruby-lint/definitions/core/syck.rb on lines 625..634
    lib/ruby-lint/definitions/core/webrick.rb on lines 545..554
    lib/ruby-lint/definitions/gems/glib.rb on lines 552..561
    lib/ruby-lint/definitions/gems/glib.rb on lines 2309..2318
    lib/ruby-lint/definitions/gems/glib.rb on lines 2617..2626
    lib/ruby-lint/definitions/gems/glib.rb on lines 2639..2648
    lib/ruby-lint/definitions/gems/glib.rb on lines 2786..2795
    lib/ruby-lint/definitions/gems/glib.rb on lines 2808..2817
    lib/ruby-lint/definitions/gems/gtk.rb on lines 6114..6123
    lib/ruby-lint/definitions/gems/gtk.rb on lines 6146..6155
    lib/ruby-lint/definitions/gems/gtk.rb on lines 7718..7727
    lib/ruby-lint/definitions/gems/minitest.rb on lines 88..97
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 1422..1431
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 2572..2581
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2028..2037
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2603..2612
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4686..4695
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6216..6225
    lib/ruby-lint/definitions/gems/rspec.rb on lines 8415..8424
    lib/ruby-lint/definitions/gems/rspec.rb on lines 9714..9723
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2336..2345
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 369..378
    lib/ruby-lint/definitions/rails/active_model.rb on lines 174..183
    lib/ruby-lint/definitions/rails/active_model.rb on lines 305..314
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3912..3921
    lib/ruby-lint/definitions/rails/active_record.rb on lines 4517..4526
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6596..6605
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6771..6780
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7115..7124
    lib/ruby-lint/definitions/rails/active_support.rb on lines 5679..5688
    lib/ruby-lint/definitions/rails/arel.rb on lines 80..89
    lib/ruby-lint/definitions/rails/arel.rb on lines 223..232
    lib/ruby-lint/definitions/rails/arel.rb on lines 366..375
    lib/ruby-lint/definitions/rails/arel.rb on lines 509..518
    lib/ruby-lint/definitions/rails/arel.rb on lines 652..661
    lib/ruby-lint/definitions/rails/arel.rb on lines 795..804
    lib/ruby-lint/definitions/rails/arel.rb on lines 938..947
    lib/ruby-lint/definitions/rails/arel.rb on lines 1081..1090
    lib/ruby-lint/definitions/rails/arel.rb on lines 1257..1266
    lib/ruby-lint/definitions/rails/arel.rb on lines 1665..1674
    lib/ruby-lint/definitions/rails/arel.rb on lines 2298..2307
    lib/ruby-lint/definitions/rails/arel.rb on lines 6917..6926
    lib/ruby-lint/definitions/rails/arel.rb on lines 7338..7347
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 919..928

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

    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

    There are no issues that match your filters.

    Category
    Status