rubinius/rubinius

View on GitHub

Showing 1,321 of 1,541 total issues

Method set_filesystem_paths has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

  def set_filesystem_paths
    @prefixdir = @prefixdir ? expand_install_dir(@prefixdir) : @sourcedir

    if @appdir
      dir = expand_install_dir @appdir
Severity: Minor
Found in configure.rb - About 5 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 Installer has 43 methods (exceeds 20 allowed). Consider refactoring.
Open

class Gem::Installer

  ##
  # Paths where env(1) might live.  Some systems are broken and have it in
  # /bin
Severity: Minor
Found in library/rubygems/installer.rb - About 5 hrs to fix

    File gem_dependency_api.rb has 409 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class Gem::RequestSet::GemDependencyAPI
    
      ENGINE_MAP = { # :nodoc:
        :jruby        => %w[jruby],
        :jruby_18     => %w[jruby],
    Severity: Minor
    Found in library/rubygems/request_set/gem_dependency_api.rb - About 5 hrs to fix

      Method const_get has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.const_get(mod, name, inherit=true, resolve=true)
            unless object_kind_of? name, Symbol
              name = StringValue(name)
              if name.index '::' and name.size > 2
                return const_lookup mod, name, inherit, resolve
      Severity: Minor
      Found in core/type.rb - About 5 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 expand_path has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.expand_path(path, dir=nil)
          path = Rubinius::Type.coerce_to_path(path)
          str = "".force_encoding path.encoding
          first = path[0]
          if first == ?~
      Severity: Minor
      Found in core/file.rb - About 5 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 exception.rb has 406 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class Exception
        attr_accessor :locations
        attr_accessor :cause
        attr_accessor :custom_backtrace
      
      
      Severity: Minor
      Found in core/exception.rb - About 5 hrs to fix

        Method validate has 143 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def validate packaging = true
            @warnings = 0
            require 'rubygems/user_interaction'
            extend Gem::UserInteraction
            normalize
        Severity: Major
        Found in library/rubygems/specification.rb - About 5 hrs to fix

          File enumerator.rb has 402 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class Enumerator
            include Enumerable
          
            attr_writer :args
            private :args=
          Severity: Minor
          Found in core/enumerator.rb - About 5 hrs to fix

            Method raise has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

              def raise(exc=undefined, msg=undefined, ctx=nil, cause: nil)
                if undefined.equal? exc
                  exc = $!
                  exc = RuntimeError.new("No current exception") unless exc
                  exc.cause = cause unless exc.cause or exc == cause
            Severity: Minor
            Found in core/zed.rb - About 5 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 time.rb has 397 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              File ffi.rb has 394 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module Rubinius
                module FFI
              
                  #  Specialised error classes
                  class TypeError < RuntimeError; end
              Severity: Minor
              Found in core/ffi.rb - About 5 hrs to fix

                Method install has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                Open

                  def install options, &block # :yields: request, installer
                    if dir = options[:install_dir]
                      requests = install_into dir, false, options, &block
                      return requests
                    end
                Severity: Minor
                Found in library/rubygems/request_set.rb - About 5 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 include_modules_from has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.include_modules_from(included_module, klass)
                      insert_at = klass
                      constants_changed = false
                
                      mod = included_module
                Severity: Minor
                Found in core/type.rb - About 5 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 alpha.rb has 391 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class NilClass
                  def nil?
                    true
                  end
                
                
                Severity: Minor
                Found in core/alpha.rb - About 5 hrs to fix

                  Class CompiledCode has 40 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class CompiledCode < Executable
                      def self.allocate
                        Rubinius.primitive :compiledcode_allocate
                        raise PrimitiveFailure, "CompiledCode.allocate primitive failed"
                      end
                  Severity: Minor
                  Found in core/compiled_code.rb - About 5 hrs to fix

                    Class Float has 40 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Float < Numeric
                      def **(other)
                        Rubinius.primitive :float_pow
                    
                        if other.is_a?(Float) && self < 0 && other != other.round
                    Severity: Minor
                    Found in core/float.rb - About 5 hrs to fix

                      Method execute has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def execute
                          specs = if options[:all] then
                                    Gem::Specification.map
                      
                                  # `--extensions` must be explicitly given to pristine only gems
                      Severity: Minor
                      Found in library/rubygems/commands/pristine_command.rb - About 5 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 Command has 39 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Gem::Command
                      
                        include Gem::UserInteraction
                      
                        ##
                      Severity: Minor
                      Found in library/rubygems/command.rb - About 5 hrs to fix

                        Class Numeric has 39 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Numeric
                          include Comparable
                        
                          # Always raises TypeError, as dup'ing Numerics is not allowed.
                          def initialize_copy(other)
                        Severity: Minor
                        Found in core/numeric.rb - About 5 hrs to fix

                          File options.rb has 379 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require 'mspec/version'
                          
                          class MSpecOption
                            attr_reader :short, :long, :arg, :description, :block
                          
                          
                          Severity: Minor
                          Found in mspec/lib/mspec/utils/options.rb - About 5 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language