Method update_available_points
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def update_available_points
@rust_data['exercises'].each do |exercise|
added = []
removed = []
- 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 refresh_course
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def refresh_course(course, data)
@report = Report.new
@rust_data = data['output-data']
Course.transaction(requires_new: true) do
@course = Course.find(course.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"
Further reading
Method update_exercise_checksums
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_exercise_checksums
@rust_data['exercises'].each do |exercise|
ex = @course.exercises.find { |e| e.name == exercise['name'] }
next unless ex
if ex.checksum != exercise['checksum']
- 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 update_available_points
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_available_points
@rust_data['exercises'].each do |exercise|
added = []
removed = []
Method set_memory_limit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_memory_limit
@rust_data['exercises'].each do |exercise|
ex = @course.exercises.find { |e| e.name == exercise['name'] }
next unless ex
if (exercise['tmcproject-yml'] || {}).include? 'memory_gb'
- 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 set_docker_image
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_docker_image
default_image = Exercise.new.docker_image
@rust_data['exercises'].each do |exercise|
ex = @course.exercises.find { |e| e.name == exercise['name'] }
next unless ex
- 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 set_cpu_limit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_cpu_limit
@rust_data['exercises'].each do |exercise|
ex = @course.exercises.find { |e| e.name == exercise['name'] }
next unless ex
if (exercise['tmcproject-yml'] || {}).include? 'cpus'
- 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"