rubinius/rubinius

View on GitHub

Showing 1,079 of 1,541 total issues

Method setup_llvm has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  def setup_llvm
    @log.print "  Checking for 'llvm-config': "

    config = @llvm_configure
    if !config
Severity: Minor
Found in configure.rb - About 4 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 reopen has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  def reopen(other, mode=undefined)
    if other.respond_to?(:to_io)
      flush

      if other.kind_of? IO
Severity: Minor
Found in core/io.rb - About 4 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 strip_bom has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  def strip_bom
    return unless File::Stat.fstat(descriptor).file?

    case b1 = getbyte
    when 0x00
Severity: Minor
Found in core/io.rb - About 4 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 puts has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  def puts(*args)
    if args.empty?
      write DEFAULT_RECORD_SEPARATOR
    else
      args.each do |arg|
Severity: Minor
Found in core/io.rb - About 4 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 trap has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  def self.trap(sig, prc=nil, &block)
    sig = sig.to_s if sig.kind_of?(Symbol)

    if sig.kind_of?(String)
      osig = sig
Severity: Minor
Found in core/signal.rb - About 4 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 read has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def read(bytes=nil, output=nil)
      # The user might try to pass in nil, so we have to check here
      output ||= default_value
      output.clear

Severity: Minor
Found in core/argf.rb - About 4 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 round has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  def round(ndigits=undefined)
    return self if undefined.equal? ndigits

    if ndigits.kind_of? Numeric
      if ndigits > Fixnum::MAX or ndigits <= Fixnum::MIN
Severity: Minor
Found in core/integer.rb - About 4 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 dir_glob.rb has 342 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Dir
  module Glob
    class Node
      def initialize(nxt, flags)
        @flags = flags
Severity: Minor
Found in core/dir_glob.rb - About 4 hrs to fix

    Method require has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

      def require path
        RUBYGEMS_ACTIVATION_MONITOR.enter
    
        path = path.to_path if path.respond_to? :to_path
    
    
    Severity: Minor
    Found in library/rubygems/core_ext/kernel_require.rb - About 4 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 open_class_under has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.open_class_under(name, sup, mod)
        unless Type.object_kind_of? mod, Module
          raise TypeError, "'#{mod.inspect}' is not a class/module"
        end
    
    
    Severity: Minor
    Found in core/zed.rb - About 4 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 succ! has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

      def succ!
        self.modify!
    
        return self if @num_bytes == 0
    
    
    Severity: Minor
    Found in core/string.rb - About 4 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 find_const has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

      def find_const(under)
        current = under
        constant = undefined
    
        while current
    Severity: Minor
    Found in core/autoload.rb - About 4 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 user_interaction.rb has 335 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'rubygems/util'
    
    ##
    # Module that defines the default UserInteraction.  Any class including this
    # module will have access to the +ui+ method that returns the default UI.
    Severity: Minor
    Found in library/rubygems/user_interaction.rb - About 4 hrs to fix

      Method gem_platforms has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        def gem_platforms options # :nodoc:
          platform_names = Array(options.delete :platform)
          platform_names.concat Array(options.delete :platforms)
          platform_names.concat @current_platforms if @current_platforms
      
      
      Severity: Minor
      Found in library/rubygems/request_set/gem_dependency_api.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 process has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        def process
          MSpec.register_current self
      
          if @parsed and filter_examples
            MSpec.shuffle @examples if MSpec.randomize?
      Severity: Minor
      Found in mspec/lib/mspec/runner/context.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 encode! has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        def encode!(to=undefined, from=undefined, options=undefined)
          Rubinius.check_frozen
      
          case to
          when Encoding
      Severity: Minor
      Found in core/string.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 [] has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        def [](index, other = undefined)
          Rubinius.primitive :string_aref
      
          unless undefined.equal?(other)
            if index.kind_of?(Fixnum) && other.kind_of?(Fixnum)
      Severity: Minor
      Found in core/string.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

      File thread.rb has 328 lines of code (exceeds 250 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 3 hrs to fix

        Class BasicSpecification has 31 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Gem::BasicSpecification
        
          ##
          # Allows installation of extensions for git: gems.
        
        
        Severity: Minor
        Found in library/rubygems/basic_specification.rb - About 3 hrs to fix

          Method verify has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

            def verify chain, key = nil, digests = {}, signatures = {},
                       full_name = '(unknown)'
              if signatures.empty? then
                if @only_signed then
                  raise Gem::Security::Exception,
          Severity: Minor
          Found in library/rubygems/security/policy.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

          Severity
          Category
          Status
          Source
          Language