Sage/hash_kit

View on GitHub

Showing 3 of 3 total issues

Method from_hash has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def from_hash(hash, klass, transforms = [])
obj = klass.new
return obj if hash.nil? || hash.empty?
raise ArgumentError, "#{hash.inspect} is not a hash" unless hash.is_a?(Hash)
 
 
Severity: Minor
Found in lib/hash_kit/helper.rb - About 2 hrs to fix

Method indifferent! has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def indifferent!(hash)
return unless hash.is_a?(Hash)
 
# Set the default proc to allow the key to be either string or symbol if
# a matching key is found.
Severity: Minor
Found in lib/hash_kit/helper.rb - About 1 hr to fix

Method indifferent_array! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def indifferent_array!(array)
return unless array.is_a?(Array)
 
array.each do |i|
if i.is_a?(Hash)
Severity: Minor
Found in lib/hash_kit/helper.rb - About 25 mins to fix
Severity
Category
Status
Source
Language