Showing 419 of 503 total issues
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'
Method prefork_reactor
has 55 lines of code (exceeds 30 allowed). Consider refactoring. Open
def prefork_reactor(rel_path, requires, autoloads, options)
prefork
processed = []
Function $allocate_class
has 54 lines of code (exceeds 30 allowed). Consider refactoring. Open
function $allocate_class(name, superclass, singleton) {
var klass, bridged_descendant;
if (bridged_descendant = descends_from_bridged_class(superclass)) {
// Inheritance from bridged classes requires
Method run_chrome_server
has 54 lines of code (exceeds 30 allowed). Consider refactoring. Open
def run_chrome_server
raise 'Chrome server can be started only on localhost' if chrome_host != DEFAULT_CHROME_HOST
profile = mktmpprofile
Method source_map_name_for
has 54 lines of code (exceeds 30 allowed). Consider refactoring. Open
def source_map_name_for(sexp)
case sexp.type
when :top
case sexp.meta[:kind]
when :require
Method compile
has 53 lines of code (exceeds 30 allowed). Consider refactoring. Open
def compile
scope.rescue_else_sexp = children[1..-1].detect { |sexp| sexp && sexp.type != :resbody }
_has_rescue_handlers = false
if handle_rescue_else_manually?
Method all?
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def all?(pattern = undefined, &block)
if `pattern !== undefined`
each do |*value|
comparable = `comparableForPattern(value)`
- 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 run_chrome_server
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def run_chrome_server
raise 'Chrome server can be started only on localhost' if chrome_host != DEFAULT_CHROME_HOST
profile = mktmpprofile
- 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 getopts
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def getopts(*args)
argv = Array === args.first ? args.shift : default_argv
single_options, *long_options = *args
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 ls
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def ls(object, colorize)
methods = imethods = object.methods
ancestors = object.class.ancestors
constants = []
ivs = object.instance_variables
- 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 to_i
has 51 lines of code (exceeds 30 allowed). Consider refactoring. Open
def to_i(base = 10)
%x{
var result,
string = self.toLowerCase(),
radix = $coerce_to(base, #{::Integer}, 'to_int');
Method DelegateClass
has 49 lines of code (exceeds 30 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
Method define_method
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def define_method(name, method = undefined, &block)
%x{
$deny_frozen_access(self);
if (method === undefined && block === nil)
- 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 match
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def match(ast, matcher)
return false if ast.nil?
ast_parts = [ast.type] + ast.children
self_parts = [type] + children
- 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 index
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def index(*args)
raise ArgumentError, "wrong number of arguments(#{args.size} for 0-2)" if args.size > 2
which = (args.size == 2 || SELECTORS.include?(args.last)) ? args.pop : :all
return to_enum :find_index, which, *args unless block_given? || args.size == 1
if args.size == 1
- 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 laplace_expansion
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def laplace_expansion(row: nil, column: nil)
num = row || column
if !num || (row && column)
raise ArgumentError, "exactly one the row or column arguments must be specified"
- 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 chrome_executable
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def chrome_executable
ENV['GOOGLE_CHROME_BINARY'] ||
if OS.windows?
[
'C:/Program Files/Google/Chrome Dev/Application/chrome.exe',
- 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"