Class Collection
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
class Collection
include ZendeskAPI::Sideloading
include Pagination
# Options passed in that are automatically converted from an array to a comma-separated list.
File collection.rb
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'zendesk_api/resource'
require 'zendesk_api/resources'
require 'zendesk_api/search'
require 'zendesk_api/pagination'
Method _all
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _all(start_page = @options["page"], bang = false, &block)
raise(ArgumentError, "must pass a block") unless block
page(start_page)
clear_cache
- 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_response
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_response(path)
@error = nil
@client.connection.send(@verb || "get", path) do |req|
opts = @options.delete_if { |_, v| v.nil? }
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def _save(method = :save)
return self unless @resources
result = true
- 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 wrap_resource
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wrap_resource(res, with_association = with_association?)
case res
when Array
wrap_resource(Hash[*res], with_association)
when 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"