Showing 19 of 19 total issues
Class Object
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Object < Hash
attr_reader :parse_object_id
attr_reader :class_name
attr_reader :created_at
attr_reader :updated_at
Class Query
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Query
attr_accessor :where
attr_accessor :class_name
attr_accessor :order_by
attr_accessor :order
File datatypes.rb
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'time'
require 'date'
require 'base64'
module Parse
Method array_op
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def array_op(field, operation, value)
error_msg = "field #{field} not an array"
raise error_msg if self[field] && !self[field].is_a?(Array)
if @parse_object_id
- 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 save
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def save
body = { data: @data }
if @type
if @where
- 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 initialize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(data = {}, &_blk)
@host = data[:host]
@path = data[:path] || Protocol::PATH
@application_id = data[:application_id]
Method get
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get
uri = if @class_name == Parse::Protocol::CLASS_USER
Protocol.user_uri
elsif @class_name == Parse::Protocol::CLASS_INSTALLATION
Protocol.installation_uri
- 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 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 initialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def initialize(data = {}, &_blk)
@host = data[:host]
@path = data[:path] || Protocol::PATH
@application_id = data[:application_id]
- 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 process_response
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def process_response(env)
env[:raw_body] = env[:body] if preserve_raw?(env)
if env[:status] >= 400
begin
- 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 get
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get
uri = if @class_name == Parse::Protocol::CLASS_USER
Protocol.user_uri
elsif @class_name == Parse::Protocol::CLASS_INSTALLATION
Protocol.installation_uri
Method process_response
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_response(env)
env[:raw_body] = env[:body] if preserve_raw?(env)
if env[:status] >= 400
begin
Method parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse(data)
return unless data
@parse_object_id ||= data[Protocol::KEY_OBJECT_ID]
- 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 request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request(uri, method = :get, body = nil, query = nil, content_type = nil)
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"
Further reading
Method initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(data, client = nil)
# convert hash keys to strings
data = Hash[data.map { |k, v| [k.to_s, v] }]
@local_filename = data['local_filename'] if data['local_filename']
- 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 safe_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def safe_hash
Hash[map do |key, value|
if Protocol::RESERVED_KEYS.include?(key)
nil
elsif value.is_a?(Hash) &&
- 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"