Showing 24 of 35 total issues
Method _define_getter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _define_getter(attribute, options)
skip_option = Array(options.fetch(:skip, []))
return nil if skip_option.include?(:reader) || skip_option.include?(:getter)
variable_name = "@#{attribute}"
- 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 mock_gateway_not_found_response
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mock_gateway_not_found_response(method:,
path:,
body: nil,
json_body: true,
timeout: 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 get_model
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_model(model_dao_name, primary_key)
model_dao_name = model_dao_name.to_s
primary_key = primary_key.to_s
return nil unless model_dao_name.present? && primary_key.present?
- 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_array
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.from_array(array, total: nil, page_number: nil, per_page: nil)
self.new(-> (x) { x }, response: {}).tap do |obj|
total ||= array.length
per_page = per_page.to_i
- 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"