rubygems/rubygems

View on GitHub
lib/rubygems/vendor/resolv/lib/resolv.rb

Summary

Maintainability
F
1 wk
Test Coverage

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

require 'socket'
require_relative '../../timeout/lib/timeout'
require 'io/wait'

begin
Severity: Major
Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 6 days to fix

    Method lazy_initialize has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

          def lazy_initialize
            @mutex.synchronize {
              unless @initialized
                @nameserver_port = []
                @use_ipv6 = nil
    Severity: Minor
    Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 7 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method request has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

          def request(sender, tout)
            start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
            timelimit = start + tout
            begin
              sender.send
    Severity: Minor
    Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method parse_resolv_conf has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

          def Config.parse_resolv_conf(filename)
            nameserver = []
            search = nil
            ndots = 1
            File.open(filename, 'rb') {|f|
    Severity: Minor
    Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Class DNS has 25 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class DNS
    
        ##
        # Default DNS Port
    
    
    Severity: Minor
    Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 2 hrs to fix

      Method lazy_initialize has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def lazy_initialize
              @mutex.synchronize {
                unless @initialized
                  @nameserver_port = []
                  @use_ipv6 = nil
      Severity: Major
      Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 2 hrs to fix

        Method fetch_resource has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def fetch_resource(name, typeclass)
              lazy_initialize
              begin
                requester = make_udp_requester
              rescue Errno::EACCES
        Severity: Minor
        Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method create has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def self.create(arg)
              case arg
              when IPv6
                return arg
              when String
        Severity: Minor
        Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method lazy_initialize has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                def lazy_initialize
                  @mutex.synchronize {
                    next if @initialized
                    @initialized = true
                    @socks_hash = {}
        Severity: Minor
        Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method extract_resources has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def extract_resources(msg, name, typeclass) # :nodoc:
              if typeclass < Resource::ANY
                n0 = Name.create(name)
                msg.each_resource {|n, ttl, data|
                  yield data if n0 == n
        Severity: Minor
        Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method get_labels has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

                def get_labels
                  prev_index = @index
                  save_index = nil
                  d = []
                  while true
        Severity: Minor
        Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method create has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

              def self.create(arg)
                case arg
                when Coord
                  return arg
                when String
        Severity: Minor
        Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method create has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def self.create(arg)
              case arg
              when IPv6
                return arg
              when String
        Severity: Minor
        Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

          Method request has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def request(sender, tout)
                  start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
                  timelimit = start + tout
                  begin
                    sender.send
          Severity: Minor
          Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

            Method fetch_resource has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def fetch_resource(name, typeclass)
                  lazy_initialize
                  begin
                    requester = make_udp_requester
                  rescue Errno::EACCES
            Severity: Minor
            Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

              Method lazy_initialize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  def lazy_initialize # :nodoc:
                    @mutex.synchronize {
                      unless @initialized
                        @name2addr = {}
                        @addr2name = {}
              Severity: Minor
              Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method resolv has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                    def resolv(name)
                      candidates = generate_candidates(name)
                      timeouts = @timeouts || generate_timeouts
                      timeout_error = false
                      begin
              Severity: Minor
              Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method decode has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def Message.decode(m)
                      o = Message.new(0)
                      MessageDecoder.new(m) {|msg|
                        id, flag, qdcount, ancount, nscount, arcount =
                          msg.get_unpack('nnnnnn')
              Severity: Minor
              Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

                Method encode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def encode
                        return MessageEncoder.new {|msg|
                          msg.put_pack('nnnnnn',
                            @id,
                            (@qr & 1) << 15 |
                Severity: Minor
                Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

                  Method extract_resources has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def extract_resources(msg, name, typeclass) # :nodoc:
                        if typeclass < Resource::ANY
                          n0 = Name.create(name)
                          msg.each_resource {|n, ttl, data|
                            yield data if n0 == n
                  Severity: Minor
                  Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

                    Method parse_resolv_conf has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def Config.parse_resolv_conf(filename)
                            nameserver = []
                            search = nil
                            ndots = 1
                            File.open(filename, 'rb') {|f|
                    Severity: Minor
                    Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

                      Method get_labels has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              def get_labels
                                prev_index = @index
                                save_index = nil
                                d = []
                                while true
                      Severity: Minor
                      Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

                        Method lazy_initialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def lazy_initialize
                                  @mutex.synchronize {
                                    next if @initialized
                                    @initialized = true
                                    @socks_hash = {}
                        Severity: Minor
                        Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 1 hr to fix

                          Method lazy_initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def lazy_initialize
                                    @mutex.synchronize {
                                      next if @initialized
                                      @initialized = true
                                      is_ipv6 = @host.index(':')
                          Severity: Minor
                          Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  def initialize(version, ssize, hprecision, vprecision, latitude, longitude, altitude)
                          Severity: Major
                          Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 50 mins to fix

                            Method initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    def initialize(mname, rname, serial, refresh, retry_, expire, minimum)
                            Severity: Major
                            Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 50 mins to fix

                              Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                        def initialize(msg, data, sock, host, port)
                              Severity: Minor
                              Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 35 mins to fix

                                Method to_s has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                      def to_s # :nodoc:
                                          c = @coordinates.unpack("N").join.to_i
                                          val      = (c - (2**31)).abs
                                          fracsecs = (val % 1e3).to_i.to_s
                                          val      = val / 1e3
                                Severity: Minor
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 35 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method generate_candidates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                      def generate_candidates(name)
                                        candidates = nil
                                        name = Name.create(name)
                                        if name.absolute?
                                          candidates = [name]
                                Severity: Minor
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 35 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method put_labels has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def put_labels(d, compress: true)
                                          d.each_index {|i|
                                            domain = d[i..-1]
                                            if compress && idx = @names[domain]
                                              self.put_pack("n", 0xc000 | idx)
                                Severity: Minor
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 35 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method default_config_hash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                      def Config.default_config_hash(filename="/etc/resolv.conf")
                                        if File.exist? filename
                                          config_hash = Config.parse_resolv_conf(filename)
                                        else
                                          if /mswin|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
                                Severity: Minor
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb - About 35 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

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

                                        return @id == other.id &&
                                               @qr == other.qr &&
                                               @opcode == other.opcode &&
                                               @aa == other.aa &&
                                               @tc == other.tc &&
                                Severity: Major
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb and 1 other location - About 1 hr to fix
                                lib/rubygems/package/tar_header.rb on lines 204..216

                                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

                                      class IPv6Hint < SvcParam
                                        KeyName = :ipv6hint
                                        KeyNumber = 6
                                        ClassHash[KeyName] = ClassHash[KeyNumber] = self # :nodoc:
                                
                                
                                Severity: Major
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb and 1 other location - About 1 hr to fix
                                lib/rubygems/vendor/resolv/lib/resolv.rb on lines 1983..2008

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

                                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

                                      class IPv4Hint < SvcParam
                                        KeyName = :ipv4hint
                                        KeyNumber = 4
                                        ClassHash[KeyName] = ClassHash[KeyNumber] = self # :nodoc:
                                
                                
                                Severity: Major
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb and 1 other location - About 1 hr to fix
                                lib/rubygems/vendor/resolv/lib/resolv.rb on lines 2015..2040

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

                                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

                                        class A < Resource
                                          TypeValue = 1
                                          ClassValue = IN::ClassValue
                                          ClassHash[[TypeValue, ClassValue]] = self # :nodoc:
                                
                                
                                Severity: Minor
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb and 1 other location - About 40 mins to fix
                                lib/rubygems/vendor/resolv/lib/resolv.rb on lines 2701..2723

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

                                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

                                        class AAAA < Resource
                                          TypeValue = 28
                                          ClassValue = IN::ClassValue
                                          ClassHash[[TypeValue, ClassValue]] = self # :nodoc:
                                
                                
                                Severity: Minor
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb and 1 other location - About 40 mins to fix
                                lib/rubygems/vendor/resolv/lib/resolv.rb on lines 2624..2646

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

                                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

                                      class HINFO < Resource
                                
                                        TypeValue = 13 # :nodoc:
                                
                                        ##
                                Severity: Minor
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb and 1 other location - About 35 mins to fix
                                lib/rubygems/vendor/resolv/lib/resolv.rb on lines 2340..2367

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 36.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      class MINFO < Resource
                                
                                        TypeValue = 14 # :nodoc:
                                
                                        def initialize(rmailbx, emailbx)
                                Severity: Minor
                                Found in lib/rubygems/vendor/resolv/lib/resolv.rb and 1 other location - About 35 mins to fix
                                lib/rubygems/vendor/resolv/lib/resolv.rb on lines 2303..2333

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 36.

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

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

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

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

                                Refactorings

                                Further Reading

                                There are no issues that match your filters.

                                Category
                                Status