Method parse_json
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_json(class_name, obj)
if obj.nil?
nil
# Array
- 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 copy_client
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.copy_client(client, parsed_data)
do_copy = lambda do |object|
if object.is_a?(Parse::Object)
object.client = client
object.each do |_key, 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 pointerize_value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.pointerize_value(obj)
if obj.is_a?(Parse::Object)
p = obj.pointer
raise ArgumentError, "new object used in context requiring pointer #{obj}" unless p
p
- 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 object_pointer_equality?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.object_pointer_equality?(a, b)
classes = [Parse::Object, Parse::Pointer]
return false unless classes.any? { |c| a.is_a?(c) } && classes.any? { |c| b.is_a?(c) }
return true if a.equal?(b)
return false if a.new? || b.new?
- 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"