YorickPeterse/ruby-lint

View on GitHub
lib/ruby-lint/definitions/core/resolv.rb

Summary

Maintainability
F
5 days
Test Coverage

File resolv.rb has 945 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    klass.define_method('each_address') do |method|
Severity: Major
Found in lib/ruby-lint/definitions/core/resolv.rb - About 2 days to fix

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

      defs.define_constant('Resolv::DNS::Resource::SOA') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 2 hrs to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 1049..1084

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

    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('Resolv::DNS::Resource::HINFO::SOA') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 2 hrs to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 1176..1211

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

    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('Resolv::IPv6') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('create') do |method|
          method.define_argument('arg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 1290..1319

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

    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('Resolv::IPv4') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('create') do |method|
          method.define_argument('arg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 1332..1361

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

    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('Resolv::DNS::Requester::ConnectedUDP') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Requester', RubyLint.registry))
    
        klass.define_instance_method('close')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 685..705
    lib/ruby-lint/definitions/core/resolv.rb on lines 749..769

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

    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('Resolv::DNS::Requester::ConnectedUDP::TCP') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Requester', RubyLint.registry))
    
        klass.define_instance_method('close')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 648..668
    lib/ruby-lint/definitions/core/resolv.rb on lines 749..769

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

    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('Resolv::DNS::Requester::TCP') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Requester', RubyLint.registry))
    
        klass.define_instance_method('close')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 648..668
    lib/ruby-lint/definitions/core/resolv.rb on lines 685..705

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

    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('Resolv::DNS::Resource::Generic') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('create') do |method|
          method.define_argument('type_value')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 963..984

    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('Resolv::DNS::Resource::HINFO::Generic') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('create') do |method|
          method.define_argument('type_value')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 870..891

    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('Resolv::DNS::Requester::ConnectedUDP::UnconnectedUDP') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Requester', RubyLint.registry))
    
        klass.define_instance_method('close')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 773..792

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

    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('Resolv::DNS::Requester::UnconnectedUDP') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Requester', RubyLint.registry))
    
        klass.define_instance_method('close')
    
    
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 709..728

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

    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('Resolv::DNS::Resource::TXT') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 5 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 895..915
    lib/ruby-lint/definitions/core/resolv.rb on lines 993..1013
    lib/ruby-lint/definitions/core/resolv.rb on lines 1087..1107
    lib/ruby-lint/definitions/core/resolv.rb on lines 1120..1140
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1272..1292

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

    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('Resolv::DNS::Resource::HINFO::MINFO') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 5 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 895..915
    lib/ruby-lint/definitions/core/resolv.rb on lines 1087..1107
    lib/ruby-lint/definitions/core/resolv.rb on lines 1120..1140
    lib/ruby-lint/definitions/core/resolv.rb on lines 1214..1234
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1272..1292

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

    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('Resolv::DNS::Resource::HINFO') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 5 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 993..1013
    lib/ruby-lint/definitions/core/resolv.rb on lines 1087..1107
    lib/ruby-lint/definitions/core/resolv.rb on lines 1120..1140
    lib/ruby-lint/definitions/core/resolv.rb on lines 1214..1234
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1272..1292

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

    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('Resolv::DNS::Resource::HINFO::TXT') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 5 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 895..915
    lib/ruby-lint/definitions/core/resolv.rb on lines 993..1013
    lib/ruby-lint/definitions/core/resolv.rb on lines 1120..1140
    lib/ruby-lint/definitions/core/resolv.rb on lines 1214..1234
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1272..1292

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

    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('Resolv::DNS::Resource::MINFO') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 5 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 895..915
    lib/ruby-lint/definitions/core/resolv.rb on lines 993..1013
    lib/ruby-lint/definitions/core/resolv.rb on lines 1087..1107
    lib/ruby-lint/definitions/core/resolv.rb on lines 1214..1234
    lib/ruby-lint/definitions/rails/action_dispatch.rb on lines 1272..1292

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

    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('Resolv::DNS::Resource::MX') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 1016..1036

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

    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('Resolv::DNS::Resource::HINFO::MX') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 1 other location - About 1 hr to fix
    lib/ruby-lint/definitions/core/resolv.rb on lines 1143..1163

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

    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('Resolv::DNS::Resource::DomainName') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/drb.rb on lines 545..562
    lib/ruby-lint/definitions/core/resolv.rb on lines 943..960

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

    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('Resolv::DNS::Resource::HINFO::DomainName') do |klass|
        klass.inherits(defs.constant_proxy('Resolv::DNS::Resource', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 1 hr to fix
    lib/ruby-lint/definitions/core/drb.rb on lines 545..562
    lib/ruby-lint/definitions/core/resolv.rb on lines 850..867

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

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

      defs.define_constant('Resolv::DNS::Requester::Sender') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('initialize') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.rb and 9 other locations - About 35 mins to fix
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 3499..3507
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 3516..3524
    lib/ruby-lint/definitions/gems/mongoid.rb on lines 3564..3572
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2262..2270
    lib/ruby-lint/definitions/rails/active_record.rb on lines 5950..5958
    lib/ruby-lint/definitions/rails/active_record.rb on lines 5962..5970
    lib/ruby-lint/definitions/rails/active_record.rb on lines 6039..6047
    lib/ruby-lint/definitions/rails/active_support.rb on lines 1455..1463
    lib/ruby-lint/definitions/rails/arel.rb on lines 2095..2103

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

      defs.define_constant('Resolv::DNS::Requester') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_instance_method('close')
    
    
    Severity: Minor
    Found in lib/ruby-lint/definitions/core/resolv.rb and 2 other locations - About 25 mins to fix
    lib/ruby-lint/definitions/gems/nokogiri.rb on lines 935..944
    lib/ruby-lint/definitions/rails/sprockets.rb on lines 1664..1673

    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('Resolv::DNS::Query') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
    
        klass.define_method('decode_rdata') do |method|
          method.define_argument('msg')
    Severity: Major
    Found in lib/ruby-lint/definitions/core/resolv.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/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/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

    There are no issues that match your filters.

    Category
    Status