extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts

Summary

Maintainability
F
3 wks
Test Coverage

File set-input-validation.service.spec.ts has 999 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2014 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

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

          describe('IsSupersetOf', () => {
            it('should generate errors with identical rules', () => {
              let supersetRule = Rule.createFromBackendDict(
                {
                  rule_type: 'IsSupersetOf',
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 141..215
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 217..291
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 293..370
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 372..449
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 530..607
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 609..686

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

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

          describe('IsDisjointFrom', () => {
            it('should generate errors with identical rules', () => {
              let disjointRule = Rule.createFromBackendDict(
                {
                  rule_type: 'IsDisjointFrom',
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 141..215
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 217..291
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 293..370
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 451..528
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 530..607
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 609..686

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

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

          describe('IsSubsetOf', () => {
            it('should generate errors with identical rules', () => {
              let subsetRule = Rule.createFromBackendDict(
                {
                  rule_type: 'IsSubsetOf',
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 141..215
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 293..370
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 372..449
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 451..528
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 530..607
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 609..686

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

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

          describe('HasElementsIn', () => {
            it('should generate errors with identical rules', () => {
              let hasElementsInRule = Rule.createFromBackendDict(
                {
                  rule_type: 'HasElementsIn',
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 141..215
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 217..291
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 372..449
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 451..528
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 530..607
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 609..686

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

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

          describe('Equals', () => {
            it('should generate errors with identical rules', () => {
              let equalsRule = Rule.createFromBackendDict(
                {
                  rule_type: 'Equals',
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 217..291
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 293..370
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 372..449
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 451..528
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 530..607
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 609..686

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

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

          describe('OmitsElementsIn', () => {
            it('should generate errors with identical rules', () => {
              let omitElementRule = Rule.createFromBackendDict(
                {
                  rule_type: 'OmitsElementsIn',
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 141..215
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 217..291
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 293..370
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 372..449
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 451..528
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 530..607

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

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

          describe('HasElementsNotIn', () => {
            it('should generate errors with identical rules', () => {
              let hasElementNotInRule = Rule.createFromBackendDict(
                {
                  rule_type: 'HasElementsNotIn',
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 141..215
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 217..291
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 293..370
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 372..449
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 451..528
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 609..686

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

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

          describe('IsDisjointFrom', () => {
            let disjointRule1: Rule, disjointRule2: Rule;
    
            beforeEach(() => {
              disjointRule1 = Rule.createFromBackendDict(
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 690..757
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 759..826
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 897..964
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 966..1033
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 1035..1102

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

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

          describe('IsSupersetOf', () => {
            let supersetRule1: Rule, supersetRule2: Rule;
    
            beforeEach(() => {
              supersetRule1 = Rule.createFromBackendDict(
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 690..757
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 759..826
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 828..895
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 966..1033
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 1035..1102

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

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

          describe('HasElementsIn', () => {
            let hasElementsInRule1: Rule, hasElementsInRule2: Rule;
    
            beforeEach(() => {
              hasElementsInRule1 = Rule.createFromBackendDict(
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 690..757
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 828..895
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 897..964
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 966..1033
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 1035..1102

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

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

          describe('OmitsElementsIn', () => {
            let omitsElementsInRule1: Rule, omitsElementsInRule2: Rule;
    
            beforeEach(() => {
              omitsElementsInRule1 = Rule.createFromBackendDict(
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 690..757
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 759..826
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 828..895
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 897..964
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 966..1033

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

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

          describe('HasElementsNotIn', () => {
            let hasElementsNotInRule1: Rule, hasElementsNotInRule2: Rule;
    
            beforeEach(() => {
              hasElementsNotInRule1 = Rule.createFromBackendDict(
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 690..757
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 759..826
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 828..895
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 897..964
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 1035..1102

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

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

          describe('IsSubsetOf', () => {
            let subsetRule1: Rule, subsetRule2: Rule;
    
            beforeEach(() => {
              subsetRule1 = Rule.createFromBackendDict(
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 759..826
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 828..895
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 897..964
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 966..1033
    extensions/interactions/SetInput/directives/set-input-validation.service.spec.ts on lines 1035..1102

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

    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

        goodDefaultOutcome = oof.createFromBackendDict({
          dest: 'Second State',
          dest_if_really_stuck: null,
          feedback: {
            html: '',
    extensions/interactions/AlgebraicExpressionInput/directives/algebraic-expression-input-validation.service.spec.ts on lines 60..71
    extensions/interactions/CodeRepl/directives/code-repl-validation.service.spec.ts on lines 52..63
    extensions/interactions/Continue/directives/continue-validation.service.spec.ts on lines 54..65
    extensions/interactions/FractionInput/directives/fraction-input-validation.service.spec.ts on lines 107..118
    extensions/interactions/GraphInput/directives/graph-input-validation.service.spec.ts on lines 56..67
    extensions/interactions/ImageClickInput/directives/image-click-input-validation.service.spec.ts on lines 56..67
    extensions/interactions/InteractiveMap/directives/interactive-map-validation.service.spec.ts on lines 54..65
    extensions/interactions/ItemSelectionInput/directives/item-selection-input-validation.service.spec.ts on lines 64..75
    extensions/interactions/MathEquationInput/directives/math-equation-input-validation.service.spec.ts on lines 60..71
    extensions/interactions/MultipleChoiceInput/directives/multiple-choice-input-validation.service.spec.ts on lines 58..69
    extensions/interactions/MusicNotesInput/directives/music-notes-input-validation.service.spec.ts on lines 49..60
    extensions/interactions/NumericExpressionInput/directives/numeric-expression-input-validation.service.spec.ts on lines 61..72
    extensions/interactions/NumericInput/directives/numeric-input-validation.service.spec.ts on lines 78..89
    extensions/interactions/RatioExpressionInput/directives/ratio-expression-input-validation.service.spec.ts on lines 62..73

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

        it('should not generate error with correct customizationArgs', () => {
          let warnings = validatorService.getAllWarnings(
            currentState,
            goodCustomizationArgs,
            goodAnswerGroups,
    extensions/interactions/CodeRepl/directives/code-repl-validation.service.spec.ts on lines 83..91
    extensions/interactions/DragAndDropSortInput/directives/drag-and-drop-sort-input-validation.service.spec.ts on lines 213..221
    extensions/interactions/GraphInput/directives/graph-input-validation.service.spec.ts on lines 134..142
    extensions/interactions/InteractiveMap/directives/interactive-map-validation.service.spec.ts on lines 107..115
    extensions/interactions/ItemSelectionInput/directives/item-selection-input-validation.service.spec.ts on lines 216..224
    extensions/interactions/MultipleChoiceInput/directives/multiple-choice-input-validation.service.spec.ts on lines 135..143
    extensions/interactions/TextInput/directives/text-input-validation.service.spec.ts on lines 99..107

    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