Skip to content

Course: Add support for resource sequencing in course and session views - refs rna-22586 #6330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

christianbeeznest
Copy link
Contributor

No description provided.

* @param {number=} sessionId - Optional session ID.
* @returns {Promise<{ available: boolean, nextCourse: object|null }>}
*/
getNextCourse: async (courseId, sessionId = 0) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

return $result;
}

private function checkRequirementsOrDependentsForUser(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method checkRequirementsOrDependentsForUser has 63 lines of code (exceeds 25 allowed). Consider refactoring.

);
}

private function getRequirementsOrDependents(int $resourceId, int $resourceType, string $itemType): array
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method getRequirementsOrDependents has 36 lines of code (exceeds 25 allowed). Consider refactoring.

return $result;
}

private function checkRequirementsOrDependentsForUser(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function checkRequirementsOrDependentsForUser has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.

);
}

private function getRequirementsOrDependents(int $resourceId, int $resourceType, string $itemType): array
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function getRequirementsOrDependents has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.

@christianbeeznest christianbeeznest marked this pull request as ready for review June 9, 2025 04:31
import { ref } from "vue"
import courseService from "../../services/courseService"

export function useCourseRequirementStatus(courseId, sessionId, onLockChange = null) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function useCourseRequirementStatus has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.

import { ref } from "vue"
import courseService from "../../services/courseService"

export function useCourseRequirementStatus(courseId, sessionId, onLockChange = null) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function useCourseRequirementStatus has 41 lines of code (exceeds 25 allowed). Consider refactoring.

const graphImage = ref(null)
const loading = ref(true)

async function fetchStatus() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function fetchStatus has 26 lines of code (exceeds 25 allowed). Consider refactoring.

Copy link

codeclimate bot commented Jun 9, 2025

Code Climate has analyzed commit f9d8f5e and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3
Duplication 2

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant