Showing 24 of 28 total issues
Avoid too many return
statements within this method. Open
return [nil, err] if err
Method validate_datetime_format
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_datetime_format(value, schema)
return [value, nil] unless schema.format == 'date-time'
begin
if @datetime_coerce_class.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 validate_schema
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_schema(value, schema, **keyword_args)
return [value, nil] unless schema
if (v = validator(value, schema))
if keyword_args.empty?
- 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_header
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_header(response_headers)
return unless headers
headers.each do |name, schema|
next unless response_headers.key?(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"