app/models/setup/cross_collection_pull_parameter.rb
Method process_on
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
Open
def process_on(hash_data, options = {})
options ||= {}
errors.clear
properties_locations.each do |property_location|
property_location.errors.clear
- 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 schema
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def schema
# TODO: Factorize code with algorithms and applications parameters
sch =
if type.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"
Further reading
Method process_on
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def process_on(hash_data, options = {})
options ||= {}
errors.clear
properties_locations.each do |property_location|
property_location.errors.clear
Avoid deeply nested control flow statements. Open
Open
if (value = options[:value]).nil?
obj.delete(property_name) unless options[:keep_values]
else
obj[property_name] = value
end