Showing 359 of 503 total issues
Method from_string
has 67 lines of code (exceeds 30 allowed). Consider refactoring. Open
def self.from_string(str)
%x{
var re = /[+-]?[\d_]+(\.[\d_]+)?(e\d+)?/,
match = str.match(re),
real, imag, denominator;
Method next
has 67 lines of code (exceeds 30 allowed). Consider refactoring. Open
def next
%x{
var i = self.length;
if (i === 0) {
return '';
Method fill
has 66 lines of code (exceeds 30 allowed). Consider refactoring. Open
def fill(*args, &block)
%x{
$deny_frozen_access(self);
var i, length, value;
Method []
has 66 lines of code (exceeds 30 allowed). Consider refactoring. Open
def [](index, length = undefined)
%x{
var size = self.length, exclude, range;
if (index.$$is_range) {
Method reduce_to_hessenberg
has 65 lines of code (exceeds 30 allowed). Consider refactoring. Open
def reduce_to_hessenberg
# This is derived from the Algol procedures orthes and ortran,
# by Martin and Wilkinson, Handbook for Auto. Comp.,
# Vol.ii-Linear Algebra, and the corresponding
# Fortran subroutines in EISPACK.
Method returns
has 62 lines of code (exceeds 30 allowed). Consider refactoring. Open
def returns(sexp)
return returns s(:nil) unless sexp
case sexp.type
when :undef
Method join
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def join(*paths)
if paths.empty?
return ''
end
result = ''
- Read upRead up
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 on_send
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def on_send(node)
recv, meth, *args = *node
if recv && recv.type == :send
recv_of_recv, meth_of_recv, _ = *recv
if meth_of_recv == :JS
- Read upRead up
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 17 (exceeds 5 allowed). Consider refactoring. Open
def **(other)
case other
when Integer
x = self
if other <= 0
- Read upRead up
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 load
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def load(filename = nil)
unless filename
basename = File.basename($0, '.*')
begin
return true if load(File.expand_path(basename, '~/.options'))
- Read upRead up
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 gsub
has 61 lines of code (exceeds 30 allowed). Consider refactoring. Open
def gsub(pattern, replacement = undefined, &block)
%x{
if (replacement === undefined && block === nil) {
return #{enum_for :gsub, pattern};
}
Method **
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def **(other)
if other == 0
return ::Complex.new(1, 0)
end
- Read upRead up
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 16 (exceeds 5 allowed). Consider refactoring. Open
def **(other)
case other
when ::Integer
if self == 0 && other < 0
::Float::INFINITY
- Read upRead up
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_masgn
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def compile_masgn(lhs_items, array, len = nil)
pre_splat = lhs_items.take_while { |child| child.type != :splat }
post_splat = lhs_items.drop(pre_splat.size)
pre_splat.each_with_index do |child, idx|
- Read upRead up
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 16 (exceeds 5 allowed). Consider refactoring. Open
def compile
test_code = js_truthy(test)
@redo_var = scope.new_temp if uses_redo?
- Read upRead up
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 could_become_switch_branch?
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def could_become_switch_branch?(body)
if !body
return true
elsif body.type != :if
if valid_switch_body?(body)
- Read upRead up
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 diagonalize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def diagonalize
# This is derived from the Algol procedures tql2, by
# Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
# Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
# Fortran subroutine in EISPACK.
- Read upRead up
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 permutation
has 57 lines of code (exceeds 30 allowed). Consider refactoring. Open
def permutation(num = undefined, &block)
unless block_given?
return enum_for(:permutation, num) do
`descending_factorial(self.length, num === undefined ? self.length : num)`
end
Method unpack
has 56 lines of code (exceeds 30 allowed). Consider refactoring. Open
def unpack(format, offset: 0)
::Kernel.raise ::ArgumentError, "offset can't be negative" if offset < 0
format = ::Opal.coerce_to!(format, ::String, :to_str).gsub(/\s/, '').delete("\000")
%x{
Method read
has 55 lines of code (exceeds 30 allowed). Consider refactoring. Open
def read(cache: true)
code = read_char
# The first character indicates the type of the object
case code
when '0'