scripts/import_casa_case_date_of_birth.rb
Method process_casa_case_date
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def process_casa_case_date(cc, import_date, case_number, already_has_nonmatching_date, no_edit_made, updated_casa_cases, case_not_found)
Method update_casa_case_dates_of_birth
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def update_casa_case_dates_of_birth(data, case_not_found, already_has_nonmatching_date, no_edit_made, updated_casa_cases)
Method process_casa_case_date
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def process_casa_case_date(cc, import_date, case_number, already_has_nonmatching_date, no_edit_made, updated_casa_cases, case_not_found)
if cc&.birth_month_year_youth
if !dates_match(cc, d2)
already_has_nonmatching_date << {case_number: case_number, prev_date: cc.birth_month_year_youth, import_date: d2}
else
- 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"