Showing 9 of 15 total issues
Method matching_hashes?
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def matching_hashes?(actuals, expected)
return false unless actuals.keys.sort == expected.keys.sort
actuals.each do |key, actual|
expect = expected[key]
- 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 make_method_to_alter_response_array_object
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make_method_to_alter_response_array_object
@response_array_item.each do |field|
field_name = field[0]
actual_field_value = field[1]
is_array = (actual_field_value.class.to_s == "Array")
Method make_method_to_alter_response_array_object
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def make_method_to_alter_response_array_object
@response_array_item.each do |field|
field_name = field[0]
actual_field_value = field[1]
is_array = (actual_field_value.class.to_s == "Array")
- 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 generate_method_to_alter_request_array_object
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def generate_method_to_alter_request_array_object
@request_array_item.each do |field|
field_name = field[0]
actual_field_value = field[1]
is_array = (actual_field_value.class.to_s == "Array")
- 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
Avoid too many return
statements within this method. Open
return matching_array? actual_req_body,stub_req_body if actual_req_body.is_a?(Array)
Method matching_array
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def matching_array actuals,expected
return false unless actuals.size == expected.size
return actuals.sort == expected.sort unless actual[0].is_a(Hash)
expect = expected.clone
actuals.each do |actual|
- 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 load_stub_configs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_stub_configs
explolded_configs = Dir["#{@folder}/**/config.yml"]
inline_configs = Dir["#{@folder}/**/*.yml"] - ( (explolded_configs.nil?) ? [] : explolded_configs) - [@domain.file]
generate_exploded_config explolded_configs unless explolded_configs.nil?
generate_inline_config inline_configs unless inline_configs.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 body_matches?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def body_matches? actual_req,stub_req
return true if actual_req.body == stub_req.body
actual_req_body = load_as_json actual_req.body
stub_req_body = load_as_json stub_req.body
return false unless actual_req_body.class == stub_req_body.class
- 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 make_method_to_append_response_array
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_method_to_append_response_array
class_name = self.name.classify.underscore
method_name = "has_#{class_name}"
define_method(method_name) do |*input_value|
assignment_value = input_value.blank? ?
- 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"