Showing 419 of 503 total issues
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, '\\$&'));
Method show_version
has 40 lines of code (exceeds 30 allowed). Consider refactoring. Open
def show_version(*pkgs)
progname = ARGV.options.program_name
result = false
show = proc do |klass, cname, version|
str = progname.to_s
Method min
has 39 lines of code (exceeds 30 allowed). Consider refactoring. Open
def min(n = nil, &block)
unless n.nil?
if block_given?
return sort { |a, b| yield a, b }.take n
else
Method flatten
has 39 lines of code (exceeds 30 allowed). Consider refactoring. Open
def flatten(level = undefined)
%x{
function _flatten(array, level) {
var result = [],
i, length,
Method index
has 39 lines of code (exceeds 30 allowed). Consider refactoring. Open
def index(search, offset = undefined)
%x{
var index,
match,
regex;
Method compile
has 39 lines of code (exceeds 30 allowed). Consider refactoring. Open
def compile
compiler.top_scope = self
compiler.dynamic_cache_result = true if sexp.meta[:dynamic_cache_result]
push version_comment
Method decode_www_form
has 38 lines of code (exceeds 30 allowed). Consider refactoring. Open
def self.decode_www_form(str, enc = undefined, separator: '&', use__charset_: false, isindex: false)
raise ArgumentError, "the input of #{name}.#{__method__} must be ASCII only string" unless str.ascii_only?
%x{
var ary = [], key, val;
Method plus
has 38 lines of code (exceeds 30 allowed). Consider refactoring. Open
def plus(path1, path2) # -> path # :nodoc:
prefix2 = path2
index_list2 = []
basename_list2 = []
while (r2 = chop_basename(prefix2))
Method initialize
has 37 lines of code (exceeds 30 allowed). Consider refactoring. Open
def initialize(size = nil, obj = nil, &block)
%x{
$deny_frozen_access(self);
if (obj !== nil && block !== nil) {
Method union
has 37 lines of code (exceeds 30 allowed). Consider refactoring. Open
def union(*parts)
%x{
var is_first_part_array, quoted_validated, part, options, each_part_options;
if (parts.length == 0) {
return /(?!)/;
Method inspect
has 37 lines of code (exceeds 30 allowed). Consider refactoring. Open
def self.inspect(value = undefined)
`var pushed = false`
begin
%x{
if (value === null) {