core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts

Summary

Maintainability
F
3 wks
Test Coverage

File contributions-and-review.component.spec.ts has 2287 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2020 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 2 locations. Consider refactoring.
    Open

          let questionDict = {
            question_state_data_schema_version: null,
            id: 'question_1',
            question_state_data: {
              classifier_model_id: null,
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 627..745

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

    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

          let question = questionObjectFactory.createFromBackendDict({
            question_state_data_schema_version: null,
            id: 'question_1',
            question_state_data: {
              classifier_model_id: null,
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 909..1027

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

    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

                suggestion: {
                  target_type: null,
                  author_name: null,
                  last_updated_msecs: null,
                  suggestion_id: 'suggestion_1',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 296..381

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

    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

                suggestion: {
                  target_type: null,
                  author_name: null,
                  last_updated_msecs: null,
                  suggestion_id: 'suggestion_1',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 398..483

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

    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

            skill: skillObjectFactory.createFromBackendDict({
              id: 'skill1',
              description: 'test description 1',
              misconceptions: [
                {
    core/templates/pages/contributor-dashboard-page/modal-templates/question-suggestion-review-modal.component.spec.ts on lines 371..405

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

    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

            () => {
              contributionOpportunitiesService.reloadOpportunitiesEventEmitter.subscribe(
                () => {
                  component.loadContributions(null).then(() => {
                    spyOn(ngbModal, 'open').and.returnValue({
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2160..2177

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

    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 not resolve suggestion when dismissing show suggestion modal', () => {
          contributionOpportunitiesService.reloadOpportunitiesEventEmitter.subscribe(
            () => {
              component.loadContributions(null).then(() => {
                spyOn(ngbModal, 'open').and.returnValue({
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2185..2202

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

    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

          component.loadMoreOpportunities().then(({opportunitiesDicts, more}) => {
            expect(Object.keys(component.contributions)).toContain('suggestion_1');
            expect(opportunitiesDicts).toEqual([
              {
                id: 'suggestion_1',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1743..1756
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1759..1772

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

    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

          component.loadOpportunities().then(({opportunitiesDicts, more}) => {
            expect(Object.keys(component.contributions)).toContain('suggestion_1');
            expect(opportunitiesDicts).toEqual([
              {
                id: 'suggestion_1',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1759..1772
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1779..1792

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

    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

          component.loadOpportunities().then(({opportunitiesDicts, more}) => {
            expect(Object.keys(component.contributions)).toContain('suggestion_1');
            expect(opportunitiesDicts).toEqual([
              {
                id: 'suggestion_1',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1743..1756
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1779..1792

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

    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(ngbModal, 'open').and.returnValue({
            componentInstance: {
              authorName: null,
              contentHtml: null,
              reviewable: null,
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 888..907

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

    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(ngbModal, 'open').and.returnValue({
            componentInstance: {
              authorName: null,
              contentHtml: null,
              reviewable: null,
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 591..610

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

    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

            component.opportunities = [
              {
                id: '1',
                heading: 'heading',
                subheading: 'subheading',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1523..1548

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

    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

          component.opportunities = [
            {
              id: '1',
              heading: 'heading',
              subheading: 'subheading',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1574..1599

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

    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 return empty list if tab is not initialized', () => {
            component.activeTabType = null;
            component.loadContributions(null).then(({opportunitiesDicts, more}) => {
              expect(opportunitiesDicts).toEqual([]);
              expect(more).toEqual(false);
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1481..1487

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

    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 return empty list if suggestion type is not initialized', () => {
            component.activeTabType = null;
            component.loadContributions(null).then(({opportunitiesDicts, more}) => {
              expect(opportunitiesDicts).toEqual([]);
              expect(more).toEqual(false);
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1473..1479

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

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

        it('should toggle dropdown when it is clicked', () => {
          component.dropdownShown = false;
    
          component.toggleDropdown();
          expect(component.dropdownShown).toBe(true);
    core/templates/components/state-editor/state-responses-editor/state-responses.component.spec.ts on lines 1435..1443
    core/templates/pages/exploration-editor-page/editor-navigation/editor-navigation.component.spec.ts on lines 371..377
    core/templates/pages/exploration-player-page/new-lesson-player/new-lesson-player-components/player-sidebar.component.spec.ts on lines 139..145
    core/templates/pages/learner-dashboard-page/modal-templates/view-learner-group-invitation-modal.component.spec.ts on lines 89..97
    core/templates/pages/learner-group-pages/templates/learner-group-preferences-modal.component.spec.ts on lines 88..96
    core/templates/pages/story-editor-page/editor-tab/story-editor.component.spec.ts on lines 383..392
    core/templates/pages/story-editor-page/editor-tab/story-editor.component.spec.ts on lines 394..404
    core/templates/pages/story-editor-page/editor-tab/story-editor.component.spec.ts on lines 406..416

    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

              ExplorationOpportunitySummary.createFromBackendDict({
                id: '2',
                topic_name: 'Topic 2',
                story_title: 'Story 2',
                chapter_title: 'Chapter 2',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 224..237

    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

              ExplorationOpportunitySummary.createFromBackendDict({
                id: '1',
                topic_name: 'Topic 1',
                story_title: 'Story 1',
                chapter_title: 'Chapter 1',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 238..251

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

              expect(
                component.getTranslationContributionsSummary(
                  suggestionIdToSuggestions
                )
              ).toEqual([
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1902..1916
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1998..2012

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

    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

            expect(
              component.getTranslationContributionsSummary(
                suggestionIdToSuggestions
              )
            ).toEqual([
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1956..1970
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1998..2012

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

    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

              expect(
                component.getTranslationContributionsSummary(
                  suggestionIdToSuggestions
                )
              ).toEqual([
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1902..1916
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1956..1970

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

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

          component.accomplishmentsTabs = [
            {
              tabSubType: 'stats',
              tabType: 'accomplishments',
              text: 'Contribution Stats',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2275..2288
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2289..2302
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2322..2335
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2350..2363
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2388..2401
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2402..2415
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2416..2429

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

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

          component.contributionTabs = [
            {
              tabType: 'contributions',
              tabSubType: 'translate_content',
              text: 'Translations',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2275..2288
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2289..2302
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2322..2335
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2336..2349
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2350..2363
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2402..2415
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2416..2429

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

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

          component.contributionTabs = [
            {
              tabType: 'contributions',
              tabSubType: 'translate_content',
              text: 'Questions',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2289..2302
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2322..2335
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2336..2349
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2350..2363
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2388..2401
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2402..2415
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2416..2429

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

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

          component.reviewTabs = [
            {
              tabType: 'reviews',
              tabSubType: 'add_question',
              text: 'Review Questions',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2275..2288
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2322..2335
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2336..2349
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2350..2363
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2388..2401
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2402..2415
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2416..2429

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

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

          component.reviewTabs = [
            {
              tabType: 'reviews',
              tabSubType: 'add_question',
              text: 'Review Questions',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2275..2288
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2289..2302
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2322..2335
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2336..2349
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2350..2363
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2388..2401
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2402..2415

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

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

          component.reviewTabs = [
            {
              tabType: 'reviews',
              tabSubType: 'add_question',
              text: 'Review Questions',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2275..2288
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2289..2302
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2322..2335
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2336..2349
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2388..2401
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2402..2415
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2416..2429

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

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

          component.contributionTabs = [
            {
              tabType: 'contributions',
              tabSubType: 'translate_content',
              text: 'Translations',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2275..2288
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2289..2302
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2336..2349
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2350..2363
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2388..2401
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2402..2415
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2416..2429

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

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

          component.accomplishmentsTabs = [
            {
              tabSubType: 'stats',
              tabType: 'accomplishments',
              text: 'Contribution Stats',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2275..2288
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2289..2302
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2322..2335
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2336..2349
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2350..2363
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2388..2401
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2416..2429

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

    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 unbind event listener when onDestroy is called', () => {
          const unbindSpy = spyOn($.fn, 'off');
    
          component.ngOnDestroy();
          expect(unbindSpy).toHaveBeenCalled();
    core/templates/pages/exploration-editor-page/exploration-title-editor/exploration-title-editor.component.spec.ts on lines 97..106
    core/templates/pages/learner-dashboard-page/home-tab.component.spec.ts on lines 194..198
    core/templates/pages/learner-dashboard-page/learner-groups-tab.component.spec.ts on lines 141..145
    core/templates/pages/learner-dashboard-page/progress-tab.component.spec.ts on lines 205..209

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

    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

            component.loadContributions(null).then(() => {
              component.onClickViewSuggestion('suggestion_1');
    
              expect(ngbModal.open).toHaveBeenCalled();
            });
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2266..2270

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

    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

            component.loadContributions(null).then(() => {
              component.onClickViewSuggestion('suggestion_1');
    
              expect(ngbModal.open).toHaveBeenCalled();
            });
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 2229..2233

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

    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

              expect(opportunitiesDicts).toEqual([
                {
                  id: 'suggestion_1',
                  heading: 'Tradução',
                  subheading: 'topic_name / story_title / chapter_title',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1251..1261

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

    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

              expect(opportunitiesDicts).toEqual([
                {
                  id: 'suggestion_1',
                  heading: 'Tradução',
                  subheading: 'topic_name / story_title / chapter_title',
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1311..1321

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

    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 return false on Translation Contributions tab', () => {
            component.switchToTab(
              component.TAB_TYPE_CONTRIBUTIONS,
              'translate_content'
            );
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 863..866

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

    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 return false on Question Contributions tab', () => {
            component.switchToTab(component.TAB_TYPE_CONTRIBUTIONS, 'add_question');
            expect(component.isReviewTranslationsTab()).toBeFalse();
          });
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 855..861

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

    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

          getUserContributionRightsDataAsyncSpy.and.returnValue(
            Promise.resolve({
              can_review_translation_for_language_codes: [],
              can_review_questions: false,
              can_review_voiceover_for_language_codes: ['something', 'cool'],
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1713..1720

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

    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

          getUserContributionRightsDataAsyncSpy.and.returnValue(
            Promise.resolve({
              can_review_translation_for_language_codes: [],
              can_review_questions: false,
              can_review_voiceover_for_language_codes: ['something', 'cool'],
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 1688..1695

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

    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

          spyOn(contributionAndReviewService, 'reviewSkillSuggestion').and.callFake(
            (_one, _two, _thre, _four, _five, _six, callBackfunction) => {
              callBackfunction();
              tick();
              return null;
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 880..886

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

    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

          spyOn(contributionAndReviewService, 'reviewSkillSuggestion').and.callFake(
            (_one, _two, _thre, _four, _five, _six, callBackfunction) => {
              callBackfunction();
              tick();
              return null;
    core/templates/pages/contributor-dashboard-page/contributions-and-review/contributions-and-review.component.spec.ts on lines 584..590

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

    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