rubinius/rubinius

View on GitHub
core/tuple.rb

Summary

Maintainability
D
1 day
Test Coverage

Class Tuple has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Tuple
    include Enumerable

    def self.new(cnt)
      Rubinius.primitive :tuple_allocate
Severity: Minor
Found in core/tuple.rb - About 3 hrs to fix

    File tuple.rb has 269 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Rubinius
      class Tuple
        include Enumerable
    
        def self.new(cnt)
    Severity: Minor
    Found in core/tuple.rb - About 2 hrs to fix

      Method delete has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def delete(start, length, object)
            Rubinius.primitive :tuple_delete_inplace
      
            start = Rubinius::Type.coerce_to start, Fixnum, :to_i
            length = Rubinius::Type.coerce_to length, Fixnum, :to_i
      Severity: Minor
      Found in core/tuple.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 delete has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def delete(start, length, object)
            Rubinius.primitive :tuple_delete_inplace
      
            start = Rubinius::Type.coerce_to start, Fixnum, :to_i
            length = Rubinius::Type.coerce_to length, Fixnum, :to_i
      Severity: Minor
      Found in core/tuple.rb - About 1 hr to fix

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

            def copy_from(other, start, length, dest)
              Rubinius.primitive :tuple_copy_from
        
              unless other.kind_of? Rubinius::Tuple
                raise TypeError, "Tuple#copy_from was expecting a Tuple, not a #{other.class}"
        Severity: Minor
        Found in core/tuple.rb - About 1 hr to fix

          Method copy_from has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def copy_from(other, start, length, dest)
                Rubinius.primitive :tuple_copy_from
          
                unless other.kind_of? Rubinius::Tuple
                  raise TypeError, "Tuple#copy_from was expecting a Tuple, not a #{other.class}"
          Severity: Minor
          Found in core/tuple.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 == has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def ==(tup)
                return super unless tup.kind_of?(Tuple)
          
                t = fields()
          
          
          Severity: Minor
          Found in core/tuple.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 === has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def ===(other)
                return false unless Tuple === other and fields == other.fields
                i = 0
                while i < fields
                  return false unless at(i) === other.at(i)
          Severity: Minor
          Found in core/tuple.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

          There are no issues that match your filters.

          Category
          Status