Showing 102 of 200 total issues
Function switchSection
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
switchSection(context, payload) {
// Remove old section from locked sections
context.commit(
'unlockSection',
`${payload.old.courseCode}${payload.old.sectionCode}`,
Function getUniqueCourses
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getUniqueCourses = (fallCourses, winterCourses) => {
const uniqueCourses = {};
const locks = [];
const [LOCK_STRING, LOCK_TERM_INDEX, COURSE_TERM_INDEX, LEC, PRA, TUT] = [
'Lock',
Function lockSectionOfCourse
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const lockSectionOfCourse = (courseSections, lockSections) => {
for (const course of courseSections) {
for (const section of lockSections) {
// const lockedSection = section.slice()
if (course.code === section.slice(0, section.length - 5)) {
Function lockSectionOfCourse
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const lockSectionOfCourse = (courseSections, lockSections) => {
for (const course of courseSections) {
for (const section of lockSections) {
if (course.code === section.slice(0, section.length - 5)) {
if (section[section.length - 5] === 'L') {
Consider simplifying this complex logical expression. Open
Open
if (
(timetable[day][section].start >= timetable[day][section2].start &&
timetable[day][section].start < timetable[day][section2].end) ||
(timetable[day][section].end > timetable[day][section2].start &&
timetable[day][section].end <= timetable[day][section2].end) ||
Function lockSection
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lockSection(state, payload) {
let index;
if (payload.slice(0, 4) === 'Lock') {
if (payload[4] === 'F') {
index = state.fallLockedSections.indexOf(payload);
Function unlockSection
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
unlockSection(state, payload) {
let index;
if (payload.slice(0, 4) === 'Lock') {
// Block hour
if (payload[4] === 'F') {
Function selectCourse
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
selectCourse(context, payload) {
// save the previous timetable by default
if (!payload.noSave) {
context.dispatch('saveTimetable');
}
Avoid deeply nested control flow statements. Open
Open
if (fallLectureCombo.founded === 1) {
return true;
}
Avoid deeply nested control flow statements. Open
Open
if (overlapExists(fallTimetable)) {
fallTimetable = createShallowCopyOfTimetable(
prevTimetable,
);
let j = -1;
Avoid deeply nested control flow statements. Open
Open
if (winterPracticalCombo.founded === 1) {
return true;
}
Avoid deeply nested control flow statements. Open
Open
if (overlapExists(fallTimetable)) {
fallTimetable = createShallowCopyOfTimetable(
prevTimetabletut,
);
let j = -1;
Avoid deeply nested control flow statements. Open
Open
if (tut2 !== -1) {
return courseSection[whichArray2].tutorial.some(
arrayElement2 => {
// Recursive case...
if (fallLectureCombo.founded === 1) {
Avoid deeply nested control flow statements. Open
Open
if (index === -1) {
state.fallLockedSections.push(payload);
state.winterLockedSections.push(payload);
}
Avoid deeply nested control flow statements. Open
Open
if (fallLectureCombo.founded === 1) {
return true;
}
Avoid deeply nested control flow statements. Open
Open
if (overlapExists(winterTimetable)) {
winterTimetable = createShallowCopyOfTimetable(
prevTimetable,
);
let j = -1;
Avoid deeply nested control flow statements. Open
Open
if (dayEvents[i].code === payload.code) {
dayEvents.splice(i, 1);
break;
}
Avoid deeply nested control flow statements. Open
Open
for (const lecture of course.lecture) {
if (lecture.sectionCode === section.slice(section.length - 5)) {
course.lecture = [lecture];
}
}
Avoid deeply nested control flow statements. Open
Open
if (winterLectureCombo.founded === 1) {
return true;
}
Avoid deeply nested control flow statements. Open
Open
if (tut2 !== -1) {
return courseSection[whichArray2].tutorial.some(
arrayElement2 => {
// Recursive case...
if (fallLectureCombo.founded === 1) {