Showing 5 of 5 total issues
Method module_parent_name
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def module_parent_name
if defined?(@module_parent_name)
@module_parent_name
else
module_parent_name = name =~ /::[^:]+\Z/ ? Regexp.last_match.pre_match : 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 nilify_blank_strings
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def nilify_blank_strings
result = map do |element|
if element.is_a?(String) && element.blank?
nil
elsif REFINED_ENUMERABLES.any? { |klass| element.is_a?(klass) }
- 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 slice
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def slice(*keys, nils: false)
return super if defined?(super) && !nils
keys.each_with_object(self.class.new) do |k, hash|
hash[k] = self[k] if nils || key?(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 symbolize_keys
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def symbolize_keys(deep: false)
each_with_object({}) do |(key, value), hash|
value = deep_symbolize_keys_in(value) if deep
key = key.to_sym if key.respond_to?(:to_sym)
hash[key] = 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 deep_value_merge!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def deep_value_merge!(other_key, self_value, other_value, &block)
self[other_key] =
if self_value.is_a?(Hash) && other_value.is_a?(Hash)
self_value.deep_merge!(other_value, &block)
elsif block && key?(other_key)
- 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"