rubinius/rubinius

View on GitHub

Showing 1,541 of 1,541 total issues

Class Module has 61 methods (exceeds 20 allowed). Consider refactoring.
Open

class Module

  attr_reader :constant_table
  attr_writer :method_table

Severity: Major
Found in core/module.rb - About 1 day to fix

    Class Hash has 60 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Hash
      include Enumerable
    
      Vector = Rubinius::Tuple
    
    
    Severity: Major
    Found in core/hash.rb - About 1 day to fix

      Method normalize_options has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.normalize_options(mode, options)
          mode = nil if undefined.equal?(mode)
          autoclose = true
          encoding_options = {}
      
      
      Severity: Minor
      Found in core/io.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 split has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.split(string, pattern, limit)
            # Odd edge case
            return [] if string.empty?
      
            tail_empty = false
      Severity: Minor
      Found in core/splitter.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 write_configure_files has 197 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def write_configure_files
          @log.write "\nWriting configuration files..."
      
          @bin_links.delete @program_name
      
      
      Severity: Major
      Found in configure.rb - About 7 hrs to fix

        Method tr_trans has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
        Open

          def tr_trans(source, replacement, squeeze)
            source = StringValue(source).dup
            replacement = StringValue(replacement).dup
        
            return delete!(source) if replacement.empty?
        Severity: Minor
        Found in core/string.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

        Class Time has 54 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Time
          include Comparable
        
          def self.now
            Rubinius.primitive :time_s_now
        Severity: Major
        Found in core/time.rb - About 7 hrs to fix

          Class Integer has 54 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class Integer < Numeric
            def self.===(obj)
              Rubinius.asm do
                int = new_label
                done = new_label
          Severity: Major
          Found in core/integer.rb - About 7 hrs to fix

            Method gsub has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
            Open

              def gsub(pattern, replacement=undefined)
                # Because of the behavior of $~, this is duplicated from gsub! because
                # if we call gsub! from gsub, the last_match can't be updated properly.
            
                unless valid_encoding?
            Severity: Minor
            Found in core/string.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

            File installer.rb has 482 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'rubygems/command'
            require 'rubygems/exceptions'
            require 'rubygems/package'
            require 'rubygems/ext'
            require 'rubygems/user_interaction'
            Severity: Minor
            Found in library/rubygems/installer.rb - About 7 hrs to fix

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

                def gsub!(pattern, replacement=undefined)
                  # Because of the behavior of $~, this is duplicated from gsub! because
                  # if we call gsub! from gsub, the last_match can't be updated properly.
              
                  unless valid_encoding?
              Severity: Minor
              Found in core/string.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

              Class Stat has 52 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class Stat
                  include Comparable
              
                  attr_reader :path
              
              
              Severity: Major
              Found in core/stat.rb - About 7 hrs to fix

                Method compile has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.compile(pattern, flags=0, patterns=[])
                      escape = (flags & File::FNM_NOESCAPE) == 0
                
                      rbrace = nil
                      lbrace = nil
                Severity: Minor
                Found in core/dir_glob.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 braces has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                Open

                  def self.braces(pattern, flags=0, patterns=[])
                    escape = (flags & FNM_NOESCAPE) == 0
                
                    rbrace = nil
                    lbrace = nil
                Severity: Minor
                Found in core/file.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 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

                Class Thread has 50 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class Thread
                  attr_reader :recursive_objects
                  attr_reader :pid
                  attr_reader :exception
                  attr_reader :stack_size
                Severity: Minor
                Found in core/thread.rb - About 7 hrs to fix

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

                    def chomp!(sep=undefined)
                      Rubinius.check_frozen
                  
                      if undefined.equal?(sep)
                        sep = $/
                  Severity: Minor
                  Found in core/string.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 each_line has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def each_line(sep=$/)
                      return to_enum(:each_line, sep) unless block_given?
                  
                      # weird edge case.
                      if sep.nil?
                  Severity: Minor
                  Found in core/string.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 step has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def step(limit=nil, step=nil, to: nil, by: nil)
                      unless block_given?
                        return to_enum(:step, limit, step, to: to, by: by) do
                          Rubinius::Mirror::Numeric.reflect(self).step_size(limit, step, to, by)
                        end
                  Severity: Minor
                  Found in core/numeric.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

                  Severity
                  Category
                  Status
                  Source
                  Language