Showing 11 of 13 total issues
Method index_block
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def index_block(parent_class, parent_id, extra_params = {}, &block)
extra_params[:page] = extra_params.delete("page") if extra_params["page"]
extra_params[:page] = 1 unless extra_params[:page]
pagination = index_block_iteration(parent_class, parent_id, extra_params, &block)
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(public_key, secret, path, parameters={}, custom_server=nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(public_key, secret, method, path, custom_server = nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(public_key, secret, path, parameters = {}, custom_server = nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(public_key, secret, path, parameters={}, custom_server=nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(public_key, secret, path, parameters={}, custom_server=nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(public_key, secret, path, parameters={}, custom_server=nil)
Method create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create(parent, attributes, create_method = :post)
raise ArgumentError, "`parent` given for #create is not valid" unless parent
raise ArgumentError, "`attributes` given for #create is not valid" unless attributes.is_a?(Hash)
parameters = case create_method
- 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 index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def index(parent_class, parent_id, extra_params = {}, return_raw = false)
raise ArgumentError, "`parent_id` given for #index is not valid" unless parent_id
raise ArgumentError, "`parent_class` given for #index is not valid" unless parent_class
result = @api_connector.get(collection_path(parent_class, parent_id), extra_params)
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update(attributes)
raise ArgumentError, "Input `attributes` is not a Hash" unless attributes.is_a?(Hash)
raise ArgumentError, "No object_handler is attached to this object" unless @object_handler
if new_object = @object_handler.update(@id, attributes)
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update(id, attributes)
raise ArgumentError, "`id` given for #update is not valid" unless id
raise ArgumentError, "`attributes` given for #update is not valid" unless attributes.is_a?(Hash)
result = @api_connector.put(resource_path(id), { "data" => attributes })
- 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"