Showing 359 of 503 total issues
Method relative_path_from
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def relative_path_from(base_directory)
dest_directory = cleanpath.to_s
base_directory = base_directory.cleanpath.to_s
dest_prefix = dest_directory
dest_names = []
- 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
Function hash
has 44 lines of code (exceeds 30 allowed). Consider refactoring. Open
Opal.hash = function () {
var arguments_length = arguments.length,
args,
hash,
i,
Method ==
has 43 lines of code (exceeds 30 allowed). Consider refactoring. Open
def ==(other)
%x{
var recursed = {};
function _eqeq(array, other) {
Method pack
has 42 lines of code (exceeds 30 allowed). Consider refactoring. Open
def pack(format)
format = ::Opal.coerce_to!(format, ::String, :to_str).gsub(/\s/, '').delete("\000")
%x{
var output = '';
Method initialize
has 42 lines of code (exceeds 30 allowed). Consider refactoring. Open
def initialize a
raise TypeError, "Expected Matrix but got #{a.class}" unless a.is_a?(Matrix)
# Use a "left-looking", dot-product, Crout/Doolittle algorithm.
@lu = a.to_a
@row_count = a.row_count
Method product
has 41 lines of code (exceeds 30 allowed). Consider refactoring. Open
def product(*args, &block)
%x{
var result = #{block_given?} ? null : [],
n = args.length + 1,
counters = new Array(n),
Method cycle
has 41 lines of code (exceeds 30 allowed). Consider refactoring. Open
def cycle(n = nil, &block)
unless block_given?
return enum_for(:cycle, n) do
if n.nil?
respond_to?(:size) ? ::Float::INFINITY : nil
Method gets
has 41 lines of code (exceeds 30 allowed). Consider refactoring. Open
def gets(sep = false, limit = nil, opts = {})
if `sep.$$is_number` && !limit
sep, limit, opts = false, sep, limit
end
if `sep.$$is_hash` && !limit && opts == {}
Method include?
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def include?(val)
if `self.begin.$$is_number || self.end.$$is_number` ||
@begin.is_a?(::Time) || @end.is_a?(::Time) ||
::Integer.try_convert(@begin) || ::Integer.try_convert(@end)
return cover?(val)
- 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 none?
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def none?(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 any?
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def any?(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_safari_driver
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run_safari_driver
raise 'Safari driver can be started only on localhost' if safari_driver_host != DEFAULT_SAFARI_DRIVER_HOST
started = false
- 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_merge
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def compile_merge
result, seq = [], []
children.each do |child|
if child.type == :kwsplat
- 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_catcher
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def compile_catcher
catchers = @closure.catchers
return if catchers.empty?
- 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 implicit_arglist
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def implicit_arglist
args = []
kwargs = []
def_scope.original_args.children.each do |sexp|
- 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 eval_and_print
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def eval_and_print(func, mode, colorize, binding = nil)
printer = if colorize
->(i) do
ColorPrinter.default(i)
rescue => e
- 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 candidate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.candidate(key, icase = false, pat = nil, &block)
pat ||= Completion.regexp(key, icase)
candidates = []
block.call do |k, *v|
(if Regexp === k
- 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 join
has 40 lines of code (exceeds 30 allowed). Consider refactoring. Open
def join(sep = nil)
return '' if `self.length === 0`
if `sep === nil`
sep = $,
Method hash
has 40 lines of code (exceeds 30 allowed). Consider refactoring. Open
def hash
%x{
var top = ($hash_ids === undefined),
hash_id = self.$object_id(),
result = $opal32_init(),
Method sub
has 40 lines of code (exceeds 30 allowed). Consider refactoring. Open
def sub(pattern, replacement = undefined, &block)
%x{
if (!pattern.$$is_regexp) {
pattern = $coerce_to(pattern, #{::String}, 'to_str');
pattern = new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));