rubinius/rubinius

View on GitHub

Showing 1,321 of 1,541 total issues

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

    File kernel.rb has 836 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Kernel
      def equal?(other)
        Rubinius.primitive :object_equal
        raise PrimitiveFailure, "Kernel#equal? primitive failed"
      end
    Severity: Major
    Found in core/kernel.rb - About 2 days to fix

      Method parse_stream has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring.
      Open

        def parse_stream(f)
          class_pattern = /class\s+([^\s]+)\s*:\s*public\s+([^\s]+)/
          slot_pattern = %r!^\s*(\w+)\*?\s+\*?_(\w+)_\s*;\s*//\s*slot(.*)!
          accessor_pattern = %r!^\s*attr_(accessor|reader|writer)\((\w+),\s*(\w+)\)!
          primitive_pattern = %r%^\s*//\s+Rubinius.primitive([?!\+])?\s+:(.*)\s*$%
      Severity: Minor
      Found in build/scripts/field_extract.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

      File hash.rb has 762 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        File file.rb has 730 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        class File < IO
          include Enumerable
        
          class FileError < Exception; end
          class NoFileError < FileError; end
        Severity: Major
        Found in core/file.rb - About 1 day to fix

          File enumerable.rb has 709 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Enumerable
            def chunk
              raise ArgumentError, "no block given" unless block_given?
              ::Enumerator.new do |yielder|
                previous = nil
          Severity: Major
          Found in core/enumerable.rb - About 1 day to fix

            Class Configure has 82 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Configure
            
              # Default settings only. All code that may depend on user-selected options
              # must run after options are processed.
              def initialize(root)
            Severity: Major
            Found in configure.rb - About 1 day to fix

              File rubygems.rb has 676 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'rbconfig'
              require 'thread'
              
              module Gem
                VERSION = "2.7.5"
              Severity: Major
              Found in library/rubygems.rb - About 1 day to fix

                File loader.rb has 660 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                TOPLEVEL_BINDING = binding()
                
                module Rubinius
                  class Loader
                    def initialize
                Severity: Major
                Found in core/loader.rb - About 1 day 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

                  Class File has 76 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class File < IO
                    include Enumerable
                  
                    class FileError < Exception; end
                    class NoFileError < FileError; end
                  Severity: Major
                  Found in core/file.rb - About 1 day to fix

                    File server.rb has 638 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'webrick'
                    require 'zlib'
                    require 'erb'
                    require 'uri'
                    
                    
                    Severity: Major
                    Found in library/rubygems/server.rb - About 1 day to fix

                      Class TestCase has 71 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Gem::TestCase < MiniTest::Unit::TestCase
                      
                        attr_accessor :fetcher # :nodoc:
                      
                        attr_accessor :gem_repo # :nodoc:
                      Severity: Major
                      Found in library/rubygems/test_case.rb - About 1 day to fix

                        File type.rb has 599 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        module Rubinius
                          module Type
                            # Performs a direct kind_of? check on the object bypassing any method
                            # overrides.
                            def self.object_kind_of?(obj, cls)
                        Severity: Major
                        Found in core/type.rb - About 1 day to fix

                          Method inspect has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def inspect
                              result_encoding = Encoding.default_internal || Encoding.default_external
                              unless result_encoding.ascii_compatible?
                                result_encoding = Encoding::US_ASCII
                              end
                          Severity: Minor
                          Found in core/string.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

                          File process.rb has 575 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          module Process
                            def self.time
                              Rubinius.primitive :vm_time
                              raise PrimitiveFailure, "Process.time primitive failed"
                            end
                          Severity: Major
                          Found in core/process.rb - About 1 day to fix

                            File module.rb has 571 lines of code (exceeds 250 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

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

                                def []=(index, count_or_replacement, replacement=undefined)
                                  if undefined.equal?(replacement)
                                    replacement = count_or_replacement
                                    count = nil
                                  else
                              Severity: Minor
                              Found in core/string.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

                              File pointer_accessors.rb has 558 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              module Rubinius
                              module FFI
                                ##
                                # This module provides accessors for various different types. It
                                # provides methods for:
                              Severity: Major
                              Found in core/pointer_accessors.rb - About 1 day to fix

                                Method constant_scope_defined? has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def self.constant_scope_defined?(scope, name)
                                      current = scope
                                
                                      until nil.equal? current
                                        break if nil.equal? current.parent
                                Severity: Minor
                                Found in core/type.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

                                Severity
                                Category
                                Status
                                Source
                                Language