rubinius/rubinius

View on GitHub
core/array.rb

Summary

Maintainability
F
3 wks
Test Coverage

File array.rb has 1666 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Array
  include Enumerable

  def self.allocate
    Rubinius.primitive :array_allocate
Severity: Major
Found in core/array.rb - About 4 days to fix

    Class Array has 105 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Array
      include Enumerable
    
      def self.allocate
        Rubinius.primitive :array_allocate
    Severity: Major
    Found in core/array.rb - About 2 days to fix

      Method set_index has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
      Open

        def set_index(index, ent, fin=undefined)
          Rubinius.primitive :array_aset
      
          Rubinius.check_frozen
      
      
      Severity: Minor
      Found in core/array.rb - About 1 day 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 sample has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

        def sample(count=undefined, options=undefined)
          return at Kernel.rand(size) if undefined.equal? count
      
          if undefined.equal? options
            if o = Rubinius::Type.check_convert_type(count, Hash, :to_hash)
      Severity: Minor
      Found in core/array.rb - About 1 day 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 slice! has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

        def slice!(start, length=undefined)
          Rubinius.check_frozen
      
          if undefined.equal? length
            if start.kind_of? Range
      Severity: Minor
      Found in core/array.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 fill has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
      Open

        def fill(a=undefined, b=undefined, c=undefined)
          Rubinius.check_frozen
      
          if block_given?
            unless undefined.equal?(c)
      Severity: Minor
      Found in core/array.rb - About 6 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 [] has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

        def [](arg1, arg2=nil)
          case arg1
      
          # This is split out from the generic case and put first because
          # it is by far the most common case and we want to deal with it
      Severity: Minor
      Found in core/array.rb - About 6 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 set_index has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def set_index(index, ent, fin=undefined)
          Rubinius.primitive :array_aset
      
          Rubinius.check_frozen
      
      
      Severity: Major
      Found in core/array.rb - About 3 hrs to fix

        Method join has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

          def join(sep=nil)
            return "".force_encoding(Encoding::US_ASCII) if @total == 0
        
            out = ""
            raise ArgumentError, "recursive array join" if Thread.detect_recursion self do
        Severity: Minor
        Found in core/array.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 sample has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def sample(count=undefined, options=undefined)
            return at Kernel.rand(size) if undefined.equal? count
        
            if undefined.equal? options
              if o = Rubinius::Type.check_convert_type(count, Hash, :to_hash)
        Severity: Major
        Found in core/array.rb - About 2 hrs to fix

          Method values_at has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

            def values_at(*args)
              out = []
          
              args.each do |elem|
                # Cannot use #[] because of subtly different errors
          Severity: Minor
          Found in core/array.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 fill has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def fill(a=undefined, b=undefined, c=undefined)
              Rubinius.check_frozen
          
              if block_given?
                unless undefined.equal?(c)
          Severity: Major
          Found in core/array.rb - About 2 hrs to fix

            Method rindex has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

              def rindex(obj=undefined)
                if undefined.equal?(obj)
                  return to_enum(:rindex, obj) unless block_given?
            
                  i = @total - 1
            Severity: Minor
            Found in core/array.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 recursively_flatten has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

              def recursively_flatten(array, out, max_levels = -1)
                modified = false
            
                # Strict equality since < 0 means 'infinite'
                if max_levels == 0
            Severity: Minor
            Found in core/array.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 mergesort! has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

              def mergesort!
                width = 7
                @scratch = Rubinius::Tuple.new @tuple.size
            
                # do a pre-loop to create a bunch of short sorted runs; isort on these
            Severity: Minor
            Found in core/array.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 mergesort_block! has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

              def mergesort_block!(block)
                width = 7
                @scratch = Rubinius::Tuple.new @tuple.size
            
                left = @start
            Severity: Minor
            Found in core/array.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 initialize has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              def initialize(size_or_array=undefined, obj=undefined)
                Rubinius.check_frozen
            
                if undefined.equal?(size_or_array)
                  unless @total == 0
            Severity: Minor
            Found in core/array.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 slice! has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def slice!(start, length=undefined)
                Rubinius.check_frozen
            
                if undefined.equal? length
                  if start.kind_of? Range
            Severity: Major
            Found in core/array.rb - About 2 hrs to fix

              Method [] has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def [](arg1, arg2=nil)
                  case arg1
              
                  # This is split out from the generic case and put first because
                  # it is by far the most common case and we want to deal with it
              Severity: Minor
              Found in core/array.rb - About 1 hr to fix

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

                  def ==(other)
                    return true if equal?(other)
                
                    unless other.kind_of?(Array)
                      return false unless other.respond_to?(:to_ary)
                Severity: Minor
                Found in core/array.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 bsearch_index has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def bsearch_index
                    return to_enum :bsearch_index unless block_given?
                
                    m = Rubinius::Mirror::Array.reflect self
                
                
                Severity: Minor
                Found in core/array.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 initialize has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def initialize(size_or_array=undefined, obj=undefined)
                    Rubinius.check_frozen
                
                    if undefined.equal?(size_or_array)
                      unless @total == 0
                Severity: Minor
                Found in core/array.rb - About 1 hr to fix

                  Method combination has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def combination(num)
                      num = Rubinius::Type.coerce_to_collection_index num
                  
                      unless block_given?
                        return to_enum(:combination, num) do
                  Severity: Minor
                  Found in core/array.rb - About 1 hr to fix

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

                      def isort!(left, right)
                        i = left + 1
                    
                        tup = @tuple
                    
                    
                    Severity: Minor
                    Found in core/array.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 combination has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def combination(num)
                        num = Rubinius::Type.coerce_to_collection_index num
                    
                        unless block_given?
                          return to_enum(:combination, num) do
                    Severity: Minor
                    Found in core/array.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 permutation has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def permutation(num=undefined, &block)
                        unless block_given?
                          return to_enum(:permutation, num) do
                            Rubinius::Mirror::Array.reflect(self).permutation_size(num)
                          end
                    Severity: Minor
                    Found in core/array.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 recursively_flatten has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def recursively_flatten(array, out, max_levels = -1)
                        modified = false
                    
                        # Strict equality since < 0 means 'infinite'
                        if max_levels == 0
                    Severity: Minor
                    Found in core/array.rb - About 1 hr to fix

                      Method * has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def *(multiplier)
                          if multiplier.respond_to? :to_str
                            return join(multiplier)
                      
                          else
                      Severity: Minor
                      Found in core/array.rb - About 1 hr to fix

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

                          def <=>(other)
                            other = Rubinius::Type.check_convert_type other, Array, :to_ary
                            return 0 if equal? other
                            return nil if other.nil?
                        
                        
                        Severity: Minor
                        Found in core/array.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 zip has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def zip(*others)
                            out = Array.new(size) { [] }
                            others = others.map do |other|
                              if other.respond_to?(:to_ary)
                                other.to_ary
                        Severity: Minor
                        Found in core/array.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 pop has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def pop(many=undefined)
                            Rubinius.check_frozen
                        
                            if undefined.equal?(many)
                              return nil if @total == 0
                        Severity: Minor
                        Found in core/array.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 join has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def join(sep=nil)
                            return "".force_encoding(Encoding::US_ASCII) if @total == 0
                        
                            out = ""
                            raise ArgumentError, "recursive array join" if Thread.detect_recursion self do
                        Severity: Minor
                        Found in core/array.rb - About 1 hr to fix

                          Method bsearch_index has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def bsearch_index
                              return to_enum :bsearch_index unless block_given?
                          
                              m = Rubinius::Mirror::Array.reflect self
                          
                          
                          Severity: Minor
                          Found in core/array.rb - About 1 hr to fix

                            Method zip has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def zip(*others)
                                out = Array.new(size) { [] }
                                others = others.map do |other|
                                  if other.respond_to?(:to_ary)
                                    other.to_ary
                            Severity: Minor
                            Found in core/array.rb - About 1 hr to fix

                              Method mergesort_block! has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def mergesort_block!(block)
                                  width = 7
                                  @scratch = Rubinius::Tuple.new @tuple.size
                              
                                  left = @start
                              Severity: Minor
                              Found in core/array.rb - About 1 hr to fix

                                Method mergesort! has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def mergesort!
                                    width = 7
                                    @scratch = Rubinius::Tuple.new @tuple.size
                                
                                    # do a pre-loop to create a bunch of short sorted runs; isort on these
                                Severity: Minor
                                Found in core/array.rb - About 1 hr to fix

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

                                    def hash
                                      hash_val = size
                                      mask = Fixnum::MAX >> 1
                                  
                                      # This is duplicated and manually inlined code from Thread for performance
                                  Severity: Minor
                                  Found in core/array.rb - About 1 hr to fix

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

                                      def permutation(num=undefined, &block)
                                        unless block_given?
                                          return to_enum(:permutation, num) do
                                            Rubinius::Mirror::Array.reflect(self).permutation_size(num)
                                          end
                                    Severity: Minor
                                    Found in core/array.rb - About 1 hr to fix

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

                                        def count(item = undefined)
                                          seq = 0
                                          if !undefined.equal?(item)
                                            each { |o| seq += 1 if item == o }
                                          elsif block_given?
                                      Severity: Minor
                                      Found in core/array.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 isort_block! has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def isort_block!(left, right, block)
                                          i = left + 1
                                      
                                          while i < right
                                            j = i
                                      Severity: Minor
                                      Found in core/array.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 delete_range has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def delete_range(index, del_length)
                                          # optimize for fast removal..
                                          reg_start = index + del_length
                                          reg_length = @total - reg_start
                                      
                                      
                                      Severity: Minor
                                      Found in core/array.rb - About 45 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 __permute__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def __permute__(num, perm, index, used, &block)
                                          # Recursively compute permutations of r elements of the set [0..n-1].
                                          # When we have a complete permutation of array indexes, copy the values
                                          # at those indexes into a new array and yield that array.
                                          #
                                      Severity: Minor
                                      Found in core/array.rb - About 45 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 eql? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def eql?(other)
                                          return true if equal? other
                                          return false unless other.kind_of?(Array)
                                          return false if @total != other.size
                                      
                                      
                                      Severity: Minor
                                      Found in core/array.rb - About 45 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 fetch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def fetch(idx, default=undefined)
                                          orig = idx
                                          idx = Rubinius::Type.coerce_to_collection_index idx
                                      
                                          idx += @total if idx < 0
                                      Severity: Minor
                                      Found in core/array.rb - About 45 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 sort_inplace has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        def sort_inplace(&block)
                                          Rubinius.check_frozen
                                      
                                          return self unless @total > 1
                                      
                                      
                                      Severity: Minor
                                      Found in core/array.rb - About 45 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

                                      Avoid deeply nested control flow statements.
                                      Open

                                                  if k == result[j]
                                                    abandon = true
                                                    break
                                                  end
                                      Severity: Major
                                      Found in core/array.rb - About 45 mins to fix

                                        Method * has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          def *(multiplier)
                                            if multiplier.respond_to? :to_str
                                              return join(multiplier)
                                        
                                            else
                                        Severity: Minor
                                        Found in core/array.rb - About 45 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 __permute__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                          def __permute__(num, perm, index, used, &block)
                                        Severity: Minor
                                        Found in core/array.rb - About 35 mins to fix

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

                                            def compile_repeated_combinations(combination_size, place, index, depth, &block)
                                          Severity: Minor
                                          Found in core/array.rb - About 35 mins to fix

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

                                              def shuffle!(options = undefined)
                                                Rubinius.check_frozen
                                            
                                                random_generator = Kernel
                                            
                                            
                                            Severity: Minor
                                            Found in core/array.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 cycle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                              def cycle(n=nil)
                                                unless block_given?
                                                  return to_enum(:cycle, n) do
                                                    Rubinius::EnumerableHelper.cycle_size(size, n)
                                                  end
                                            Severity: Minor
                                            Found in core/array.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 delete_if has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                              def delete_if
                                                return to_enum(:delete_if) { size } unless block_given?
                                            
                                                Rubinius.check_frozen
                                            
                                            
                                            Severity: Minor
                                            Found in core/array.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

                                            Avoid too many return statements within this method.
                                            Open

                                                  return new_range(0, 0) if right_idx < start_idx
                                            Severity: Major
                                            Found in core/array.rb - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                    return nil
                                              Severity: Major
                                              Found in core/array.rb - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                    return nil if count < 0
                                                Severity: Major
                                                Found in core/array.rb - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                          return nil if start_idx >= @total
                                                  Severity: Major
                                                  Found in core/array.rb - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                        return new_range(@start + start_idx, count)
                                                    Severity: Major
                                                    Found in core/array.rb - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                return @tuple.at(@start + start_idx)
                                                      Severity: Major
                                                      Found in core/array.rb - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                              return new_range(0, 0) if start_idx == @total
                                                        Severity: Major
                                                        Found in core/array.rb - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                              return nil if start_idx < 0
                                                          Severity: Major
                                                          Found in core/array.rb - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                      return nil
                                                            Severity: Major
                                                            Found in core/array.rb - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                      return false unless self_tuple[self_idx] == other_tuple[other_idx]
                                                              Severity: Major
                                                              Found in core/array.rb - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                      return count == size ? result : result[0, count]
                                                                Severity: Major
                                                                Found in core/array.rb - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                            return result
                                                                  Severity: Major
                                                                  Found in core/array.rb - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                          return [at(i), at(j)]
                                                                    Severity: Major
                                                                    Found in core/array.rb - About 30 mins to fix

                                                                      Method bottom_up_merge_block has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                        def bottom_up_merge_block(left, right, last, block)
                                                                          left_index = left
                                                                          right_index = right
                                                                          i = left
                                                                      
                                                                      
                                                                      Severity: Minor
                                                                      Found in core/array.rb - About 25 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 shift has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                        def shift(n=undefined)
                                                                          Rubinius.check_frozen
                                                                      
                                                                          if undefined.equal?(n)
                                                                            return nil if @total == 0
                                                                      Severity: Minor
                                                                      Found in core/array.rb - About 25 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 delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                        def delete(obj)
                                                                          key = undefined
                                                                          i = @start
                                                                          total = i + @total
                                                                          tuple = @tuple
                                                                      Severity: Minor
                                                                      Found in core/array.rb - About 25 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 hash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                        def hash
                                                                          hash_val = size
                                                                          mask = Fixnum::MAX >> 1
                                                                      
                                                                          # This is duplicated and manually inlined code from Thread for performance
                                                                      Severity: Minor
                                                                      Found in core/array.rb - About 25 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 inspect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                        def inspect
                                                                          return "[]".force_encoding(Encoding::US_ASCII) if @total == 0
                                                                          comma = ", "
                                                                          result = "["
                                                                      
                                                                      
                                                                      Severity: Minor
                                                                      Found in core/array.rb - About 25 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 bottom_up_merge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                        def bottom_up_merge(left, right, last)
                                                                          left_index = left
                                                                          right_index = right
                                                                          i = left
                                                                      
                                                                      
                                                                      Severity: Minor
                                                                      Found in core/array.rb - About 25 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

                                                                        def dig(index, *remaining_indeces)
                                                                          item = self[index]
                                                                          return item if remaining_indeces.empty? || item.nil?
                                                                      
                                                                          raise TypeError, "#{item.class} does not have #dig method" unless item.respond_to?(:dig)
                                                                      Severity: Minor
                                                                      Found in core/array.rb and 1 other location - About 25 mins to fix
                                                                      core/hash.rb on lines 544..550

                                                                      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

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

                                                                            if arg2
                                                                              count = Rubinius::Type.coerce_to_collection_index arg2
                                                                            else
                                                                              return nil if start_idx >= @total
                                                                      
                                                                      
                                                                      Severity: Minor
                                                                      Found in core/array.rb and 1 other location - About 20 mins to fix
                                                                      core/array.rb on lines 272..284

                                                                      Duplicated Code

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

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

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

                                                                      Tuning

                                                                      This issue has a mass of 27.

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

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

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

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

                                                                      Refactorings

                                                                      Further Reading

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

                                                                            if arg2
                                                                              count = Rubinius::Type.coerce_to_collection_index arg2
                                                                            else
                                                                              return nil if start_idx >= @total
                                                                      
                                                                      
                                                                      Severity: Minor
                                                                      Found in core/array.rb and 1 other location - About 20 mins to fix
                                                                      core/array.rb on lines 233..245

                                                                      Duplicated Code

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

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

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

                                                                      Tuning

                                                                      This issue has a mass of 27.

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

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

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

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

                                                                      Refactorings

                                                                      Further Reading

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

                                                                        def &(other)
                                                                          other = Rubinius::Type.coerce_to other, Array, :to_ary
                                                                      
                                                                          array = []
                                                                          im = Rubinius::IdentityMap.from other
                                                                      Severity: Minor
                                                                      Found in core/array.rb and 1 other location - About 20 mins to fix
                                                                      core/array.rb on lines 387..395

                                                                      Duplicated Code

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

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

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

                                                                      Tuning

                                                                      This issue has a mass of 27.

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

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

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

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

                                                                      Refactorings

                                                                      Further Reading

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

                                                                        def -(other)
                                                                          other = Rubinius::Type.coerce_to other, Array, :to_ary
                                                                      
                                                                          array = []
                                                                          im = Rubinius::IdentityMap.from other
                                                                      Severity: Minor
                                                                      Found in core/array.rb and 1 other location - About 20 mins to fix
                                                                      core/array.rb on lines 364..372

                                                                      Duplicated Code

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

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

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

                                                                      Tuning

                                                                      This issue has a mass of 27.

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

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

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

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

                                                                      Refactorings

                                                                      Further Reading

                                                                      There are no issues that match your filters.

                                                                      Category
                                                                      Status