Class Builder
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Builder
include Helpers
include Partials
SETTING_TYPES = {
Method to_hash
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def to_hash(object = nil, settings = nil, options = nil)
@_object = object if object
@options.merge!(options) if options
@settings.merge!(settings) if settings
- 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 merge_engines_into_result
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def merge_engines_into_result
engines.each do |engine|
case engine
when Hash
# engine was stored in the form { name => #<Engine> }
- 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 child
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def child(data, options = {}, &block)
return unless data.present? && resolve_condition(options)
name = is_name_value?(options[:root]) ? options[:root] : data_name(data)
object = data_object(data)
- 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 node
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def node(name, options = {}, &block)
return unless resolve_condition(options)
return if @options.has_key?(:except) && [@options[:except]].flatten.include?(name)
result = block.call(@_object)
- 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_replace_empty_string_values
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def deep_replace_empty_string_values(hash)
hash.inject({}) do |new_hash, (k, v)|
new_hash[k] = if v.is_a?(Hash)
deep_replace_empty_string_values(v)
else
- 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"