Class RestClient
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class RestClient
@access_methods = []
@configuration = nil
# Initialize the fadaray connection
Method send_get_request
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def send_get_request(connection, url, options, custom_params = nil)
rest_options = parse_options(options)
url += rest_options[:query_params]
url += custom_params unless custom_params.nil?
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 send_put_request
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def send_put_request(connection, url, options, data, custom_params = nil, mime = 'application/json')
rest_options = parse_options(options)
url += rest_options[:query_params]
url += custom_params unless custom_params.nil?
connection.put do |req|
- 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 return_value
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def return_value(nil_values = false, transformation = nil, return_hash = false)
@value = decode_values
return @value if @value.first.is_a? String
if @value.count == 1 && !return_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"
Further reading
Method send_post_request
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def send_post_request(connection, url, options, data, custom_params = nil)
rest_options = parse_options(options)
url += rest_options[:query_params]
url += custom_params unless custom_params.nil?
connection.post do |req|
- 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 send_delete_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def send_delete_request(connection, url, options, custom_params = nil)
rest_options = parse_options(options)
url += rest_options[:query_params]
url += custom_params unless custom_params.nil?
connection.delete do |req|
- 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 send_put_request
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_put_request(connection, url, options, data, custom_params = nil, mime = 'application/json')
Method send_post_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_post_request(connection, url, options, data, custom_params = nil)
Method parse_options
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_options(options)
headers = nil
query_params = []
url_prefix = nil
consistency = []
- 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"