YorickPeterse/ruby-lint

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

Summary

Maintainability
F
1 wk
Test Coverage

File glib.rb has 3788 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    klass.define_method('__add_one_arg_setter') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/gems/glib.rb - About 1 wk to fix

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

      defs.define_constant('GLib::PollFD') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Boxed', RubyLint.registry))
    
        klass.define_instance_method('events')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 2 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/gems/gtk.rb on lines 475..505
    lib/ruby-lint/definitions/gems/gtk.rb on lines 4012..4042

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('GLib::Timeout') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('add') do |method|
          method.define_rest_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 15 other locations - About 55 mins to fix
    lib/ruby-lint/definitions/core/erb.rb on lines 269..285
    lib/ruby-lint/definitions/core/uri.rb on lines 88..104
    lib/ruby-lint/definitions/core/uri.rb on lines 470..486
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 1330..1346
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 3281..3297
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 6006..6022
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 8589..8605
    lib/ruby-lint/definitions/gems/rspec.rb on lines 3268..3284
    lib/ruby-lint/definitions/rails/abstract_controller.rb on lines 569..585
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 1375..1391
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2738..2754
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 2384..2400
    lib/ruby-lint/definitions/rails/active_record.rb on lines 11695..11711
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1201..1217
    lib/ruby-lint/definitions/rails/arel.rb on lines 1411..1427

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

      defs.define_constant('GLib::Win32') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('error_message') do |method|
          method.define_argument('arg1')
    Severity: Minor
    Found in lib/ruby-lint/definitions/gems/glib.rb and 1 other location - About 50 mins to fix
    lib/ruby-lint/definitions/gems/rspec.rb on lines 7852..7869

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('GLib::SignalFlags') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Flags', RubyLint.registry))
    
        klass.define_instance_method('action?')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 7 other locations - About 45 mins to fix
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 2078..2097
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 3857..3876
    lib/ruby-lint/definitions/core/syck.rb on lines 593..612
    lib/ruby-lint/definitions/core/zlib.rb on lines 72..91
    lib/ruby-lint/definitions/core/zlib.rb on lines 372..391
    lib/ruby-lint/definitions/gems/gtk.rb on lines 9684..9703
    lib/ruby-lint/definitions/gems/gtk.rb on lines 20603..20622

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('GLib::Shell') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('parse') do |method|
          method.define_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 7 other locations - About 40 mins to fix
    lib/ruby-lint/definitions/gems/tree.rb on lines 174..186
    lib/ruby-lint/definitions/rails/active_model.rb on lines 856..868
    lib/ruby-lint/definitions/rails/active_record.rb on lines 875..887
    lib/ruby-lint/definitions/rails/active_record.rb on lines 2415..2427
    lib/ruby-lint/definitions/rails/active_record.rb on lines 2614..2626
    lib/ruby-lint/definitions/rails/active_record.rb on lines 10060..10072
    lib/ruby-lint/definitions/rails/active_record.rb on lines 10264..10276

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

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

      defs.define_constant('GLib::Idle') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('add') do |method|
          method.define_rest_argument('arg1')
    Severity: Minor
    Found in lib/ruby-lint/definitions/gems/glib.rb and 3 other locations - About 30 mins to fix
    lib/ruby-lint/definitions/gems/devise.rb on lines 1906..1917
    lib/ruby-lint/definitions/gems/gtk.rb on lines 22355..22366
    lib/ruby-lint/definitions/gems/test.rb on lines 784..795

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

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('GLib::IOCondition') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Flags', RubyLint.registry))
    
        klass.define_instance_method('err?')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 15 other locations - About 25 mins to fix
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 341..354
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 2338..2351
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 2354..2367
    lib/ruby-lint/definitions/core/syck.rb on lines 415..428
    lib/ruby-lint/definitions/gems/celluloid.rb on lines 1255..1268
    lib/ruby-lint/definitions/gems/celluloid.rb on lines 2511..2524
    lib/ruby-lint/definitions/gems/glib.rb on lines 3262..3275
    lib/ruby-lint/definitions/gems/gtk.rb on lines 14063..14076
    lib/ruby-lint/definitions/gems/minitest.rb on lines 689..702
    lib/ruby-lint/definitions/gems/minitest.rb on lines 756..769
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4630..4643
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2758..2771
    lib/ruby-lint/definitions/rails/active_model.rb on lines 567..580
    lib/ruby-lint/definitions/rails/active_record.rb on lines 11491..11504
    lib/ruby-lint/definitions/rails/rails.rb on lines 2112..2125

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 31.

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('GLib::SignalMatchType') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Flags', RubyLint.registry))
    
        klass.define_instance_method('closure?')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 15 other locations - About 25 mins to fix
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 341..354
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 2338..2351
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 2354..2367
    lib/ruby-lint/definitions/core/syck.rb on lines 415..428
    lib/ruby-lint/definitions/gems/celluloid.rb on lines 1255..1268
    lib/ruby-lint/definitions/gems/celluloid.rb on lines 2511..2524
    lib/ruby-lint/definitions/gems/glib.rb on lines 1389..1402
    lib/ruby-lint/definitions/gems/gtk.rb on lines 14063..14076
    lib/ruby-lint/definitions/gems/minitest.rb on lines 689..702
    lib/ruby-lint/definitions/gems/minitest.rb on lines 756..769
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4630..4643
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2758..2771
    lib/ruby-lint/definitions/rails/active_model.rb on lines 567..580
    lib/ruby-lint/definitions/rails/active_record.rb on lines 11491..11504
    lib/ruby-lint/definitions/rails/rails.rb on lines 2112..2125

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 31.

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

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

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

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

    Refactorings

    Further Reading

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

      defs.define_constant('GLib::UCS4') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('to_utf16') do |method|
          method.define_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 53 other locations - About 25 mins to fix
    lib/ruby-lint/definitions/core/drb.rb on lines 137..145
    lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
    lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
    lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
    lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
    lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
    lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
    lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
    lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
    lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
    lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
    lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
    lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
    lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
    lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
    lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
    lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
    lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
    lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

      defs.define_constant('GLib::ChildWatch') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('add') do |method|
          method.define_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 53 other locations - About 25 mins to fix
    lib/ruby-lint/definitions/core/drb.rb on lines 137..145
    lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
    lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
    lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
    lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
    lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
    lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
    lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
    lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
    lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
    lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
    lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
    lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
    lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
    lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
    lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
    lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
    lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
    lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

      defs.define_constant('GLib::Pointer') do |klass|
        klass.inherits(defs.constant_proxy('Data', RubyLint.registry))
    
        klass.define_method('gtype') do |method|
          method.define_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 53 other locations - About 25 mins to fix
    lib/ruby-lint/definitions/core/drb.rb on lines 137..145
    lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
    lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
    lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
    lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
    lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
    lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
    lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
    lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
    lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
    lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
    lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
    lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
    lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
    lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
    lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
    lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
    lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
    lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

      defs.define_constant('GLib::Unicode') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('canonical_decomposition') do |method|
          method.define_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 53 other locations - About 25 mins to fix
    lib/ruby-lint/definitions/core/drb.rb on lines 137..145
    lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
    lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
    lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
    lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
    lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
    lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
    lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
    lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
    lib/ruby-lint/definitions/gems/glib.rb on lines 3894..3902
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
    lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
    lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
    lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
    lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
    lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
    lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
    lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
    lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
    lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

      defs.define_constant('GLib::UTF16') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('to_ucs4') do |method|
          method.define_argument('arg1')
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 53 other locations - About 25 mins to fix
    lib/ruby-lint/definitions/core/drb.rb on lines 137..145
    lib/ruby-lint/definitions/core/drb_id_conv.rb on lines 7..15
    lib/ruby-lint/definitions/core/gem.rb on lines 1023..1031
    lib/ruby-lint/definitions/core/resolv.rb on lines 518..526
    lib/ruby-lint/definitions/gems/devise.rb on lines 969..977
    lib/ruby-lint/definitions/gems/devise.rb on lines 1934..1942
    lib/ruby-lint/definitions/gems/glib.rb on lines 569..577
    lib/ruby-lint/definitions/gems/glib.rb on lines 2955..2963
    lib/ruby-lint/definitions/gems/glib.rb on lines 3837..3845
    lib/ruby-lint/definitions/gems/glib.rb on lines 4075..4083
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 446..454
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 6118..6126
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 846..854
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4040..4048
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4060..4068
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4085..4093
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4115..4123
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4175..4183
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4277..4285
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4299..4307
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4330..4338
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4372..4380
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4390..4398
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 4433..4441
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5497..5505
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5517..5525
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5566..5574
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5578..5586
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5598..5606
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5937..5945
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 5988..5996
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 6422..6430
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7970..7978
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 7982..7990
    lib/ruby-lint/definitions/gems/rspec.rb on lines 5359..5367
    lib/ruby-lint/definitions/gems/tree.rb on lines 198..206
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 1855..1863
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2721..2729
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 2941..2949
    lib/ruby-lint/definitions/rails/action_controller.rb on lines 3264..3272
    lib/ruby-lint/definitions/rails/action_mailer.rb on lines 1106..1114
    lib/ruby-lint/definitions/rails/action_view.rb on lines 3663..3671
    lib/ruby-lint/definitions/rails/active_model.rb on lines 293..301
    lib/ruby-lint/definitions/rails/active_model.rb on lines 328..336
    lib/ruby-lint/definitions/rails/active_record.rb on lines 707..715
    lib/ruby-lint/definitions/rails/active_record.rb on lines 3139..3147
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6170..6178
    lib/ruby-lint/definitions/rails/active_record.rb on lines 7433..7441
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1411..1419
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1488..1496
    lib/ruby-lint/definitions/rails/active_support.rb on lines 3147..3155
    lib/ruby-lint/definitions/rails/active_support.rb on lines 4307..4315
    lib/ruby-lint/definitions/rails/arel.rb on lines 7256..7264

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

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

      defs.define_constant('GLib::Timer') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Boxed', RubyLint.registry))
    
        klass.define_instance_method('continue')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 19 other locations - About 20 mins to fix
    lib/ruby-lint/definitions/core/encoding.rb on lines 1098..1109
    lib/ruby-lint/definitions/core/encoding.rb on lines 1217..1228
    lib/ruby-lint/definitions/core/json.rb on lines 288..299
    lib/ruby-lint/definitions/core/json.rb on lines 414..425
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 1929..1940
    lib/ruby-lint/definitions/core/open_ssl.rb on lines 2324..2335
    lib/ruby-lint/definitions/core/syck.rb on lines 252..263
    lib/ruby-lint/definitions/core/syck.rb on lines 637..648
    lib/ruby-lint/definitions/gems/gtk.rb on lines 3245..3256
    lib/ruby-lint/definitions/gems/gtk.rb on lines 8902..8913
    lib/ruby-lint/definitions/gems/lib_xml.rb on lines 432..443
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 622..633
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 2253..2264
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 3117..3128
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 710..721
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2376..2387
    lib/ruby-lint/definitions/rails/active_model.rb on lines 340..351
    lib/ruby-lint/definitions/rails/active_record.rb on lines 5723..5734
    lib/ruby-lint/definitions/rails/arel.rb on lines 6144..6155

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

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

      defs.define_constant('GLib::IOChannelError') do |klass|
        klass.inherits(defs.constant_proxy('IOError', RubyLint.registry))
        klass.inherits(defs.constant_proxy('GLib::ErrorInfo', RubyLint.registry))
    
        klass.define_method('from_errno') do |method|
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.rb and 6 other locations - About 20 mins to fix
    lib/ruby-lint/definitions/core/option_parser.rb on lines 314..319
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 641..646
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 650..655
    lib/ruby-lint/definitions/rails/active_record.rb on lines 645..650
    lib/ruby-lint/definitions/rails/active_record.rb on lines 2528..2533
    lib/ruby-lint/definitions/rails/active_record.rb on lines 10178..10183

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

    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('GLib::MainLoop') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Boxed', RubyLint.registry))
    
        klass.define_instance_method('context')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.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 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/gems/sinatra.rb on lines 1347..1356
    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

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

      defs.define_constant('GLib::Param::Char::Float') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Param', RubyLint.registry))
    
        klass.define_instance_method('epsilon')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.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 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/gems/sinatra.rb on lines 1347..1356
    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

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

      defs.define_constant('GLib::Param::Char::Double') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Param', RubyLint.registry))
    
        klass.define_instance_method('epsilon')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.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 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/gems/sinatra.rb on lines 1347..1356
    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

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

      defs.define_constant('GLib::Param::Double') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Param', RubyLint.registry))
    
        klass.define_instance_method('epsilon')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.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 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/gems/sinatra.rb on lines 1347..1356
    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

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

      defs.define_constant('GLib::Boxed') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('gtype')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.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 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/gems/sinatra.rb on lines 1347..1356
    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

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

      defs.define_constant('GLib::Param::Float') do |klass|
        klass.inherits(defs.constant_proxy('GLib::Param', RubyLint.registry))
    
        klass.define_instance_method('epsilon')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/gems/glib.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/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/gems/sinatra.rb on lines 1347..1356
    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