app/controllers/concerns/course/lesson_plan/strategies/stragglers_personalization_strategy.rb
Method cannot_shift_item
has 5 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
Wontfix
def cannot_shift_item(course_user, item, submitted_items, reference_point, items_to_shift)
- Create a ticketCreate a ticket
Method shift_end_at
has 5 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
Wontfix
def shift_end_at(personal_time, reference_time, personal_point, reference_point, learning_rate_ema)
- Create a ticketCreate a ticket
Method update_points
has 5 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
Wontfix
def update_points(course_user, item, submitted_items, reference_point, personal_point)
- Create a ticketCreate a ticket
Method execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Wontfix
Wontfix
def execute(course_user, precomputed_data, items_to_shift = nil) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
return if precomputed_data[:learning_rate_ema].nil?
@course_tz = course_user.course.time_zone
reference_point = personal_point = precomputed_data[:items].first.reference_time_for(course_user).end_at
- Read upRead up
- Create a ticketCreate a ticket
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"