Showing 8 of 8 total issues
Method recommended_EECS_courses
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def recommended_EECS_courses(ignore_flag)
draft_schedule = Utils.draft_schedule
semesters = {
fall: {
courses: {},
Method can_take
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def can_take(course_number, ignore_flag)
if Course.exists?(number: course_number)
course = Course.find_by(number: course_number)
if has_taken(course)
return false
- 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 get_course_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_course_data(course_list, term_list)
course_list.map! { |course_number| [Course.find_by(number: course_number),
term_list[course_number].split(";")]}
#get_average_rating_of_professors(term_list[course_number].split(";"))] }
course_list.each do |data|
- 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 recommended_EECS_courses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def recommended_EECS_courses(ignore_flag)
draft_schedule = Utils.draft_schedule
semesters = {
fall: {
courses: {},
- 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 filter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.filter
map = {}
self.all.each do |course|
department = course.number[0..1]
course.number =~ /(\d+)/
- 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 recommended_breadth_courses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def recommended_breadth_courses
fall_breadth_courses = Utils.breadth_schedule
distinguished_fall_breadth_courses = []
fall_breadth_courses.each do |course|
professor = Professor.find_by(name: course[2])
- 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
Avoid too many return
statements within this method. Open
return false
Method create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
@user = User.create(first_name: params[:first_name],
last_name: params[:last_name], email: params[:email],
uid: session[:cas_user])
if not @user.valid?
- 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"