core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts

Summary

Maintainability
F
2 wks
Test Coverage

File conversation-skin.component.spec.ts has 2759 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2022 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

    Function callback has 142 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        let callback = (
          answer: string,
          interactionRulesService: InteractionRulesService,
          successCallback: (
            nextCard: StateCard,

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

          states: {
            Start: {
              classifier_model_id: null,
              recorded_voiceovers: {
                voiceovers_mapping: {
      core/templates/pages/exploration-player-page/layout-directives/exploration-footer.component.spec.ts on lines 711..903

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

      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

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

          let callback = (
            answer: string,
            interactionRulesService: InteractionRulesService,
            successCallback: (
              nextCard: StateCard,
      core/templates/pages/exploration-player-page/services/exploration-engine.service.ts on lines 504..685

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

      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 update when submit button is enabled', () => {
          componentInstance.submitButtonIsDisabled = false;
          spyOn(componentInstance, 'isSubmitButtonDisabled').and.returnValue(
            !componentInstance.submitButtonIsDisabled
          );
      core/templates/components/state-editor/state-content-editor/state-content-editor.component.spec.ts on lines 164..174

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

      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

          TestBed.configureTestingModule({
            imports: [HttpClientTestingModule],
            declarations: [ConversationSkinComponent, MockTranslatePipe],
            providers: [
              SolutionObjectFactory,
      core/templates/pages/diagnostic-test-player-page/diagnostic-test-player.component.spec.ts on lines 76..95
      core/templates/pages/exploration-editor-page/translation-tab/audio-translation-bar/audio-translation-bar.component.spec.ts on lines 110..129

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

      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

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

          expect(componentInstance.getExplorationLink()).toEqual(
            '/explore/' +
              expId +
              '?parent=' +
              componentInstance.recommendedExplorationSummaries[0]
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 2086..2100

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

      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

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

          expect(componentInstance.getExplorationLink()).toEqual(
            '/explore/' +
              expId +
              '?parent=' +
              componentInstance.recommendedExplorationSummaries[0]
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 2115..2129

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

      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 animate to one card', fakeAsync(() => {
          let doneCallbackSpy = jasmine.createSpy('done callback');
          componentInstance.animateToOneCard(doneCallbackSpy);
      
          tick(600);
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 3020..3027

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

      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 animate to two cards', fakeAsync(() => {
          let doneCallbackSpy = jasmine.createSpy('done callback');
          componentInstance.animateToTwoCards(doneCallbackSpy);
      
          tick(1000);
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 3011..3018

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

      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 get can ask learner for answer info', () => {
          spyOn(
            learnerAnswerInfoService,
            'getCanAskLearnerForAnswerInfo'
          ).and.returnValues(true, false);
      core/templates/pages/collection-editor-page/editor-tab/collection-editor-tab.component.spec.ts on lines 93..100
      core/templates/pages/collection-editor-page/settings-tab/collection-details-editor.component.spec.ts on lines 126..133
      core/templates/pages/collection-editor-page/settings-tab/collection-permissions-card.component.spec.ts on lines 61..68
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 1696..1704

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

      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 always ask learner for answer details', () => {
          spyOn(
            explorationEngineService,
            'getAlwaysAskLearnerForAnswerDetails'
          ).and.returnValues(true, false);
      core/templates/pages/collection-editor-page/editor-tab/collection-editor-tab.component.spec.ts on lines 93..100
      core/templates/pages/collection-editor-page/settings-tab/collection-details-editor.component.spec.ts on lines 126..133
      core/templates/pages/collection-editor-page/settings-tab/collection-permissions-card.component.spec.ts on lines 61..68
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 1706..1714

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

      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 tell if correctness footer is enabled', () => {
          componentInstance.answerIsCorrect = true;
      
          spyOn(
            playerPositionService,
      core/templates/pages/exploration-player-page/learner-experience/tutor-card.component.spec.ts on lines 882..888

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

      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 get static image url', () => {
          let imageUrl = 'image_url';
          spyOn(urlInterpolationService, 'getStaticImageUrl').and.returnValue(
            imageUrl
          );
      core/templates/pages/classroom-page/classroom-page.component.spec.ts on lines 135..141
      core/templates/pages/library-page/library-page.component.spec.ts on lines 591..595
      core/templates/pages/library-page/search-results/search-results.component.spec.ts on lines 137..143
      core/templates/pages/preferences-page/preferences-page.component.spec.ts on lines 314..320

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

      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

        it('should tell if window can show two cards', () => {
          spyOn(windowDimensionsService, 'getWidth').and.returnValue(
            ExplorationPlayerConstants.TWO_CARD_THRESHOLD_PX + 1
          );
      
      
      core/templates/pages/exploration-player-page/layout-directives/progress-nav.component.spec.ts on lines 214..220
      core/templates/pages/skill-editor-page/skill-preview-tab/skill-preview-tab.component.spec.ts on lines 304..310

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

      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: {
            init_state_name: 'Start',
            param_changes: [],
            param_specs: null,
            title: 'Exploration',
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 406..415

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

      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: {
            init_state_name: 'Start',
            param_changes: [],
            param_specs: null,
            title: 'Exploration',
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 450..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 55.

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

        it('should register analytics when user visit using iframe', () => {
          spyOn(siteAnalyticsService, 'registerVisitOppiaFromIframeEvent');
      
          componentInstance.onNavigateFromIframe();
      
      
      core/templates/base-components/base-content.component.spec.ts on lines 197..201
      core/templates/components/checkpoint-celebration-modal/checkpoint-celebration-modal.component.spec.ts on lines 771..779
      core/templates/components/common-layout-directives/navigation-bars/side-navigation-bar.component.spec.ts on lines 147..151
      core/templates/components/interaction-display/interaction-display.component.spec.ts on lines 132..138
      core/templates/components/question-directives/modal-templates/remove-question-skill-link-modal.comonent.spec.ts on lines 106..110
      core/templates/components/question-directives/modal-templates/remove-question-skill-link-modal.comonent.spec.ts on lines 112..116
      core/templates/components/ratings/rating-display/rating-display.component.spec.ts on lines 87..93
      core/templates/components/stale-tab-info/stale-tab-info-modal.component.spec.ts on lines 41..47
      core/templates/pages/android-page/android-page.component.spec.ts on lines 85..91
      core/templates/pages/collection-editor-page/modals/collection-editor-pre-publish-modal.component.spec.ts on lines 91..95
      core/templates/pages/contributor-dashboard-page/modal-templates/certificate-download-modal.component.spec.ts on lines 191..195
      core/templates/pages/contributor-dashboard-page/modal-templates/translation-modal.component.spec.ts on lines 281..285
      core/templates/pages/contributor-dashboard-page/modal-templates/translation-modal.component.spec.ts on lines 346..352
      core/templates/pages/contributor-dashboard-page/modal-templates/translation-modal.component.spec.ts on lines 354..362
      core/templates/pages/exploration-editor-page/editor-tab/exploration-editor-tab.component.spec.ts on lines 579..585
      core/templates/pages/exploration-editor-page/editor-tab/templates/modal-templates/add-or-update-solution-modal.component.spec.ts on lines 160..166
      core/templates/pages/exploration-editor-page/exploration-save-and-publish-buttons/exploration-save-and-publish-buttons.component.spec.ts on lines 336..340
      core/templates/pages/exploration-editor-page/history-tab/modal-templates/check-revert-exploration-modal.component.spec.ts on lines 77..83
      core/templates/pages/exploration-editor-page/services/state-tutorial-first-time.service.spec.ts on lines 103..107
      core/templates/pages/exploration-editor-page/services/state-tutorial-first-time.service.spec.ts on lines 159..163
      core/templates/pages/exploration-editor-page/settings-tab/settings-tab.component.spec.ts on lines 1102..1107
      core/templates/pages/exploration-editor-page/translation-tab/state-translation-editor/state-translation-editor.component.spec.ts on lines 234..238
      core/templates/pages/exploration-editor-page/translation-tab/state-translation-editor/state-translation-editor.component.spec.ts on lines 242..246
      core/templates/pages/exploration-editor-page/translation-tab/state-translation-editor/state-translation-editor.component.spec.ts on lines 300..304
      core/templates/pages/exploration-editor-page/translation-tab/state-translation-editor/state-translation-editor.component.spec.ts on lines 306..310
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 1809..1815
      core/templates/pages/exploration-player-page/new-lesson-player/new-lesson-player-components/player-header.component.spec.ts on lines 259..263
      core/templates/pages/topic-editor-page/editor-tab/topic-editor-tab.directive.spec.ts on lines 745..751
      core/templates/pages/topic-editor-page/navbar/topic-editor-navbar-breadcrumb.component.spec.ts on lines 115..121
      core/templates/pages/topics-and-skills-dashboard-page/modals/create-new-skill-modal.component.spec.ts on lines 67..73
      core/templates/pages/topics-and-skills-dashboard-page/modals/create-new-topic-modal.component.spec.ts on lines 76..82
      core/templates/pages/topics-and-skills-dashboard-page/modals/create-new-topic-modal.component.spec.ts on lines 84..88
      core/templates/pages/topics-and-skills-dashboard-page/modals/delete-skill-modal.component.spec.ts on lines 111..115
      core/templates/pages/topics-and-skills-dashboard-page/modals/unassign-skill-from-topics-modal.component.spec.ts on lines 114..118
      core/templates/pages/topics-and-skills-dashboard-page/topics-and-skills-dashboard-page.component.spec.ts on lines 239..243
      core/templates/pages/topics-and-skills-dashboard-page/topics-and-skills-dashboard-page.component.spec.ts on lines 245..249
      core/templates/services/autogenerated-audio-player.service.spec.ts on lines 124..130
      core/templates/services/prevent-page-unload-event.service.spec.ts on lines 103..108
      core/templates/services/stateful/focus-manager.service.spec.ts on lines 53..57
      extensions/objects/templates/skill-selector-editor.component.spec.ts on lines 174..180

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

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

        it('should hide loading screen if question are not available', () => {
          spyOn(loaderService, 'hideLoadingScreen');
      
          componentInstance.showQuestionAreNotAvailable();
      
      
      core/templates/base-components/base-content.component.spec.ts on lines 197..201
      core/templates/components/checkpoint-celebration-modal/checkpoint-celebration-modal.component.spec.ts on lines 771..779
      core/templates/components/common-layout-directives/navigation-bars/side-navigation-bar.component.spec.ts on lines 147..151
      core/templates/components/interaction-display/interaction-display.component.spec.ts on lines 132..138
      core/templates/components/question-directives/modal-templates/remove-question-skill-link-modal.comonent.spec.ts on lines 106..110
      core/templates/components/question-directives/modal-templates/remove-question-skill-link-modal.comonent.spec.ts on lines 112..116
      core/templates/components/ratings/rating-display/rating-display.component.spec.ts on lines 87..93
      core/templates/components/stale-tab-info/stale-tab-info-modal.component.spec.ts on lines 41..47
      core/templates/pages/android-page/android-page.component.spec.ts on lines 85..91
      core/templates/pages/collection-editor-page/modals/collection-editor-pre-publish-modal.component.spec.ts on lines 91..95
      core/templates/pages/contributor-dashboard-page/modal-templates/certificate-download-modal.component.spec.ts on lines 191..195
      core/templates/pages/contributor-dashboard-page/modal-templates/translation-modal.component.spec.ts on lines 281..285
      core/templates/pages/contributor-dashboard-page/modal-templates/translation-modal.component.spec.ts on lines 346..352
      core/templates/pages/contributor-dashboard-page/modal-templates/translation-modal.component.spec.ts on lines 354..362
      core/templates/pages/exploration-editor-page/editor-tab/exploration-editor-tab.component.spec.ts on lines 579..585
      core/templates/pages/exploration-editor-page/editor-tab/templates/modal-templates/add-or-update-solution-modal.component.spec.ts on lines 160..166
      core/templates/pages/exploration-editor-page/exploration-save-and-publish-buttons/exploration-save-and-publish-buttons.component.spec.ts on lines 336..340
      core/templates/pages/exploration-editor-page/history-tab/modal-templates/check-revert-exploration-modal.component.spec.ts on lines 77..83
      core/templates/pages/exploration-editor-page/services/state-tutorial-first-time.service.spec.ts on lines 103..107
      core/templates/pages/exploration-editor-page/services/state-tutorial-first-time.service.spec.ts on lines 159..163
      core/templates/pages/exploration-editor-page/settings-tab/settings-tab.component.spec.ts on lines 1102..1107
      core/templates/pages/exploration-editor-page/translation-tab/state-translation-editor/state-translation-editor.component.spec.ts on lines 234..238
      core/templates/pages/exploration-editor-page/translation-tab/state-translation-editor/state-translation-editor.component.spec.ts on lines 242..246
      core/templates/pages/exploration-editor-page/translation-tab/state-translation-editor/state-translation-editor.component.spec.ts on lines 300..304
      core/templates/pages/exploration-editor-page/translation-tab/state-translation-editor/state-translation-editor.component.spec.ts on lines 306..310
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 1910..1918
      core/templates/pages/exploration-player-page/new-lesson-player/new-lesson-player-components/player-header.component.spec.ts on lines 259..263
      core/templates/pages/topic-editor-page/editor-tab/topic-editor-tab.directive.spec.ts on lines 745..751
      core/templates/pages/topic-editor-page/navbar/topic-editor-navbar-breadcrumb.component.spec.ts on lines 115..121
      core/templates/pages/topics-and-skills-dashboard-page/modals/create-new-skill-modal.component.spec.ts on lines 67..73
      core/templates/pages/topics-and-skills-dashboard-page/modals/create-new-topic-modal.component.spec.ts on lines 76..82
      core/templates/pages/topics-and-skills-dashboard-page/modals/create-new-topic-modal.component.spec.ts on lines 84..88
      core/templates/pages/topics-and-skills-dashboard-page/modals/delete-skill-modal.component.spec.ts on lines 111..115
      core/templates/pages/topics-and-skills-dashboard-page/modals/unassign-skill-from-topics-modal.component.spec.ts on lines 114..118
      core/templates/pages/topics-and-skills-dashboard-page/topics-and-skills-dashboard-page.component.spec.ts on lines 239..243
      core/templates/pages/topics-and-skills-dashboard-page/topics-and-skills-dashboard-page.component.spec.ts on lines 245..249
      core/templates/services/autogenerated-audio-player.service.spec.ts on lines 124..130
      core/templates/services/prevent-page-unload-event.service.spec.ts on lines 103..108
      core/templates/services/stateful/focus-manager.service.spec.ts on lines 53..57
      extensions/objects/templates/skill-selector-editor.component.spec.ts on lines 174..180

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

      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

          spyOn(
            storyViewerBackendApiService,
            'recordChapterCompletionAsync'
          ).and.returnValue(
            Promise.resolve({
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 2222..2231

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

      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

          spyOn(
            storyViewerBackendApiService,
            'recordChapterCompletionAsync'
          ).and.returnValues(
            Promise.resolve({
      core/templates/pages/exploration-player-page/learner-experience/conversation-skin.component.spec.ts on lines 1639..1648

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

      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