Showing 359 of 503 total issues
Method solve
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def solve b
if (singular?)
Matrix.Raise Matrix::ErrNotRegular, "Matrix is singular."
end
if b.is_a? Matrix
- 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 Raise
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def E2MM.Raise(klass = E2MM, err = nil, *rest)
if form = e2mm_message(klass, err)
b = $@.nil? ? caller(1) : $@
b.shift if b[0] =~ /^#{Regexp.quote(__FILE__)}:/
raise err, sprintf(form, *rest), b
- 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 system
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def system(*argv, exception: false)
env = {}
env = argv.shift if argv.first.is_a? Hash
env = ENV.merge(env).to_n
cmdname = argv.shift
- 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 compsys
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def compsys(sdone, ldone) # :nodoc:
sopts, lopts = [], []
@short.each { |s| sdone.fetch(s) { sopts << s }; sdone[s] = true } if @short
@long.each { |s| ldone.fetch(s) { lopts << s }; ldone[s] = true } if @long
return if sopts.empty? && lopts.empty? # completely hidden
- 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 Native
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def Native(obj)
if `#{obj} == null`
nil
elsif native?(obj)
Native::Object.new(obj)
- 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 independent?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def Vector.independent?(*vs)
vs.each do |v|
raise TypeError, "expected Vector, got #{v.class}" unless v.is_a?(Vector)
Vector.Raise ErrDimensionMismatch unless v.size == vs.first.size
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 shellsplit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def shellsplit(line)
line += ' ' # Somehow this is needed for the JS regexp engine
words = []
field = String.new
line.scan(/\s*(?:([^\s\\\'\"]+)|'([^\']*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\r?\n?\Z|\s)?/m) do |(word, sq, dq, esc, garbage, sep)|
- 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 __prepare_require__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __prepare_require__(path)
name = `Opal.normalize(#{path})`
full_path = name.end_with?('.rb') ? name : name + '.rb'
if `!Opal.modules[#{name}]`
- 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 reject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def reject(value = nil)
if realized?
raise ArgumentError, 'the promise has already been realized'
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
Avoid too many return
statements within this method. Open
return false if @begin && compare.call(@begin, value) > 0
Avoid too many return
statements within this method. Open
return 0
Avoid too many return
statements within this method. Open
return self
Avoid too many return
statements within this method. Open
return true if @end.nil?
Avoid too many return
statements within this method. Open
return !val_max.nil? && compare.call(val_max, @end) <= 0
Avoid too many return
statements within this method. Open
return false unless valid_switch_body?(true_body)
Avoid too many return
statements within this method. Open
return File.dirname(Opal::Compiler.module_name(@compiler.file))
Avoid too many return
statements within this method. Open
return false unless switch_variable == @switch_variable
Avoid too many return
statements within this method. Open
return expand_path(*parts)
Avoid too many return
statements within this method. Open
return false unless could_become_switch_branch?(false_body)
Avoid too many return
statements within this method. Open
return false unless valid_switch_body?(true_body)