Showing 5 of 5 total issues
Method find_missing_entries
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def find_missing_entries(*entries)
entries.flatten.each.with_object([]) do |entry, array|
if entry.is_a?(Hash)
entry.keys.each do |k|
array << k && next if self[k].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 hash_filter
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def hash_filter(filter)
# Slicing filters out non-declared keys.
slice(*filter.keys).each do |key, value|
next unless value
next unless key? 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"
Further reading
Method raise_if_error!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def raise_if_error!(response, http_code=200)
return response unless response.is_a?(Hash) && response.key?('code')
code = response['code']
error_hash = build_error(response)
- 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 process_datetime_params!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_datetime_params!(params)
params.each do |key, value|
case key
when Symbol, String
params[key] = value.is_a?(Time) ? value.strftime('%FT%TZ') : 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 filter_required
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def filter_required(filters)
# Unless value is a hash, filter
filters.each.with_object(self.class.new(except(filters.flatten))) do |filter, params|
case filter
when Symbol, String
- 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"