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

Summary

Maintainability
F
3 wks
Test Coverage

File story-update.service.spec.ts has 1107 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.spec.ts - About 2 days to fix

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

      it('should add/remove an acquired skill id to/from a node in the story', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 1 day to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 123..148

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

    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 add/remove a prerequisite skill id to/from a node in the story', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 1 day to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 176..201

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

    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 finalize a story node outline', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 1 day to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 614..635

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

    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 unfinalize a story node outline', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 1 day to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 563..584

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

    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 set a story node status', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 3 other locations - About 7 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 668..690
    core/templates/domain/story/story-update.service.spec.ts on lines 714..732
    core/templates/domain/story/story-update.service.spec.ts on lines 888..910

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

    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 set a story node outline', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 3 other locations - About 7 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 714..732
    core/templates/domain/story/story-update.service.spec.ts on lines 752..771
    core/templates/domain/story/story-update.service.spec.ts on lines 888..910

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

    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 set a story node description', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 3 other locations - About 7 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 668..690
    core/templates/domain/story/story-update.service.spec.ts on lines 714..732
    core/templates/domain/story/story-update.service.spec.ts on lines 752..771

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

    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 set a story node title', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 3 other locations - About 7 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 668..690
    core/templates/domain/story/story-update.service.spec.ts on lines 752..771
    core/templates/domain/story/story-update.service.spec.ts on lines 888..910

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

    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 a story node planned publication date', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 7 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 829..861

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 183.

    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 a story node first publication date', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 7 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 773..805

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

    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 story node thumbnail background color when calling ' +
          "'setStoryNodeThumbnailBgColor'",
        () => {
          let storyNodeLastModifiedSpy = spyOn(
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 5 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 1145..1168

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

    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 story node thumbnail file name when calling ' +
          "'setStoryNodeThumbnailFilename'",
        () => {
          let storyNodeLastModifiedSpy = spyOn(
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 5 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 1120..1143

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

    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 remove an acquired skill id ' +
          'from a node if given id is invalid',
        () => {
          expect(
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 4 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 306..326

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 134.

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

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

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

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

    Refactorings

    Further Reading

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

      it(
        'should not remove a prerequisite skill ' +
          'from a node if given id is invalid',
        () => {
          expect(
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 4 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 378..398

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 134.

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

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

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

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

    Refactorings

    Further Reading

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

      it(
        'should create a proper backend change dict for adding a prerequisite ' +
          'skill id to a node',
        () => {
          let storyNodeLastModifiedSpy = spyOn(
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 3 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 203..227

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

    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 adding an acquired ' +
          'skill id to a node',
        () => {
          let storyNodeLastModifiedSpy = spyOn(
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 3 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 150..174

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 111.

    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 removing a prerequisite ' +
          'skill id from a node',
        () => {
          let storyNodeLastModifiedSpy = spyOn(
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 2 other locations - About 3 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 400..424
    core/templates/domain/story/story-update.service.spec.ts on lines 481..505

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

    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 removing an acquired ' +
          'skill id from a node',
        () => {
          let storyNodeLastModifiedSpy = spyOn(
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 2 other locations - About 3 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 328..352
    core/templates/domain/story/story-update.service.spec.ts on lines 481..505

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

    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 removing a destination ' +
          'node id from a node',
        () => {
          let storyNodeLastModifiedSpy = spyOn(
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 2 other locations - About 3 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 328..352
    core/templates/domain/story/story-update.service.spec.ts on lines 400..424

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

    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 story's language code", () => {
        expect(_sampleStory.getLanguageCode()).toEqual('en');
        storyUpdateService.setStoryLanguageCode(_sampleStory, 'fi');
        expect(_sampleStory.getLanguageCode()).toEqual('fi');
    
    
    Severity: Major
    Found in core/templates/domain/story/story-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/topic/topic-update.service.spec.ts on lines 268..276
    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 story's notes", () => {
        expect(_sampleStory.getNotes()).toEqual('Story notes');
        storyUpdateService.setStoryNotes(_sampleStory, 'new notes');
        expect(_sampleStory.getNotes()).toEqual('new notes');
    
    
    Severity: Major
    Found in core/templates/domain/story/story-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 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
    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 story's title", () => {
        expect(_sampleStory.getTitle()).toEqual('Story title');
        storyUpdateService.setStoryTitle(_sampleStory, 'new title');
        expect(_sampleStory.getTitle()).toEqual('new title');
    
    
    Severity: Major
    Found in core/templates/domain/story/story-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 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
    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 story's description", () => {
        expect(_sampleStory.getDescription()).toEqual('Story description');
        storyUpdateService.setStoryDescription(_sampleStory, 'new description');
        expect(_sampleStory.getDescription()).toEqual('new description');
    
    
    Severity: Major
    Found in core/templates/domain/story/story-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 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
    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 3 locations. Consider refactoring.
    Open

      it('should create a proper backend change dict for setting a node title', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 2 other locations - About 3 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 692..712
    core/templates/domain/story/story-update.service.spec.ts on lines 912..932

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

      it('should create a backend change dict for setting a node description', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 2 other locations - About 3 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 692..712
    core/templates/domain/story/story-update.service.spec.ts on lines 734..750

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

      it('should create a proper backend change dict for setting a node outline', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 2 other locations - About 3 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 734..750
    core/templates/domain/story/story-update.service.spec.ts on lines 912..932

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

      it('should create a proper backend change dict for finalizing a node outline', () => {
        let storyNodeLastModifiedSpy = spyOn(
          storyUpdateService,
          'setStoryNodeLastModifiedMsecs'
        );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 2 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 650..665

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

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

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

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

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

    Refactorings

    Further Reading

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

        () => {
          let storyNodeLastModifiedSpy = spyOn(
            storyUpdateService,
            'setStoryNodeLastModifiedMsecs'
          );
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 2 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 597..612

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

    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

              {
                id: 'node_1',
                title: 'Title 1',
                description: 'Description 1',
                prerequisite_skill_ids: ['skill_1'],
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 2 hrs to fix
    core/templates/pages/story-editor-page/services/story-editor-staleness-detection.service.spec.ts on lines 87..104

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

    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 set story meta tag content when calling ' +
          "'setStoryMetaTagContent'",
        () => {
          storyUpdateService.setStoryMetaTagContent(_sampleStory, 'newTag');
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 3 other locations - About 2 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 1182..1192
    core/templates/domain/story/story-update.service.spec.ts on lines 1194..1203
    core/templates/domain/story/story-update.service.spec.ts on lines 1205..1214

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 84.

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

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

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

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

    Refactorings

    Further Reading

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

      it(
        'should set thumbnail file name when calling ' + "'setThumbnailFilename'",
        () => {
          storyUpdateService.setThumbnailFilename(_sampleStory, 'newName');
          expect(_sampleStory.getThumbnailFilename()).toBe('newName');
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 3 other locations - About 2 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 1170..1180
    core/templates/domain/story/story-update.service.spec.ts on lines 1182..1192
    core/templates/domain/story/story-update.service.spec.ts on lines 1205..1214

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 84.

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

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

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

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

    Refactorings

    Further Reading

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

      it(
        'should set thumbnail background color when calling ' +
          "'setThumbnailBgColor'",
        () => {
          storyUpdateService.setThumbnailBgColor(_sampleStory, 'red');
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 3 other locations - About 2 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 1170..1180
    core/templates/domain/story/story-update.service.spec.ts on lines 1194..1203
    core/templates/domain/story/story-update.service.spec.ts on lines 1205..1214

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 84.

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

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

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

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

    Refactorings

    Further Reading

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

      it(
        'should set story url fragment when calling ' + "'setStoryUrlFragment'",
        () => {
          storyUpdateService.setStoryUrlFragment(_sampleStory, 'newUrl');
          expect(_sampleStory.getUrlFragment()).toBe('newUrl');
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 3 other locations - About 2 hrs to fix
    core/templates/domain/story/story-update.service.spec.ts on lines 1170..1180
    core/templates/domain/story/story-update.service.spec.ts on lines 1182..1192
    core/templates/domain/story/story-update.service.spec.ts on lines 1194..1203

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 84.

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

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

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

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

    Refactorings

    Further Reading

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

      it('should create a proper backend change dict for changing language codes', () => {
        storyUpdateService.setStoryLanguageCode(_sampleStory, 'fi');
        expect(undoRedoService.getCommittableChangeList()).toEqual([
          {
            cmd: 'update_story_property',
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 8 other locations - About 1 hr to fix
    core/templates/domain/collection/collection-update.service.spec.ts on lines 244..254
    core/templates/domain/collection/collection-update.service.spec.ts on lines 268..281
    core/templates/domain/collection/collection-update.service.spec.ts on lines 295..308
    core/templates/domain/collection/collection-update.service.spec.ts on lines 319..329
    core/templates/domain/story/story-update.service.spec.ts on lines 1009..1019
    core/templates/domain/story/story-update.service.spec.ts on lines 1030..1040
    core/templates/domain/story/story-update.service.spec.ts on lines 1051..1061
    core/templates/domain/story/story-update.service.spec.ts on lines 1072..1082

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

      it('should create a proper backend change dict for changing notes', () => {
        storyUpdateService.setStoryNotes(_sampleStory, 'new notes');
        expect(undoRedoService.getCommittableChangeList()).toEqual([
          {
            cmd: 'update_story_property',
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 8 other locations - About 1 hr to fix
    core/templates/domain/collection/collection-update.service.spec.ts on lines 244..254
    core/templates/domain/collection/collection-update.service.spec.ts on lines 268..281
    core/templates/domain/collection/collection-update.service.spec.ts on lines 295..308
    core/templates/domain/collection/collection-update.service.spec.ts on lines 319..329
    core/templates/domain/story/story-update.service.spec.ts on lines 1009..1019
    core/templates/domain/story/story-update.service.spec.ts on lines 1030..1040
    core/templates/domain/story/story-update.service.spec.ts on lines 1051..1061
    core/templates/domain/story/story-update.service.spec.ts on lines 1093..1103

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

      it('should create a proper backend change dict for setting initial node', () => {
        storyUpdateService.setInitialNodeId(_sampleStory, 'node_1');
        expect(undoRedoService.getCommittableChangeList()).toEqual([
          {
            cmd: 'update_story_contents_property',
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 8 other locations - About 1 hr to fix
    core/templates/domain/collection/collection-update.service.spec.ts on lines 244..254
    core/templates/domain/collection/collection-update.service.spec.ts on lines 268..281
    core/templates/domain/collection/collection-update.service.spec.ts on lines 295..308
    core/templates/domain/collection/collection-update.service.spec.ts on lines 319..329
    core/templates/domain/story/story-update.service.spec.ts on lines 1030..1040
    core/templates/domain/story/story-update.service.spec.ts on lines 1051..1061
    core/templates/domain/story/story-update.service.spec.ts on lines 1072..1082
    core/templates/domain/story/story-update.service.spec.ts on lines 1093..1103

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

      it('should create a proper backend change dict for changing descriptions', () => {
        storyUpdateService.setStoryDescription(_sampleStory, 'new description');
        expect(undoRedoService.getCommittableChangeList()).toEqual([
          {
            cmd: 'update_story_property',
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 8 other locations - About 1 hr to fix
    core/templates/domain/collection/collection-update.service.spec.ts on lines 244..254
    core/templates/domain/collection/collection-update.service.spec.ts on lines 268..281
    core/templates/domain/collection/collection-update.service.spec.ts on lines 295..308
    core/templates/domain/collection/collection-update.service.spec.ts on lines 319..329
    core/templates/domain/story/story-update.service.spec.ts on lines 1009..1019
    core/templates/domain/story/story-update.service.spec.ts on lines 1030..1040
    core/templates/domain/story/story-update.service.spec.ts on lines 1072..1082
    core/templates/domain/story/story-update.service.spec.ts on lines 1093..1103

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

      it('should create a proper backend change dict for changing title', () => {
        storyUpdateService.setStoryTitle(_sampleStory, 'new title');
        expect(undoRedoService.getCommittableChangeList()).toEqual([
          {
            cmd: 'update_story_property',
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 8 other locations - About 1 hr to fix
    core/templates/domain/collection/collection-update.service.spec.ts on lines 244..254
    core/templates/domain/collection/collection-update.service.spec.ts on lines 268..281
    core/templates/domain/collection/collection-update.service.spec.ts on lines 295..308
    core/templates/domain/collection/collection-update.service.spec.ts on lines 319..329
    core/templates/domain/story/story-update.service.spec.ts on lines 1009..1019
    core/templates/domain/story/story-update.service.spec.ts on lines 1051..1061
    core/templates/domain/story/story-update.service.spec.ts on lines 1072..1082
    core/templates/domain/story/story-update.service.spec.ts on lines 1093..1103

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

      it('should create a proper backend change dict for removing a story node', () => {
        storyUpdateService.deleteStoryNode(_sampleStory, 'node_1');
        expect(undoRedoService.getCommittableChangeList()).toEqual([
          {
            cmd: 'delete_story_node',
    Severity: Major
    Found in core/templates/domain/story/story-update.service.spec.ts and 1 other location - About 1 hr to fix
    core/templates/domain/collection/collection-update.service.spec.ts on lines 225..233

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

    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