core/templates/domain/story/story-update.service.ts

Summary

Maintainability
F
2 wks
Test Coverage

File story-update.service.ts has 873 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2021 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Severity: Major
Found in core/templates/domain/story/story-update.service.ts - About 2 days to fix

    StoryUpdateService has 43 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Injectable({
      providedIn: 'root',
    })
    export class StoryUpdateService {
      private _storyChapterUpdateEventEmitter = new EventEmitter<void>();
    Severity: Minor
    Found in core/templates/domain/story/story-update.service.ts - About 5 hrs to fix

      Function removePrerequisiteSkillIdFromNode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        removePrerequisiteSkillIdFromNode(
          story: Story,
          nodeId: string,
          skillId: string
        ): void {
      Severity: Minor
      Found in core/templates/domain/story/story-update.service.ts - About 1 hr to fix

        Function removeDestinationNodeIdFromNode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          removeDestinationNodeIdFromNode(
            story: Story,
            nodeId: string,
            destinationNodeId: string
          ): void {
        Severity: Minor
        Found in core/templates/domain/story/story-update.service.ts - About 1 hr to fix

          Function setStoryNodePlannedPublicationDateMsecs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            setStoryNodePlannedPublicationDateMsecs(
              story: Story,
              nodeId: string,
              newPlannedPublicationDateMsecs: number | null
            ): void {
          Severity: Minor
          Found in core/templates/domain/story/story-update.service.ts - About 1 hr to fix

            Function setStoryNodeFirstPublicationDateMsecs has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              setStoryNodeFirstPublicationDateMsecs(
                story: Story,
                nodeId: string,
                newFirstPublicationDateMsecs: number | null
              ): void {
            Severity: Minor
            Found in core/templates/domain/story/story-update.service.ts - About 1 hr to fix

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

                removePrerequisiteSkillIdFromNode(
                  story: Story,
                  nodeId: string,
                  skillId: string
                ): void {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 1 day to fix
              core/templates/domain/story/story-update.service.ts on lines 941..977

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

              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

                removeDestinationNodeIdFromNode(
                  story: Story,
                  nodeId: string,
                  destinationNodeId: string
                ): void {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 1 day to fix
              core/templates/domain/story/story-update.service.ts on lines 1041..1077

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

              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

                addPrerequisiteSkillIdToNode(
                  story: Story,
                  nodeId: string,
                  skillId: string
                ): void {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 1 day to fix
              core/templates/domain/story/story-update.service.ts on lines 1083..1111

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

              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

                addAcquiredSkillIdToNode(
                  story: Story,
                  nodeId: string,
                  skillId: string
                ): void {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 1 day to fix
              core/templates/domain/story/story-update.service.ts on lines 1004..1035

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

              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

                setStoryNodeFirstPublicationDateMsecs(
                  story: Story,
                  nodeId: string,
                  newFirstPublicationDateMsecs: number | null
                ): void {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 6 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 753..788

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

              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

                setStoryNodePlannedPublicationDateMsecs(
                  story: Story,
                  nodeId: string,
                  newPlannedPublicationDateMsecs: number | null
                ): void {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 6 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 832..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 170.

              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

                setStoryNodeStatus(story: Story, nodeId: string, newStatus: string): void {
                  let storyNode = this._getStoryNode(story.getStoryContents(), nodeId);
                  let oldStatus = storyNode.getStatus();
                  this.setStoryNodeLastModifiedMsecs(story, nodeId, Date.now());
              
              
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 3 other locations - About 6 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 553..573
              core/templates/domain/story/story-update.service.ts on lines 579..599
              core/templates/domain/story/story-update.service.ts on lines 605..629

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

              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

                setStoryNodeDescription(
                  story: Story,
                  nodeId: string,
                  newDescription: string
                ): void {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 3 other locations - About 6 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 553..573
              core/templates/domain/story/story-update.service.ts on lines 579..599
              core/templates/domain/story/story-update.service.ts on lines 727..747

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

              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

                setStoryNodeTitle(story: Story, nodeId: string, newTitle: string): void {
                  let storyNode = this._getStoryNode(story.getStoryContents(), nodeId);
                  let oldTitle = storyNode.getTitle();
                  this.setStoryNodeLastModifiedMsecs(story, nodeId, Date.now());
              
              
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 3 other locations - About 6 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 553..573
              core/templates/domain/story/story-update.service.ts on lines 605..629
              core/templates/domain/story/story-update.service.ts on lines 727..747

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

              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

                setStoryNodeOutline(story: Story, nodeId: string, newOutline: string): void {
                  let storyNode = this._getStoryNode(story.getStoryContents(), nodeId);
                  let oldOutline = storyNode.getOutline();
                  this.setStoryNodeLastModifiedMsecs(story, nodeId, Date.now());
              
              
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 3 other locations - About 6 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 579..599
              core/templates/domain/story/story-update.service.ts on lines 605..629
              core/templates/domain/story/story-update.service.ts on lines 727..747

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

              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

                setStoryNodeThumbnailFilename(
                  story: Story,
                  nodeId: string,
                  newThumbnailFilename: string
                ): void {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 5 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 665..689

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

              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

                setStoryNodeThumbnailBgColor(
                  story: Story,
                  nodeId: string,
                  newThumbnailBgColor: string
                ): void {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 5 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 635..659

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

              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

                setStoryTitle(story: Story, title: string): void {
                  let oldTitle = cloneDeep(story.getTitle());
                  this._applyStoryPropertyChange(
                    story,
                    StoryDomainConstants.STORY_PROPERTY_TITLE,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 4 hrs to fix
              core/templates/domain/topic/topic-update.service.ts on lines 161..178

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

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

                setStoryUrlFragment(story: Story, urlFragment: string): void {
                  let oldUrlFragment = cloneDeep(story.getUrlFragment());
                  this._applyStoryPropertyChange(
                    story,
                    StoryDomainConstants.STORY_PROPERTY_URL_FRAGMENT,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 14 other locations - About 4 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 277..295
              core/templates/domain/story/story-update.service.ts on lines 301..319
              core/templates/domain/story/story-update.service.ts on lines 325..342
              core/templates/domain/story/story-update.service.ts on lines 348..365
              core/templates/domain/story/story-update.service.ts on lines 371..388
              core/templates/domain/story/story-update.service.ts on lines 394..412
              core/templates/domain/topic/topic-update.service.ts on lines 184..201
              core/templates/domain/topic/topic-update.service.ts on lines 207..225
              core/templates/domain/topic/topic-update.service.ts on lines 260..283
              core/templates/domain/topic/topic-update.service.ts on lines 289..307
              core/templates/domain/topic/topic-update.service.ts on lines 313..331
              core/templates/domain/topic/topic-update.service.ts on lines 337..355
              core/templates/domain/topic/topic-update.service.ts on lines 361..378
              core/templates/domain/topic/topic-update.service.ts on lines 384..401

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

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

                setStoryNotes(story: Story, notes: string): void {
                  let oldNotes = cloneDeep(story.getNotes());
                  this._applyStoryPropertyChange(
                    story,
                    StoryDomainConstants.STORY_PROPERTY_NOTES,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 14 other locations - About 4 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 253..271
              core/templates/domain/story/story-update.service.ts on lines 277..295
              core/templates/domain/story/story-update.service.ts on lines 301..319
              core/templates/domain/story/story-update.service.ts on lines 325..342
              core/templates/domain/story/story-update.service.ts on lines 371..388
              core/templates/domain/story/story-update.service.ts on lines 394..412
              core/templates/domain/topic/topic-update.service.ts on lines 184..201
              core/templates/domain/topic/topic-update.service.ts on lines 207..225
              core/templates/domain/topic/topic-update.service.ts on lines 260..283
              core/templates/domain/topic/topic-update.service.ts on lines 289..307
              core/templates/domain/topic/topic-update.service.ts on lines 313..331
              core/templates/domain/topic/topic-update.service.ts on lines 337..355
              core/templates/domain/topic/topic-update.service.ts on lines 361..378
              core/templates/domain/topic/topic-update.service.ts on lines 384..401

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

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

                setStoryMetaTagContent(story: Story, metaTagContent: string): void {
                  let oldMetaTagContent = cloneDeep(story.getMetaTagContent());
                  this._applyStoryPropertyChange(
                    story,
                    StoryDomainConstants.STORY_PROPERTY_META_TAG_CONTENT,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 14 other locations - About 4 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 253..271
              core/templates/domain/story/story-update.service.ts on lines 277..295
              core/templates/domain/story/story-update.service.ts on lines 301..319
              core/templates/domain/story/story-update.service.ts on lines 325..342
              core/templates/domain/story/story-update.service.ts on lines 348..365
              core/templates/domain/story/story-update.service.ts on lines 371..388
              core/templates/domain/topic/topic-update.service.ts on lines 184..201
              core/templates/domain/topic/topic-update.service.ts on lines 207..225
              core/templates/domain/topic/topic-update.service.ts on lines 260..283
              core/templates/domain/topic/topic-update.service.ts on lines 289..307
              core/templates/domain/topic/topic-update.service.ts on lines 313..331
              core/templates/domain/topic/topic-update.service.ts on lines 337..355
              core/templates/domain/topic/topic-update.service.ts on lines 361..378
              core/templates/domain/topic/topic-update.service.ts on lines 384..401

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

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

                setStoryLanguageCode(story: Story, languageCode: string): void {
                  let oldLanguageCode = cloneDeep(story.getLanguageCode());
                  this._applyStoryPropertyChange(
                    story,
                    StoryDomainConstants.STORY_PROPERTY_LANGUAGE_CODE,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 14 other locations - About 4 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 253..271
              core/templates/domain/story/story-update.service.ts on lines 277..295
              core/templates/domain/story/story-update.service.ts on lines 301..319
              core/templates/domain/story/story-update.service.ts on lines 325..342
              core/templates/domain/story/story-update.service.ts on lines 348..365
              core/templates/domain/story/story-update.service.ts on lines 394..412
              core/templates/domain/topic/topic-update.service.ts on lines 184..201
              core/templates/domain/topic/topic-update.service.ts on lines 207..225
              core/templates/domain/topic/topic-update.service.ts on lines 260..283
              core/templates/domain/topic/topic-update.service.ts on lines 289..307
              core/templates/domain/topic/topic-update.service.ts on lines 313..331
              core/templates/domain/topic/topic-update.service.ts on lines 337..355
              core/templates/domain/topic/topic-update.service.ts on lines 361..378
              core/templates/domain/topic/topic-update.service.ts on lines 384..401

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

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

                setStoryDescription(story: Story, description: string): void {
                  let oldDescription = cloneDeep(story.getDescription());
                  this._applyStoryPropertyChange(
                    story,
                    StoryDomainConstants.STORY_PROPERTY_DESCRIPTION,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 14 other locations - About 4 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 253..271
              core/templates/domain/story/story-update.service.ts on lines 277..295
              core/templates/domain/story/story-update.service.ts on lines 301..319
              core/templates/domain/story/story-update.service.ts on lines 348..365
              core/templates/domain/story/story-update.service.ts on lines 371..388
              core/templates/domain/story/story-update.service.ts on lines 394..412
              core/templates/domain/topic/topic-update.service.ts on lines 184..201
              core/templates/domain/topic/topic-update.service.ts on lines 207..225
              core/templates/domain/topic/topic-update.service.ts on lines 260..283
              core/templates/domain/topic/topic-update.service.ts on lines 289..307
              core/templates/domain/topic/topic-update.service.ts on lines 313..331
              core/templates/domain/topic/topic-update.service.ts on lines 337..355
              core/templates/domain/topic/topic-update.service.ts on lines 361..378
              core/templates/domain/topic/topic-update.service.ts on lines 384..401

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

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

                setThumbnailFilename(story: Story, newThumbnailFilename: string): void {
                  let oldThumbnailFilename = cloneDeep(story.getThumbnailFilename());
                  this._applyStoryPropertyChange(
                    story,
                    StoryDomainConstants.STORY_PROPERTY_THUMBNAIL_FILENAME,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 14 other locations - About 4 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 253..271
              core/templates/domain/story/story-update.service.ts on lines 301..319
              core/templates/domain/story/story-update.service.ts on lines 325..342
              core/templates/domain/story/story-update.service.ts on lines 348..365
              core/templates/domain/story/story-update.service.ts on lines 371..388
              core/templates/domain/story/story-update.service.ts on lines 394..412
              core/templates/domain/topic/topic-update.service.ts on lines 184..201
              core/templates/domain/topic/topic-update.service.ts on lines 207..225
              core/templates/domain/topic/topic-update.service.ts on lines 260..283
              core/templates/domain/topic/topic-update.service.ts on lines 289..307
              core/templates/domain/topic/topic-update.service.ts on lines 313..331
              core/templates/domain/topic/topic-update.service.ts on lines 337..355
              core/templates/domain/topic/topic-update.service.ts on lines 361..378
              core/templates/domain/topic/topic-update.service.ts on lines 384..401

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

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

                setThumbnailBgColor(story: Story, newThumbnailBgColor: string): void {
                  let oldThumbnailBgColor = cloneDeep(story.getThumbnailBgColor());
                  this._applyStoryPropertyChange(
                    story,
                    StoryDomainConstants.STORY_PROPERTY_THUMBNAIL_BG_COLOR,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 14 other locations - About 4 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 253..271
              core/templates/domain/story/story-update.service.ts on lines 277..295
              core/templates/domain/story/story-update.service.ts on lines 325..342
              core/templates/domain/story/story-update.service.ts on lines 348..365
              core/templates/domain/story/story-update.service.ts on lines 371..388
              core/templates/domain/story/story-update.service.ts on lines 394..412
              core/templates/domain/topic/topic-update.service.ts on lines 184..201
              core/templates/domain/topic/topic-update.service.ts on lines 207..225
              core/templates/domain/topic/topic-update.service.ts on lines 260..283
              core/templates/domain/topic/topic-update.service.ts on lines 289..307
              core/templates/domain/topic/topic-update.service.ts on lines 313..331
              core/templates/domain/topic/topic-update.service.ts on lines 337..355
              core/templates/domain/topic/topic-update.service.ts on lines 361..378
              core/templates/domain/topic/topic-update.service.ts on lines 384..401

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

              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

                  this._applyChange(
                    story,
                    StoryDomainConstants.CMD_UPDATE_STORY_NODE_OUTLINE_STATUS,
                    {
                      node_id: nodeId,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 4 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 528..546

              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

                  this._applyChange(
                    story,
                    StoryDomainConstants.CMD_UPDATE_STORY_NODE_OUTLINE_STATUS,
                    {
                      node_id: nodeId,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 4 hrs to fix
              core/templates/domain/story/story-update.service.ts on lines 497..515

              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

                  if (
                    this._undoRedoService.getChangeCount() > 0 &&
                    storyEditorBrowserTabsInfo &&
                    !storyEditorBrowserTabsInfo.doesSomeTabHaveUnsavedChanges()
                  ) {
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 1 other location - About 1 hr to fix
              core/templates/domain/skill/skill-update.service.ts on lines 89..99

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

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

                constructor(
                  private _undoRedoService: UndoRedoService,
                  private _alertsService: AlertsService,
                  private _storyEditorStateService: StoryEditorStateService,
                  private _localStorageService: LocalStorageService,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 34 other locations - About 55 mins to fix
              core/templates/base-components/oppia-footer.component.ts on lines 51..57
              core/templates/components/common-layout-directives/common-elements/sharing-links.component.ts on lines 53..59
              core/templates/components/forms/schema-based-editors/schema-based-list-editor.component.ts on lines 98..104
              core/templates/components/forms/schema-based-editors/schema-based-unicode-editor.component.ts on lines 118..124
              core/templates/components/state-directives/outcome-editor/outcome-destination-editor.component.ts on lines 70..76
              core/templates/components/state-directives/solution-editor/solution-editor.component.ts on lines 48..54
              core/templates/components/state-directives/solution-editor/solution-explanation-editor.component.ts on lines 58..64
              core/templates/components/summary-tile/collection-summary-tile.component.ts on lines 65..71
              core/templates/domain/exploration/ExplorationObjectFactory.ts on lines 220..226
              core/templates/pages/admin-page/platform-parameters-tab/admin-platform-parameters-tab.component.ts on lines 105..111
              core/templates/pages/blog-dashboard-page/blog-card/blog-card.component.ts on lines 46..52
              core/templates/pages/blog-dashboard-page/blog-dashboard-tile/blog-dashboard-tile.component.ts on lines 44..50
              core/templates/pages/blog-home-page/blog-home-page-root.component.ts on lines 38..44
              core/templates/pages/collection-editor-page/collection-editor-page.component.ts on lines 35..41
              core/templates/pages/contributor-dashboard-page/contributor-stats/contributor-stats.component.ts on lines 188..194
              core/templates/pages/creator-dashboard-page/modal-templates/create-activity-modal.component.ts on lines 37..43
              core/templates/pages/diagnostic-test-player-page/diagnostic-test-player.component.ts on lines 45..51
              core/templates/pages/exploration-editor-page/feedback-tab/services/thread-data-backend-api.service.ts on lines 69..75
              core/templates/pages/exploration-player-page/new-lesson-player/new-lesson-player-components/player-sidebar.component.ts on lines 46..52
              core/templates/pages/exploration-player-page/services/content-translation-manager.service.ts on lines 47..53
              core/templates/pages/facilitator-dashboard-page/facilitator-dashboard-page.component.ts on lines 42..48
              core/templates/pages/learner-group-pages/edit-group/edit-learner-group-page.component.ts on lines 46..52
              core/templates/pages/learner-group-pages/edit-group/learner-group-preferences.component.ts on lines 52..58
              core/templates/pages/learner-group-pages/view-group/view-learner-group-page-root.component.ts on lines 38..44
              core/templates/pages/login-page/login-page.component.ts on lines 39..45
              core/templates/pages/logout-page/logout-page.component.ts on lines 34..40
              core/templates/pages/moderator-page/moderator-page.component.ts on lines 72..78
              core/templates/pages/profile-page/profile-page-root.component.ts on lines 38..44
              core/templates/pages/release-coordinator-page/features-tab/features-tab.component.ts on lines 61..67
              core/templates/pages/story-viewer-page/navbar-breadcrumb/story-viewer-navbar-breadcrumb.component.ts on lines 49..55
              extensions/interactions/CodeRepl/directives/oppia-interactive-code-repl.component.ts on lines 86..92
              extensions/interactions/Continue/directives/oppia-interactive-continue.component.ts on lines 47..53
              extensions/interactions/GraphInput/directives/oppia-interactive-graph-input.component.ts on lines 68..74
              extensions/interactions/NumericInput/directives/oppia-interactive-numeric-input.component.ts on lines 55..61

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

                _applyStoryNodePropertyChange(
                  story: Story,
                  propertyName: string,
                  nodeId: string,
                  oldValue: number | string | string[] | null,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 2 other locations - About 50 mins to fix
              core/templates/domain/topic/topic-update.service.ts on lines 100..121
              core/templates/domain/topic/topic-update.service.ts on lines 123..144

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

              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

                _applyStoryContentsPropertyChange(
                  story: Story,
                  propertyName: string,
                  oldValue: string | number | null,
                  newValue: string | number,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 4 other locations - About 35 mins to fix
              core/templates/domain/collection/collection-update.service.ts on lines 80..101
              core/templates/domain/skill/skill-update.service.ts on lines 102..121
              core/templates/domain/skill/skill-update.service.ts on lines 165..184
              core/templates/domain/story/story-update.service.ts on lines 154..173

              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

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

                _applyStoryPropertyChange(
                  story: Story,
                  propertyName: string,
                  oldValue: string | null,
                  newValue: string,
              Severity: Major
              Found in core/templates/domain/story/story-update.service.ts and 4 other locations - About 35 mins to fix
              core/templates/domain/collection/collection-update.service.ts on lines 80..101
              core/templates/domain/skill/skill-update.service.ts on lines 102..121
              core/templates/domain/skill/skill-update.service.ts on lines 165..184
              core/templates/domain/story/story-update.service.ts on lines 175..194

              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