Feature prerequisite info#16
Conversation
| "/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
| "/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
| if (block.isCompleted()) { | ||
| painterResource(R.drawable.course_ic_task_alt) | ||
| } | ||
| else if (block.isGated()) { |
Check warning
Code scanning / detekt
Reports spaces around keywords Warning
| if (block.isCompleted()) { | ||
| MaterialTheme.appColors.primary | ||
| } | ||
| else if (block.isGated()) { |
Check warning
Code scanning / detekt
Reports spaces around keywords Warning
| 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
| 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
|
|
||
| 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
| * 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
|
|
||
| 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
| 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
No description provided.