Showing 359 of 503 total issues

Method update has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc:
Severity: Minor
Found in stdlib/optparse.rb - About 35 mins to fix

    Method summarize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk)
    Severity: Minor
    Found in stdlib/optparse.rb - About 35 mins to fix

      Method summarize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def summarize(sdone = {}, ldone = {}, width = 1, max = width - 1, indent = '')
      Severity: Minor
      Found in stdlib/optparse.rb - About 35 mins to fix

        Method group has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def group(indent=nil, open_obj='', close_obj='', open_width=nil, close_width=nil)
        Severity: Minor
        Found in stdlib/prettyprint.rb - About 35 mins to fix

          Method set has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def set(offset, value, bits = 8, type = :unsigned, little = false)
          Severity: Minor
          Found in stdlib/buffer/view.rb - About 35 mins to fix

            Method <=> has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def <=>(other)
                if ::Time === other
                  to_f <=> other.to_f
                else
                  r = other <=> self
            Severity: Minor
            Found in opal/corelib/time.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

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

                def _lesser_than_end?(val)
                  end_ = self.end || `inf`
                  if step > 0
                    exclude_end? ? val < end_ : val <= end_
                  else
            Severity: Minor
            Found in opal/corelib/enumerator/arithmetic_sequence.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

            Method each_slice has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def each_slice(n, &block)
                n = `$coerce_to(#{n}, #{::Integer}, 'to_int')`
            
                if `n <= 0`
                  ::Kernel.raise ::ArgumentError, 'invalid slice size'
            Severity: Minor
            Found in opal/corelib/enumerable.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

            Method to_s has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def to_s
                result = @real.inspect
            
                result +=
                  if (::Number === @imag && @imag.nan?) || @imag.positive? || @imag.zero?
            Severity: Minor
            Found in opal/corelib/complex.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

            Method module_eval has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def module_eval(*args, &block)
                if block.nil? && `!!Opal.compile`
                  ::Kernel.raise ::ArgumentError, 'wrong number of arguments (0 for 1..3)' unless (1..3).cover? args.size
            
                  string, file, _lineno = *args
            Severity: Minor
            Found in opal/corelib/module.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

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

                  def self.dir_writable?(*paths)
                    return false unless File.exist?(paths.first)
            
                    until paths.empty?
                      dir = File.expand_path(paths.shift, dir)
            Severity: Minor
            Found in lib/opal/cache/file_cache.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

            Method eof has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def eof
                  return nil if @tokens.empty?
            
                  eof_content = @source[last_token_position..-1]
                  return nil unless eof_content
            Severity: Minor
            Found in lib/opal/eof_content.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

            Method default_compile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def default_compile
                    if auto_await?
                      push '(await '
                      scope.await_encountered = true
                    end
            Severity: Minor
            Found in lib/opal/nodes/call.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

            Method combine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def Matrix.combine(*matrices)
                return to_enum(__method__, *matrices) unless block_given?
            
                return Matrix.empty if matrices.empty?
                matrices.map!(&CoercionHelper.method(:coerce_to_matrix))
            Severity: Minor
            Found in stdlib/matrix.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

            Method locate_root_dir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def self.locate_root_dir(file)
                  begin
                    file = File.realpath(file)
                  rescue Errno::ENOENT
                    return nil
            Severity: Minor
            Found in lib/opal/project.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

            Method column has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def column(j) # :yield: e
                if block_given?
                  return self if j >= column_count || j < -column_count
                  row_count.times do |i|
                    yield @rows[i][j]
            Severity: Minor
            Found in stdlib/matrix.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

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

              def [](name)
                if ::Integer === name
                  ::Kernel.raise ::IndexError, "offset #{name} too small for struct(size:#{self.class.members.size})" if name < -self.class.members.size
                  ::Kernel.raise ::IndexError, "offset #{name} too large for struct(size:#{self.class.members.size})" if name >= self.class.members.size
            
            
            Severity: Minor
            Found in opal/corelib/struct.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

            Method extract_underscore_args has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def extract_underscore_args
                    valid_args = []
                    caught_blank_argument = false
            
                    args.children.each do |arg|
            Severity: Minor
            Found in lib/opal/nodes/iter.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

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

                  def compile
                    with_temp do |array|
                      if rhs.type == :array
                        push "#{array} = ", expr(rhs)
                        rhs_len = rhs.children.any? { |c| c.type == :splat } ? nil : rhs.children.size
            Severity: Minor
            Found in lib/opal/nodes/masgn.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

            Method read has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def read(length = nil, outbuf = nil)
                check_readable
            
                return if eof?
            
            
            Severity: Minor
            Found in stdlib/stringio.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

            Severity
            Category
            Status
            Source
            Language