Showing 359 of 503 total issues
Method round
has 48 lines of code (exceeds 30 allowed). Consider refactoring. Open
def round(ndigits = undefined)
if ::Integer === self
if `ndigits == null`
return self
end
Method irb
has 48 lines of code (exceeds 30 allowed). Consider refactoring. Open
def irb
::Opal::IRB.ensure_loaded('opal-replutils')
silencer = ::Opal::IRB::Silencer.new
Method eval_and_print
has 48 lines of code (exceeds 30 allowed). Consider refactoring. Open
def eval_and_print(func, mode, colorize, binding = nil)
printer = if colorize
->(i) do
ColorPrinter.default(i)
rescue => e
Method initialize
has 47 lines of code (exceeds 30 allowed). Consider refactoring. Open
def initialize(options = nil)
options ||= {}
# Runner
@runner_type = options.delete(:runner) || :nodejs
Method compile
has 47 lines of code (exceeds 30 allowed). Consider refactoring. Open
def compile
case value.type
when :self, :nil, :false, :true
push value.type.to_s.inspect
when :lvasgn, :ivasgn, :gvasgn, :cvasgn, :casgn, :op_asgn, :or_asgn, :and_asgn
Method each_with_index
has 47 lines of code (exceeds 30 allowed). Consider refactoring. Open
def each_with_index(which = :all) # :yield: e, row, column
return to_enum :each_with_index, which unless block_given?
last = column_count - 1
case which
when :all
Method slice_before
has 46 lines of code (exceeds 30 allowed). Consider refactoring. Open
def slice_before(pattern = undefined, &block)
if `pattern === undefined && block === nil`
::Kernel.raise ::ArgumentError, 'both pattern and block are given'
end
Method each
has 46 lines of code (exceeds 30 allowed). Consider refactoring. Open
def each(which = :all) # :yield: e
return to_enum :each, which unless block_given?
last = column_count - 1
case which
when :all
Method solve
has 46 lines of code (exceeds 30 allowed). Consider refactoring. Open
def solve b
if (singular?)
Matrix.Raise Matrix::ErrNotRegular, "Matrix is singular."
end
if b.is_a? Matrix
Method eval_ruby
has 45 lines of code (exceeds 30 allowed). Consider refactoring. Open
def eval_ruby(code)
builder = Opal::Builder.new
silencer = Silencer.new
code = "#{@incomplete}#{code}"
Method _racc_yyparse_rb
has 45 lines of code (exceeds 30 allowed). Consider refactoring. Open
def _racc_yyparse_rb(recv, mid, arg, c_debug)
action_table, action_check, action_default, action_pointer,
_, _, _, _,
_, _, token_table, _,
_, _, * = arg
Method /
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def /(other)
if ::Complex === other
if (::Number === @real && @real.nan?) || (::Number === @imag && @imag.nan?) ||
(::Number === other.real && other.real.nan?) || (::Number === other.imag && other.imag.nan?)
::Complex.new(::Float::NAN, ::Float::NAN)
- 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 initialize
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def initialize(range, step = undefined, creation_method = :step)
@creation_method = creation_method
if range.is_a? ::Array
@step_arg1, @step_arg2, @topfx, @bypfx = *range
@receiver_num = step
- 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 cycle
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def cycle(n = nil, &block)
unless block_given?
return enum_for(:cycle, n) do
if n.nil?
::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 sample
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def sample(count = undefined, options = undefined)
return at ::Kernel.rand(`self.length`) if `count === undefined`
if `options === undefined`
if (o = ::Opal.coerce_to? count, ::Hash, :to_hash)
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def compile
is_lambda! if scope.lambda_definition?
compile_body_or_shortcut
- 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 fork_entrypoint
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def fork_entrypoint(io)
# Ensure we can work with our forks async...
Fiber.set_scheduler(nil) if Fiber.respond_to? :set_scheduler
@in_fork = io
- 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_body_or_shortcut
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def compile_body_or_shortcut
# The shortcuts don't check arity. If we want to check arity,
# we can't use them.
return compile_body if compiler.arity_check?
- 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_to_directory
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def compile_to_directory(dir = nil, single_file: nil, with_source_map: true)
raise ArgumentError, 'no directory provided' if dir.nil? && single_file.nil?
catch(:file) do
index = []
- 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 DelegateClass
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def DelegateClass(superclass, &block)
klass = Class.new(Delegator)
ignores = [*::Delegator.public_api, :to_s, :inspect, :=~, :!~, :===]
protected_instance_methods = superclass.protected_instance_methods
protected_instance_methods -= ignores
- 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"