Showing 6 of 6 total issues
Class Config
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class Config
include Marshallers
# Error raised when failed to load a dependency
DependencyLoadError = Class.new(StandardError)
File config.rb
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "pathname"
require_relative "config/version"
require_relative "config/marshallers"
require_relative "config/marshallers/ini_marshaller"
Method fetch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fetch(*keys, default: nil, &block)
# check alias
real_key = @aliases[flatten_keys(keys)]
keys = real_key.split(key_delim) if real_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 deep_set
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def deep_set(settings, *keys)
return settings if keys.empty?
key, *rest = *keys
value = settings[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 load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load
return if dep_name.nil?
dep_name.empty? ? @block.() : dep_name.each { |dep| require(dep) }
rescue LoadError, NameError => err
- 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_merge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def deep_merge(this_hash, other_hash, &block)
this_hash.merge(other_hash) do |key, this_val, other_val|
if this_val.is_a?(::Hash) && other_val.is_a?(::Hash)
deep_merge(this_val, other_val, &block)
elsif block_given?
- 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"