Skip to content

Feature prerequisite info#17

Merged
yogeshbhagatcode merged 6 commits into
sherab-devfrom
feature-prerequisite-info
Nov 20, 2025
Merged

Feature prerequisite info#17
yogeshbhagatcode merged 6 commits into
sherab-devfrom
feature-prerequisite-info

Conversation

@yogeshbhagatcode

Copy link
Copy Markdown
Collaborator

No description provided.

@yogeshbhagatcode yogeshbhagatcode self-assigned this Nov 20, 2025
@yogeshbhagatcode yogeshbhagatcode merged commit 257ca1b into sherab-dev Nov 20, 2025
1 of 4 checks passed
"/api/mobile/{api_version}/course_info/blocks/?" +
"depth=all&" +
"requested_fields=contains_gated_content,show_gated_sections,special_exam_info,graded,format," +
"requested_fields=contains_gated_content,show_gated_sections,gated_content,special_exam_info,graded,format," +

Check warning

Code scanning / detekt

Reports lines with exceeded length Warning

Exceeded max line length (120)
"/api/mobile/{api_version}/course_info/blocks/?" +
"depth=all&" +
"requested_fields=contains_gated_content,show_gated_sections,special_exam_info,graded,format," +
"requested_fields=contains_gated_content,show_gated_sections,gated_content,special_exam_info,graded,format," +

Check warning

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Warning

Line detected, which is longer than the defined maximum line length in the code style.
if (block.isCompleted()) {
painterResource(R.drawable.course_ic_task_alt)
}
else if (block.isGated()) {

Check warning

Code scanning / detekt

Reports spaces around keywords Warning

Unexpected newline before "else"
if (block.isCompleted()) {
MaterialTheme.appColors.primary
}
else if (block.isGated()) {

Check warning

Code scanning / detekt

Reports spaces around keywords Warning

Unexpected newline before "else"
import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.compose.foundation.layout.*

Check warning

Code scanning / detekt

Detects wildcard imports Warning

Wildcard import
get() = networkConnection.isOnline()

fun loadBlocks(mode: CourseViewMode, componentId: String = "") {
fun loadBlocks(mode: CourseViewMode, componentId: String = "", forceRefresh: Boolean = false) {

Check warning

Code scanning / detekt

Prefer splitting up complex methods into smaller, easier to test methods. Warning

The function loadBlocks appears to be too complex based on Cyclomatic Complexity (complexity: 24). Defined complexity threshold for methods is set to '15'

val firstDescendant = if (targetBlock?.descendants?.isNotEmpty() == true) {
preliminaryStructure.blockData.firstOrNull { it.id == targetBlock.descendants.first() }
} else null

Check warning

Code scanning / detekt

Detects multiline if-else statements without braces Warning

Missing { ... }
* Only performs API call if we were tracking a prerequisite that was incomplete.
* Returns true if prerequisite completion status changed from incomplete to complete.
*/
suspend fun shouldRefreshForPrerequisiteCompletion(): Boolean {

Check warning

Code scanning / detekt

Restrict the number of return statements in methods. Warning

Function shouldRefreshForPrerequisiteCompletion has 4 return statements which exceeds the limit of 2.

val firstDescendant = if (!isBlockGatedWithPrereq && block.descendants.isNotEmpty()) {
blocks.firstOrNull { it.id == block.descendants.first() }
} else null

Check warning

Code scanning / detekt

Detects multiline if-else statements without braces Warning

Missing { ... }
suspend fun getBlockData() = try {
courseInteractor.getCourseStructure(courseId, false)
.blockData.find { it.id == blockId }
} catch (e: Exception) {

Check warning

Code scanning / detekt

The caught exception is swallowed. The original exception could be lost. Warning

The caught exception is swallowed. The original exception could be lost.
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.

2 participants