core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts

Summary

Maintainability
F
2 wks
Test Coverage

File learner-dashboard-backend-api.service.spec.ts has 828 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2021 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

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

      it(
        'should use rejection handler if learner dashboard collections ' +
          'data backend request failed',
        fakeAsync(() => {
          let successHandler = jasmine.createSpy('success');
    core/templates/domain/feedback_updates/feedback-updates-backend-api.service.spec.ts on lines 95..123
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 658..688
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 722..752
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 754..784

    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 176.

    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 5 locations. Consider refactoring.
    Open

      it(
        'should use rejection handler if learner dashboard explorations ' +
          'data backend request failed',
        fakeAsync(() => {
          let successHandler = jasmine.createSpy('success');
    core/templates/domain/feedback_updates/feedback-updates-backend-api.service.spec.ts on lines 95..123
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 658..688
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 690..720
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 754..784

    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 176.

    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 5 locations. Consider refactoring.
    Open

      it(
        'should use rejection handler if learner dashboard topics and stories ' +
          'data backend request failed',
        fakeAsync(() => {
          let successHandler = jasmine.createSpy('success');
    core/templates/domain/feedback_updates/feedback-updates-backend-api.service.spec.ts on lines 95..123
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 690..720
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 722..752
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 754..784

    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 176.

    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 5 locations. Consider refactoring.
    Open

      it(
        'should use rejection handler if learner completed chapters count ' +
          'data backend request failed',
        fakeAsync(() => {
          let successHandler = jasmine.createSpy('success');
    core/templates/domain/feedback_updates/feedback-updates-backend-api.service.spec.ts on lines 95..123
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 658..688
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 690..720
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 722..752

    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 176.

    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

        let sampleLearnerTopicSummaryBackendDict = {
          id: 'sample_topic_id',
          name: 'Topic Name',
          language_code: 'en',
          description: 'description',
    core/templates/components/summary-tile/learner-topic-summary-tile.component.spec.ts on lines 74..110
    core/templates/components/summary-tile/learner-topic-summary-tile.component.spec.ts on lines 157..193
    core/templates/domain/topic/learner-topic-summary.model.spec.ts on lines 55..91
    core/templates/pages/learner-dashboard-page/goals-tab.component.spec.ts on lines 119..155
    core/templates/pages/learner-dashboard-page/goals-tab.component.spec.ts on lines 193..229
    core/templates/pages/learner-dashboard-page/home-tab.component.spec.ts on lines 96..132
    core/templates/pages/learner-dashboard-page/progress-tab.component.spec.ts on lines 248..284
    core/templates/pages/learner-dashboard-page/progress-tab.component.spec.ts on lines 293..329
    core/templates/pages/learner-dashboard-page/progress-tab.component.spec.ts on lines 370..406

    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 173.

    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 5 locations. Consider refactoring.
    Open

        topics_to_learn_list: [
          {
            id: 'sample_topic_id',
            name: 'Topic Name',
            language_code: 'en',
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 70..107
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 108..145
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 184..221
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 222..259

    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 168.

    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 5 locations. Consider refactoring.
    Open

        learnt_topics_list: [
          {
            id: 'sample_topic_id',
            name: 'Topic Name',
            language_code: 'en',
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 108..145
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 146..183
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 184..221
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 222..259

    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 168.

    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 5 locations. Consider refactoring.
    Open

        partially_learnt_topics_list: [
          {
            id: 'sample_topic_id',
            name: 'Topic Name',
            language_code: 'en',
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 70..107
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 146..183
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 184..221
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 222..259

    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 168.

    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 5 locations. Consider refactoring.
    Open

        untracked_topics_list: [
          {
            id: 'sample_topic_id',
            name: 'Topic Name',
            language_code: 'en',
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 70..107
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 108..145
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 146..183
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 184..221

    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 168.

    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 5 locations. Consider refactoring.
    Open

        all_topics_list: [
          {
            id: 'sample_topic_id',
            name: 'Topic Name',
            language_code: 'en',
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 70..107
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 108..145
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 146..183
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 222..259

    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 168.

    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 4 locations. Consider refactoring.
    Open

      it(
        'should successfully fetch learner dashboard collections data ' +
          'from the backend',
        fakeAsync(() => {
          let successHandler = jasmine.createSpy('success');
    core/templates/domain/feedback_updates/feedback-updates-backend-api.service.spec.ts on lines 73..93
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 505..527
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 553..575

    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 157.

    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 4 locations. Consider refactoring.
    Open

      it(
        'should successfully fetch learner dashboard explorations data ' +
          'from the backend',
        fakeAsync(() => {
          let successHandler = jasmine.createSpy('success');
    core/templates/domain/feedback_updates/feedback-updates-backend-api.service.spec.ts on lines 73..93
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 505..527
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 529..551

    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 157.

    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 4 locations. Consider refactoring.
    Open

      it(
        'should successfully fetch learner dashboard topics and stories data ' +
          'from the backend',
        fakeAsync(() => {
          let successHandler = jasmine.createSpy('success');
    core/templates/domain/feedback_updates/feedback-updates-backend-api.service.spec.ts on lines 73..93
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 529..551
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 553..575

    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 157.

    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

      it("should successfully fetch learner's completed chapters count data", fakeAsync(() => {
        let successHandler = jasmine.createSpy('success');
        let failHandler = jasmine.createSpy('fail');
    
        learnerDashboardBackendApiService
    core/templates/domain/creator_dashboard/creator-dashboard-backend-api.service.spec.ts on lines 218..234

    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 153.

    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

        completed_explorations_list: [
          {
            category: 'Welcome',
            created_on_msec: 1564183471833.675,
            community_owned: true,
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 403..428

    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 116.

    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

        exploration_playlist: [
          {
            category: 'Welcome',
            created_on_msec: 1564183471833.675,
            community_owned: true,
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 434..459

    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 116.

    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 20 locations. Consider refactoring.
    Open

        let nodeDict = {
          id: 'node_1',
          thumbnail_filename: 'image.png',
          title: 'Title 1',
          description: 'Description 1',
    core/templates/components/summary-tile/learner-story-summary-tile.component.spec.ts on lines 87..104
    core/templates/components/summary-tile/learner-topic-summary-tile.component.spec.ts on lines 56..73
    core/templates/components/summary-tile/learner-topic-summary-tile.component.spec.ts on lines 139..156
    core/templates/domain/learner_group/learner-group-syllabus-backend-api.service.spec.ts on lines 43..60
    core/templates/domain/learner_group/learner-group-syllabus.model.spec.ts on lines 32..49
    core/templates/domain/learner_group/learner-group-user-progress.model.spec.ts on lines 33..50
    core/templates/domain/story/story-node.model.spec.ts on lines 151..168
    core/templates/domain/story/story-node.model.spec.ts on lines 183..200
    core/templates/domain/story/story-summary.model.spec.ts on lines 26..43
    core/templates/domain/topic/learner-topic-summary.model.spec.ts on lines 36..53
    core/templates/domain/topic_viewer/read-only-topic-object.factory.spec.ts on lines 32..49
    core/templates/pages/learner-dashboard-page/goals-tab.component.spec.ts on lines 101..118
    core/templates/pages/learner-dashboard-page/home-tab.component.spec.ts on lines 78..95
    core/templates/pages/learner-dashboard-page/progress-tab.component.spec.ts on lines 101..118
    core/templates/pages/learner-dashboard-page/progress-tab.component.spec.ts on lines 230..247
    core/templates/pages/learner-dashboard-page/progress-tab.component.spec.ts on lines 352..369
    core/templates/pages/learner-group-pages/edit-group/learner-group-learner-specific-progress.component.spec.ts on lines 61..78
    core/templates/pages/learner-group-pages/edit-group/learner-group-learners-progress.component.spec.ts on lines 66..83
    core/templates/pages/learner-group-pages/edit-group/learner-group-overview.component.spec.ts on lines 61..78

    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 94.

    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 17 locations. Consider refactoring.
    Open

      beforeEach(() => {
        TestBed.configureTestingModule({
          imports: [HttpClientTestingModule],
          providers: [LearnerDashboardBackendApiService],
        });
    core/templates/domain/creator_dashboard/creator-dashboard-backend-api.service.spec.ts on lines 202..212
    core/templates/domain/feedback_updates/feedback-updates-backend-api.service.spec.ts on lines 58..67
    core/templates/domain/learner_dashboard/learner-dashboard-ids-backend-api.service.spec.ts on lines 57..67
    core/templates/domain/learner_group/facilitator-dashboard-backend-api.service.spec.ts on lines 41..51
    core/templates/domain/learner_group/learner-group-backend-api.service.spec.ts on lines 45..55
    core/templates/domain/learner_group/learner-group-syllabus-backend-api.service.spec.ts on lines 86..96
    core/templates/pages/exploration-editor-page/services/exploration-language-code.service.spec.ts on lines 29..37
    core/templates/pages/exploration-editor-page/services/history-tab-backend-api.service.spec.ts on lines 32..39
    core/templates/pages/exploration-player-page/services/learner-local-nav-backend-api.service.spec.ts on lines 35..42
    core/templates/pages/exploration-player-page/services/learner-view-info-backend-api.service.spec.ts on lines 31..38
    core/templates/pages/practice-session-page/practice-session-backend-api.service.spec.ts on lines 31..40
    core/templates/services/classifier-data-backend-api.service.spec.ts on lines 41..50
    core/templates/services/exploration-features-backend-api.service.spec.ts on lines 38..47
    core/templates/services/promo-bar-backend-api.service.spec.ts on lines 37..44
    core/templates/services/state-top-answers-stats-backend-api.service.spec.ts on lines 44..53
    extensions/interactions/EndExploration/directives/end-exploration-backend-api.service.spec.ts on lines 32..39

    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 68.

    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

        completed_collections_list: [
          {
            status: 'public',
            thumbnail_bg_color: '#ae511b',
            community_owned: false,
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 327..342
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 343..359

    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 68.

    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

        incomplete_collections_list: [
          {
            status: 'public',
            thumbnail_bg_color: '#ae511b',
            community_owned: false,
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 311..326
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 327..342

    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 68.

    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

        collection_playlist: [
          {
            status: 'public',
            thumbnail_bg_color: '#ae511b',
            community_owned: false,
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 311..326
    core/templates/domain/learner_dashboard/learner-dashboard-backend-api.service.spec.ts on lines 343..359

    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 68.

    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

    There are no issues that match your filters.

    Category
    Status