core/templates/domain/topic/topic-update.service.spec.ts

Summary

Maintainability
F
2 wks
Test Coverage

File topic-update.service.spec.ts has 1354 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
Severity: Major
Found in core/templates/domain/topic/topic-update.service.spec.ts - About 3 days to fix

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

      let sampleTopicBackendObject = {
        topicDict: {
          id: 'sample_topic_id',
          name: 'Topic name',
          description: 'Topic description',
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 2 other locations - About 6 hrs to fix
    core/templates/components/entity-creation-services/story-creation-backend-api.service.spec.ts on lines 63..105
    core/templates/pages/topic-editor-page/modal-templates/rearrange-skills-in-subtopics-modal.component.spec.ts on lines 118..160

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

    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 set/unset changes to a subtopic's thumbnail" + 'filename', () => {
        expect(_sampleTopic.getSubtopics()[0].getThumbnailFilename()).toEqual(
          undefined
        );
    
    
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 1 other location - About 5 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 707..721

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

    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 set/unset changes to a subtopic's thumbnail bg " + 'color', () => {
        expect(_sampleTopic.getSubtopics()[0].getThumbnailBgColor()).toEqual(
          undefined
        );
    
    
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 1 other location - About 5 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 609..627

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

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

      it("should set/unset changes to a topic's name", () => {
        expect(_sampleTopic.getName()).toEqual('Topic name');
    
        topicUpdateService.setTopicName(_sampleTopic, 'new unique value');
        expect(_sampleTopic.getName()).toEqual('new unique value');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 10 other locations - About 3 hrs to fix
    core/templates/domain/collection/collection-update.service.spec.ts on lines 235..242
    core/templates/domain/collection/collection-update.service.spec.ts on lines 256..266
    core/templates/domain/collection/collection-update.service.spec.ts on lines 283..293
    core/templates/domain/collection/collection-update.service.spec.ts on lines 310..317
    core/templates/domain/story/story-update.service.spec.ts on lines 1021..1028
    core/templates/domain/story/story-update.service.spec.ts on lines 1042..1049
    core/templates/domain/story/story-update.service.spec.ts on lines 1063..1070
    core/templates/domain/story/story-update.service.spec.ts on lines 1084..1091
    core/templates/domain/topic/topic-update.service.spec.ts on lines 294..302
    core/templates/domain/topic/topic-update.service.spec.ts on lines 529..537

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

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

      it("should set/unset changes to a topic's language code", () => {
        expect(_sampleTopic.getLanguageCode()).toEqual('en');
    
        topicUpdateService.setTopicLanguageCode(_sampleTopic, 'fr');
        expect(_sampleTopic.getLanguageCode()).toEqual('fr');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 10 other locations - About 3 hrs to fix
    core/templates/domain/collection/collection-update.service.spec.ts on lines 235..242
    core/templates/domain/collection/collection-update.service.spec.ts on lines 256..266
    core/templates/domain/collection/collection-update.service.spec.ts on lines 283..293
    core/templates/domain/collection/collection-update.service.spec.ts on lines 310..317
    core/templates/domain/story/story-update.service.spec.ts on lines 1021..1028
    core/templates/domain/story/story-update.service.spec.ts on lines 1042..1049
    core/templates/domain/story/story-update.service.spec.ts on lines 1063..1070
    core/templates/domain/story/story-update.service.spec.ts on lines 1084..1091
    core/templates/domain/topic/topic-update.service.spec.ts on lines 268..276
    core/templates/domain/topic/topic-update.service.spec.ts on lines 294..302

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

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

      it("should set/unset changes to a topic's description", () => {
        expect(_sampleTopic.getDescription()).toEqual('Topic description');
    
        topicUpdateService.setTopicDescription(_sampleTopic, 'new unique value');
        expect(_sampleTopic.getDescription()).toEqual('new unique value');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 10 other locations - About 3 hrs to fix
    core/templates/domain/collection/collection-update.service.spec.ts on lines 235..242
    core/templates/domain/collection/collection-update.service.spec.ts on lines 256..266
    core/templates/domain/collection/collection-update.service.spec.ts on lines 283..293
    core/templates/domain/collection/collection-update.service.spec.ts on lines 310..317
    core/templates/domain/story/story-update.service.spec.ts on lines 1021..1028
    core/templates/domain/story/story-update.service.spec.ts on lines 1042..1049
    core/templates/domain/story/story-update.service.spec.ts on lines 1063..1070
    core/templates/domain/story/story-update.service.spec.ts on lines 1084..1091
    core/templates/domain/topic/topic-update.service.spec.ts on lines 268..276
    core/templates/domain/topic/topic-update.service.spec.ts on lines 529..537

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

    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 set/unset changes to a topic's abbreviated name", () => {
        expect(_sampleTopic.getAbbreviatedName()).toEqual(undefined);
    
        topicUpdateService.setAbbreviatedTopicName(
          _sampleTopic,
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 3 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 352..360
    core/templates/domain/topic/topic-update.service.spec.ts on lines 442..450
    core/templates/domain/topic/topic-update.service.spec.ts on lines 468..479
    core/templates/domain/topic/topic-update.service.spec.ts on lines 500..508

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

    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 set/unset changes to a topic's meta tag content", () => {
        expect(_sampleTopic.getMetaTagContent()).toEqual(undefined);
    
        topicUpdateService.setMetaTagContent(_sampleTopic, 'new meta tag content');
        expect(_sampleTopic.getMetaTagContent()).toEqual('new meta tag content');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 3 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 320..331
    core/templates/domain/topic/topic-update.service.spec.ts on lines 442..450
    core/templates/domain/topic/topic-update.service.spec.ts on lines 468..479
    core/templates/domain/topic/topic-update.service.spec.ts on lines 500..508

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

    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 set/unset changes to a topic's thumbnail bg color", () => {
        expect(_sampleTopic.getThumbnailBgColor()).toEqual(undefined);
    
        topicUpdateService.setTopicThumbnailBgColor(_sampleTopic, '#ffffff');
        expect(_sampleTopic.getThumbnailBgColor()).toEqual('#ffffff');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 3 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 320..331
    core/templates/domain/topic/topic-update.service.spec.ts on lines 352..360
    core/templates/domain/topic/topic-update.service.spec.ts on lines 442..450
    core/templates/domain/topic/topic-update.service.spec.ts on lines 468..479

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

    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 set/unset changes to a topic's url fragment", () => {
        expect(_sampleTopic.getUrlFragment()).toEqual(undefined);
    
        topicUpdateService.setTopicUrlFragment(_sampleTopic, 'new-unique-value');
        expect(_sampleTopic.getUrlFragment()).toEqual('new-unique-value');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 3 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 320..331
    core/templates/domain/topic/topic-update.service.spec.ts on lines 352..360
    core/templates/domain/topic/topic-update.service.spec.ts on lines 468..479
    core/templates/domain/topic/topic-update.service.spec.ts on lines 500..508

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

    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 set/unset changes to a topic's thumbnail filename", () => {
        expect(_sampleTopic.getThumbnailFilename()).toEqual(undefined);
    
        topicUpdateService.setTopicThumbnailFilename(
          _sampleTopic,
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 3 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 320..331
    core/templates/domain/topic/topic-update.service.spec.ts on lines 352..360
    core/templates/domain/topic/topic-update.service.spec.ts on lines 442..450
    core/templates/domain/topic/topic-update.service.spec.ts on lines 500..508

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

    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

        expect(_sampleSubtopicPage.getPageContents().toBackendDict()).toEqual({
          subtitled_html: {
            html: 'test content',
            content_id: 'content',
          },
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 2 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1302..1319
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1325..1342
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1345..1362
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1412..1429

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

    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

        expect(_sampleSubtopicPage.getPageContents().toBackendDict()).toEqual({
          subtitled_html: {
            html: 'test content',
            content_id: 'content',
          },
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 2 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1325..1342
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1345..1362
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1412..1429
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1445..1462

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

    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

        expect(_sampleSubtopicPage.getPageContents().toBackendDict()).toEqual({
          subtitled_html: {
            html: 'test content',
            content_id: 'content',
          },
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 2 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1302..1319
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1325..1342
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1345..1362
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1445..1462

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

    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

        expect(_sampleSubtopicPage.getPageContents().toBackendDict()).toEqual({
          subtitled_html: {
            html: 'test content',
            content_id: 'content',
          },
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 2 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1302..1319
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1325..1342
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1412..1429
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1445..1462

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

    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

        expect(_sampleSubtopicPage.getPageContents().toBackendDict()).toEqual({
          subtitled_html: {
            html: 'new content',
            content_id: 'content',
          },
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 2 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1302..1319
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1345..1362
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1412..1429
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1445..1462

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

    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 create a proper backend change dict for changing subtopic ' +
          'thumbnail bg color',
        () => {
          topicUpdateService.setSubtopicThumbnailBgColor(
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 2 other locations - About 2 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 629..648
    core/templates/domain/topic/topic-update.service.spec.ts on lines 665..684

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

    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 create a proper backend change dict for changing subtopic ' +
          'thumbnail filename',
        () => {
          topicUpdateService.setSubtopicThumbnailFilename(
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 2 other locations - About 2 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 665..684
    core/templates/domain/topic/topic-update.service.spec.ts on lines 723..742

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

    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 create a proper backend change dict for changing subtopic ' +
          'url fragment',
        () => {
          topicUpdateService.setSubtopicUrlFragment(
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 2 other locations - About 2 hrs to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 629..648
    core/templates/domain/topic/topic-update.service.spec.ts on lines 723..742

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

    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 create a proper backend change dict ' +
          "for changing a topic's thumbnail bg color",
        () => {
          topicUpdateService.setTopicThumbnailBgColor(
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 333..350
    core/templates/domain/topic/topic-update.service.spec.ts on lines 362..379
    core/templates/domain/topic/topic-update.service.spec.ts on lines 452..466
    core/templates/domain/topic/topic-update.service.spec.ts on lines 481..498

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

    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 create a proper backend change dict ' +
          "for changing a topic's url fragment",
        () => {
          topicUpdateService.setTopicUrlFragment(_sampleTopic, 'new-unique-value');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 333..350
    core/templates/domain/topic/topic-update.service.spec.ts on lines 362..379
    core/templates/domain/topic/topic-update.service.spec.ts on lines 481..498
    core/templates/domain/topic/topic-update.service.spec.ts on lines 510..527

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

    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 create a proper backend change dict ' +
          "for changing a topic's abbreviated name",
        () => {
          topicUpdateService.setAbbreviatedTopicName(
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 362..379
    core/templates/domain/topic/topic-update.service.spec.ts on lines 452..466
    core/templates/domain/topic/topic-update.service.spec.ts on lines 481..498
    core/templates/domain/topic/topic-update.service.spec.ts on lines 510..527

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

    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 create a proper backend change dict ' +
          "for changing a topic's meta tag content",
        () => {
          topicUpdateService.setMetaTagContent(
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 333..350
    core/templates/domain/topic/topic-update.service.spec.ts on lines 452..466
    core/templates/domain/topic/topic-update.service.spec.ts on lines 481..498
    core/templates/domain/topic/topic-update.service.spec.ts on lines 510..527

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

    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 create a proper backend change dict ' +
          "for changing a topic's thumbnail filename",
        () => {
          topicUpdateService.setTopicThumbnailFilename(
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 4 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 333..350
    core/templates/domain/topic/topic-update.service.spec.ts on lines 362..379
    core/templates/domain/topic/topic-update.service.spec.ts on lines 452..466
    core/templates/domain/topic/topic-update.service.spec.ts on lines 510..527

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

    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 create a proper backend change dict ' +
          "for changing a topic's name",
        () => {
          topicUpdateService.setTopicName(_sampleTopic, 'new unique value');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 2 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 304..318
    core/templates/domain/topic/topic-update.service.spec.ts on lines 539..553

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

    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 create a proper backend change dict ' +
          "for changing a topic's language code",
        () => {
          topicUpdateService.setTopicLanguageCode(_sampleTopic, 'fr');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 2 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 278..292
    core/templates/domain/topic/topic-update.service.spec.ts on lines 304..318

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

    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 create a proper backend change dict ' +
          "for changing a topic's description",
        () => {
          topicUpdateService.setTopicDescription(_sampleTopic, 'new unique value');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 2 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 278..292
    core/templates/domain/topic/topic-update.service.spec.ts on lines 539..553

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

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

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

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

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

    Refactorings

    Further Reading

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

      it(
        'should not create a backend change dict for changing subtopic ' +
          'thumbnail filename when the subtopic does not exist',
        () => {
          expect(() => {
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 3 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 555..564
    core/templates/domain/topic/topic-update.service.spec.ts on lines 650..663
    core/templates/domain/topic/topic-update.service.spec.ts on lines 686..695

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

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

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

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

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

    Refactorings

    Further Reading

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

      it(
        'should not create a backend change dict for changing subtopic ' +
          'thumbnail bg color when the subtopic does not exist',
        () => {
          expect(() => {
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 3 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 555..564
    core/templates/domain/topic/topic-update.service.spec.ts on lines 594..607
    core/templates/domain/topic/topic-update.service.spec.ts on lines 686..695

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

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

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

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

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

    Refactorings

    Further Reading

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

      it(
        'should not create a backend change dict for changing subtopic ' +
          'url fragment when the subtopic does not exist',
        () => {
          expect(() => {
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 3 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 555..564
    core/templates/domain/topic/topic-update.service.spec.ts on lines 594..607
    core/templates/domain/topic/topic-update.service.spec.ts on lines 650..663

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

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

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

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

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

    Refactorings

    Further Reading

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

      it(
        'should not create a backend change dict for changing subtopic title ' +
          'when the subtopic does not exist',
        () => {
          expect(() => {
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 3 other locations - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 594..607
    core/templates/domain/topic/topic-update.service.spec.ts on lines 650..663
    core/templates/domain/topic/topic-update.service.spec.ts on lines 686..695

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

    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 create a backend change dict for removing an additional ' +
          'story id when an error is encountered',
        () => {
          expect(() => {
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 1 other location - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 184..193

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

    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 create a backend change dict for removing a canonical ' +
          'story id when an error is encountered',
        () => {
          expect(() => {
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 1 other location - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 147..156

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

    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

        page_contents: {
          subtitled_html: {
            html: 'test content',
            content_id: 'content',
          },
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 1 other location - About 1 hr to fix
    core/templates/domain/subtopic_viewer/read-only-subtopic-page-data.model.spec.ts on lines 34..51

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

    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 create a proper backend change dict for removing an additional ' +
          'story id',
        () => {
          topicUpdateService.removeAdditionalStory(_sampleTopic, 'story_2');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 1 other location - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 170..182

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

    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 create a proper backend change dict for removing a canonical ' +
          'story id',
        () => {
          topicUpdateService.removeCanonicalStory(_sampleTopic, 'story_1');
    Severity: Major
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 1 other location - About 1 hr to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 133..145

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

    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

          var newRecordedVoiceoversDict = {
            voiceovers_mapping: {
              content: {
                en: {
                  filename: 'test_2.mp3',
    Severity: Minor
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 1 other location - About 35 mins to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1396..1407

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

    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

        var newRecordedVoiceoversDict = {
          voiceovers_mapping: {
            content: {
              en: {
                filename: 'test_2.mp3',
    Severity: Minor
    Found in core/templates/domain/topic/topic-update.service.spec.ts and 1 other location - About 35 mins to fix
    core/templates/domain/topic/topic-update.service.spec.ts on lines 1469..1480

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

    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