Class GandiV5
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class GandiV5
# Addin providing a DSL to manage declaring attributes and how to map
# and convert to/from Gandi's fields.
# @api private
module Data
Method to_h_transform_enumerable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def to_h_transform_enumerable(value)
method = :transform_keys if value.respond_to?(:transform_keys)
method ||= :map if value.respond_to?(:map)
value.send(method) do |v|
- 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 to_h
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_h
data_members.to_h do |key|
value = send(key)
next [key, value] if value.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 values_at
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def values_at(*keys)
keys.map(&:to_s).map do |key|
key, sub_key = key.split('.', 2)
unless data_member?(key.to_sym)
fail ArgumentError, "#{key} is not a member."
- 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 translate_gandi
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def translate_gandi(data)
return nil unless data.is_a?(Hash)
data = data.clone
- 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"