Showing 33 of 42 total issues
Method validate_value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_value(value, context)
if @type_to_match == DateTime
dt_string = if value.instance_of?(DateTime) && context.date_time_converter
context.date_time_converter.call(value)
else
- 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 clean_url
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.clean_url(url)
# Perform parameter validation.
raise ArgumentError, 'Invalid Url.' unless url.instance_of? String
# Ensure that the urls are absolute.
- 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 valid_type?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.valid_type?(value, type_callable, is_model_hash: false, is_inner_model_hash: false)
if value.is_a?(Array)
value.all? do |item|
valid_type?(item, type_callable,
is_model_hash: is_model_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 apply_deserializer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply_deserializer(response, should_symbolize_hash)
return apply_xml_deserializer(response) if @is_xml_response
return response.raw_body if @deserializer.nil?
if @datetime_format
- 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 validate_value_against_case
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_value_against_case(value, context)
if context.is_array && context.is_dict && context.is_array_of_dict
validate_array_of_dict_case(value)
elsif context.is_array && context.is_dict
validate_dict_of_array_case(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 valid_date?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.valid_date?(date_value)
if date_value.instance_of?(Date)
true
elsif date_value.instance_of?(String) && date_value.match?(/^\d{4}-\d{2}-\d{2}$/)
DateTime.strptime(date_value, '%Y-%m-%d')
- 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 resolve_template_placeholders_using_json_pointer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.resolve_template_placeholders_using_json_pointer(placeholders, value, template)
placeholders.each do |placeholder|
extracted_value = ''
if placeholder.include? '#'
# pick the 2nd chunk then remove the last character (i.e. `}`) of the string 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 _validate_value_against_case
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _validate_value_against_case(value, context)
if context.is_array && context.is_dict && context.is_array_of_dict
@is_valid, @collection_cases = UnionTypeHelper.validate_array_of_dict_case(@union_types, value,
true)
elsif context.is_array && context.is_dict
- 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 from_element_to_array
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_element_to_array(parent, item_name, clazz,
wrapping_element_name: nil,
datetime_format: nil)
elements = if wrapping_element_name.nil?
parent.xpath(item_name)
- 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 deserialize_value_against_case
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def deserialize_value_against_case(value, context, should_symbolize: false)
if context.is_array && context.is_dict && context.is_array_of_dict
deserialize_array_of_dict_case(value, should_symbolize: should_symbolize)
elsif context.is_array && context.is_dict
deserialize_dict_of_array_case(value, should_symbolize: should_symbolize)
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute
_client_configuration = @global_configuration.client_configuration
begin
if _client_configuration.http_client.nil?
raise ArgumentError, 'An HTTP client instance is required to execute an Api call.'
- 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 validate_value_against_case
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_value_against_case(value, context)
if context.is_array && context.is_dict && context.is_array_of_dict
@is_valid, @collection_cases = UnionTypeHelper.validate_array_of_dict_case(@union_types, value,
false)
elsif context.is_array && context.is_dict
- 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 serialize_value_against_case
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def serialize_value_against_case(value, context)
if context.is_array && context.is_dict && context.is_array_of_dict
serialize_array_of_dict_case(value)
elsif context.is_array && context.is_dict
serialize_dict_of_array_case(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"