coding-blocks/CBOnlineApp

View on GitHub

Showing 616 of 862 total issues

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

    fun searchCourses(query: String) {
        runIO {
            when (val response = repo.findCourses(query)) {
                is ResultWrapper.GenericError -> setError(response.error)
                is ResultWrapper.Success -> with(response.value) {
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TrackViewModel.kt on lines 59..72

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 179.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

data class CourseInstructorPair(
    @Embedded
    var courseRun: CourseRunPair,
    @Relation(
        parentColumn = "cid",
app/src/main/java/com/codingblocks/cbonlineapp/database/models/SectionContentHolder.kt on lines 25..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 179.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    companion object {

        private val diffCallback = object : DiffUtil.ItemCallback<Leaderboard>() {
            override fun areItemsTheSame(oldItem: Leaderboard, newItem: Leaderboard): Boolean =
                oldItem.sameAndEqual(newItem)
app/src/main/java/com/codingblocks/cbonlineapp/admin/doubts/AdminDoubtsListAdapter.kt on lines 44..53
app/src/main/java/com/codingblocks/cbonlineapp/admin/overview/AdminLeaderBoardListAdapter.kt on lines 34..43

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 175.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    companion object {

        private val diffCallback = object : DiffUtil.ItemCallback<DoubtLeaderBoard>() {
            override fun areItemsTheSame(oldItem: DoubtLeaderBoard, newItem: DoubtLeaderBoard): Boolean =
                oldItem.sameAndEqual(newItem)
app/src/main/java/com/codingblocks/cbonlineapp/admin/doubts/AdminDoubtsListAdapter.kt on lines 44..53
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/overview/LeaderBoardListAdapter.kt on lines 12..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 175.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    companion object {

        private val diffCallback = object : DiffUtil.ItemCallback<Doubts>() {
            override fun areItemsTheSame(oldItem: Doubts, newItem: Doubts): Boolean =
                oldItem.sameAndEqual(newItem)
app/src/main/java/com/codingblocks/cbonlineapp/admin/overview/AdminLeaderBoardListAdapter.kt on lines 34..43
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/overview/LeaderBoardListAdapter.kt on lines 12..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 175.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            getString(R.string.notes) -> {
                libraryListAdapter = LibraryListAdapter(LibraryTypes.NOTE)
                vm.fetchNotes().observe(thisLifecycleOwner) {
                    if (it.isNullOrEmpty()) {
                        libraryListAdapter.submitList(emptyList())
app/src/main/java/com/codingblocks/cbonlineapp/library/LibraryViewFragment.kt on lines 121..131

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 169.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            getString(R.string.bookmarks) -> {
                libraryListAdapter = LibraryListAdapter(LibraryTypes.BOOKMARK)
                vm.fetchBookmarks().observe(thisLifecycleOwner) {
                    if (it.isNullOrEmpty()) {
                        libraryListAdapter.submitList(emptyList())
app/src/main/java/com/codingblocks/cbonlineapp/library/LibraryViewFragment.kt on lines 109..119

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 169.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    private val itemClickListener: ItemClickListener by lazy {
        object : ItemClickListener {

            override fun onClick(id: String, runId: String, runAttemptId: String, name: String) {
                startActivity(
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/mycourses/DashboardMyCoursesFragment.kt on lines 41..53

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 166.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    private val itemClickListener: ItemClickListener by lazy {
        object : ItemClickListener {

            override fun onClick(id: String, runId: String, runAttemptId: String, name: String) {
                startActivity(
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/library/DashboardLibraryFragment.kt on lines 29..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 166.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

    class DiffCallback : DiffUtil.ItemCallback<BaseModel>() {
        override fun areItemsTheSame(oldItem: BaseModel, newItem: BaseModel): Boolean {
            return oldItem.id == newItem.id
        }

app/src/main/java/com/codingblocks/cbonlineapp/commons/InstructorListAdapter.kt on lines 50..58
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseProjectAdapter.kt on lines 34..42
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseSectionListAdapter.kt on lines 120..128
app/src/main/java/com/codingblocks/cbonlineapp/course/adapter/CourseDiffUtil.kt on lines 7..15
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunListAdapter.kt on lines 88..96
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/CommentsListAdapter.kt on lines 52..60
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtListAdapter.kt on lines 98..106
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionListAdapter.kt on lines 47..55
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TracksListAdapter.kt on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

    class DiffCallback : DiffUtil.ItemCallback<Instructor>() {
        override fun areItemsTheSame(oldItem: Instructor, newItem: Instructor): Boolean {
            return oldItem.id == newItem.id
        }

app/src/main/java/com/codingblocks/cbonlineapp/course/CourseProjectAdapter.kt on lines 34..42
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseSectionListAdapter.kt on lines 120..128
app/src/main/java/com/codingblocks/cbonlineapp/course/adapter/CourseDiffUtil.kt on lines 7..15
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/BatchListAdapter.kt on lines 44..52
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunListAdapter.kt on lines 88..96
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/CommentsListAdapter.kt on lines 52..60
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtListAdapter.kt on lines 98..106
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionListAdapter.kt on lines 47..55
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TracksListAdapter.kt on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

    class DiffCallback : DiffUtil.ItemCallback<Project>() {
        override fun areItemsTheSame(oldItem: Project, newItem: Project): Boolean {
            return oldItem.id == newItem.id
        }

app/src/main/java/com/codingblocks/cbonlineapp/commons/InstructorListAdapter.kt on lines 50..58
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseSectionListAdapter.kt on lines 120..128
app/src/main/java/com/codingblocks/cbonlineapp/course/adapter/CourseDiffUtil.kt on lines 7..15
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/BatchListAdapter.kt on lines 44..52
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunListAdapter.kt on lines 88..96
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/CommentsListAdapter.kt on lines 52..60
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtListAdapter.kt on lines 98..106
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionListAdapter.kt on lines 47..55
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TracksListAdapter.kt on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

    class DiffCallback : DiffUtil.ItemCallback<CommentModel>() {
        override fun areItemsTheSame(oldItem: CommentModel, newItem: CommentModel): Boolean {
            return oldItem.id == newItem.id
        }

app/src/main/java/com/codingblocks/cbonlineapp/commons/InstructorListAdapter.kt on lines 50..58
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseProjectAdapter.kt on lines 34..42
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseSectionListAdapter.kt on lines 120..128
app/src/main/java/com/codingblocks/cbonlineapp/course/adapter/CourseDiffUtil.kt on lines 7..15
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/BatchListAdapter.kt on lines 44..52
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunListAdapter.kt on lines 88..96
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtListAdapter.kt on lines 98..106
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionListAdapter.kt on lines 47..55
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TracksListAdapter.kt on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

    class DiffCallback : DiffUtil.ItemCallback<CareerTracks>() {
        override fun areItemsTheSame(oldItem: CareerTracks, newItem: CareerTracks): Boolean {
            return oldItem.id == newItem.id
        }

app/src/main/java/com/codingblocks/cbonlineapp/commons/InstructorListAdapter.kt on lines 50..58
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseProjectAdapter.kt on lines 34..42
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseSectionListAdapter.kt on lines 120..128
app/src/main/java/com/codingblocks/cbonlineapp/course/adapter/CourseDiffUtil.kt on lines 7..15
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/BatchListAdapter.kt on lines 44..52
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunListAdapter.kt on lines 88..96
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/CommentsListAdapter.kt on lines 52..60
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtListAdapter.kt on lines 98..106
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionListAdapter.kt on lines 47..55

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

class CourseDiffUtil : DiffUtil.ItemCallback<Course>() {
    override fun areItemsTheSame(oldItem: Course, newItem: Course): Boolean {
        return oldItem.id == newItem.id
    }

app/src/main/java/com/codingblocks/cbonlineapp/commons/InstructorListAdapter.kt on lines 50..58
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseProjectAdapter.kt on lines 34..42
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseSectionListAdapter.kt on lines 120..128
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/BatchListAdapter.kt on lines 44..52
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunListAdapter.kt on lines 88..96
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/CommentsListAdapter.kt on lines 52..60
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtListAdapter.kt on lines 98..106
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionListAdapter.kt on lines 47..55
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TracksListAdapter.kt on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

class DiffCallback : DiffUtil.ItemCallback<Runs>() {
    override fun areItemsTheSame(oldItem: Runs, newItem: Runs): Boolean {
        return oldItem.id == newItem.id
    }

app/src/main/java/com/codingblocks/cbonlineapp/commons/InstructorListAdapter.kt on lines 50..58
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseProjectAdapter.kt on lines 34..42
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseSectionListAdapter.kt on lines 120..128
app/src/main/java/com/codingblocks/cbonlineapp/course/adapter/CourseDiffUtil.kt on lines 7..15
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/BatchListAdapter.kt on lines 44..52
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/CommentsListAdapter.kt on lines 52..60
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtListAdapter.kt on lines 98..106
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionListAdapter.kt on lines 47..55
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TracksListAdapter.kt on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

    class DiffCallback : DiffUtil.ItemCallback<QuizAttempt>() {
        override fun areItemsTheSame(oldItem: QuizAttempt, newItem: QuizAttempt): Boolean {
            return oldItem.id == newItem.id
        }

app/src/main/java/com/codingblocks/cbonlineapp/commons/InstructorListAdapter.kt on lines 50..58
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseProjectAdapter.kt on lines 34..42
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseSectionListAdapter.kt on lines 120..128
app/src/main/java/com/codingblocks/cbonlineapp/course/adapter/CourseDiffUtil.kt on lines 7..15
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/BatchListAdapter.kt on lines 44..52
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunListAdapter.kt on lines 88..96
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/CommentsListAdapter.kt on lines 52..60
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtListAdapter.kt on lines 98..106
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TracksListAdapter.kt on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

    class DiffCallback : DiffUtil.ItemCallback<DoubtsModel>() {
        override fun areItemsTheSame(oldItem: DoubtsModel, newItem: DoubtsModel): Boolean {
            return oldItem.dbtUid == newItem.dbtUid
        }

app/src/main/java/com/codingblocks/cbonlineapp/commons/InstructorListAdapter.kt on lines 50..58
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseProjectAdapter.kt on lines 34..42
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseSectionListAdapter.kt on lines 120..128
app/src/main/java/com/codingblocks/cbonlineapp/course/adapter/CourseDiffUtil.kt on lines 7..15
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/BatchListAdapter.kt on lines 44..52
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunListAdapter.kt on lines 88..96
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/CommentsListAdapter.kt on lines 52..60
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionListAdapter.kt on lines 47..55
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TracksListAdapter.kt on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 10 locations. Consider refactoring.
Open

    class DiffCallback : DiffUtil.ItemCallback<Sections>() {
        override fun areItemsTheSame(oldItem: Sections, newItem: Sections): Boolean {
            return oldItem.id == newItem.id
        }

app/src/main/java/com/codingblocks/cbonlineapp/commons/InstructorListAdapter.kt on lines 50..58
app/src/main/java/com/codingblocks/cbonlineapp/course/CourseProjectAdapter.kt on lines 34..42
app/src/main/java/com/codingblocks/cbonlineapp/course/adapter/CourseDiffUtil.kt on lines 7..15
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/BatchListAdapter.kt on lines 44..52
app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunListAdapter.kt on lines 88..96
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/CommentsListAdapter.kt on lines 52..60
app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtListAdapter.kt on lines 98..106
app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionListAdapter.kt on lines 47..55
app/src/main/java/com/codingblocks/cbonlineapp/tracks/TracksListAdapter.kt on lines 75..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 160.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        if (response.isSuccessful) {
            response.body()?.let {
                downloadList[downloadData.videoId] = (downloadData)
                val mOtp = it.get("otp").asString
                val mPlaybackInfo = it.get("playbackInfo").asString
app/src/main/java/com/codingblocks/cbonlineapp/workers/SectionDownloadService.kt on lines 125..132
app/src/main/java/com/codingblocks/cbonlineapp/workers/SectionDownloadWorker.kt on lines 79..86

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 156.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language