Method preview_sort_name
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def preview_sort_name(target)
result = ""
case target['jsonmodel_type']
when 'name_person'
- 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 parse_selections
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse_selections(selections, path=[], all_values={})
selections.each_pair do |k, v|
path << k
position = selections['position']
- 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 preview_sort_name
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def preview_sort_name(target)
result = ""
case target['jsonmodel_type']
when 'name_person'
Method merge_details
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def merge_details(target, victim, selections, params)
target[:linked_events] = []
victim[:linked_events] = []
subrec_add_replacements = []
- 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 merge_details
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge_details(target, victim, selections, params)
target[:linked_events] = []
victim[:linked_events] = []
subrec_add_replacements = []
Method parse_selections
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_selections(selections, path=[], all_values={})
selections.each_pair do |k, v|
path << k
position = selections['position']
Method process_subrecord_for_merge
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process_subrecord_for_merge(target, subrecord, jsonmodel_type, mode, ind)
target_id = target['id']
if jsonmodel_type == 'names'
# an agent name can only have one authorized or display 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 process_subrecord_for_merge
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_subrecord_for_merge(target, subrecord, jsonmodel_type, mode, ind)
Method set_agent_id
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_agent_id(target_id, subrecord)
if subrecord['agent_person_id']
subrecord['agent_person_id'] = target_id
elsif subrecord['agent_family_id']
- 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"