kristerkari/placekeeper

View on GitHub

Showing 90 of 90 total issues

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

      beforeEach((done) => {
        helpers.spyOnFocusEnabledAndReturn(false)
        helpers.spyOnCanChangeToTypeAndReturn(false)
        element = helpers.createInputElement(true, "password")
        setTimeout(() => {
Severity: Major
Found in test/unit/hide-on-input.spec.js and 2 other locations - About 3 hrs to fix
test/unit/change-placeholder.spec.js on lines 12..21
test/unit/disable-polyfill.spec.js on lines 12..21

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

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

File hide-on-input.spec.js has 285 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as helpers from "../utils/helpers.js"
import * as placekeeper from "../../src/main.js"
import * as polyfill from "../../src/polyfill.js"
import * as utils from "../../src/utils.js"
import * as events from "../../src/events.js"
Severity: Minor
Found in test/unit/hide-on-input.spec.js - About 2 hrs to fix

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

        beforeEach((done) => {
          helpers.spyOnCanChangeToTypeAndReturn(false)
          element = helpers.createInputElement(true, "password")
          setTimeout(() => {
            clone = document.getElementById("elem")
    Severity: Major
    Found in test/unit/password.spec.js and 1 other location - About 2 hrs to fix
    test/unit/password.spec.js on lines 56..64

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

    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

        beforeEach((done) => {
          helpers.spyOnCanChangeToTypeAndReturn(false)
          element = helpers.createDisabledInputElement(true, "password")
          setTimeout(() => {
            clone = document.getElementById("elem")
    Severity: Major
    Found in test/unit/password.spec.js and 1 other location - About 2 hrs to fix
    test/unit/password.spec.js on lines 298..306

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

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

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

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

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

    Refactorings

    Further Reading

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

            beforeEach((done) => {
              spyOn(polyfill, "hidePlaceholder").and.callThrough()
              helpers.retryFocus(clone, () => {
                setTimeout(() => {
                  element = document.getElementById("elem")
    Severity: Major
    Found in test/unit/password.spec.js and 1 other location - About 2 hrs to fix
    test/unit/password.spec.js on lines 338..346

    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

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

          beforeEach((done) => {
            spyOn(polyfill, "hidePlaceholder").and.callThrough()
            helpers.retryFocus(clone, () => {
              setTimeout(() => {
                element = document.getElementById("elem")
    Severity: Major
    Found in test/unit/password.spec.js and 1 other location - About 2 hrs to fix
    test/unit/password.spec.js on lines 138..146

    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

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

            beforeEach(() => {
              keyupHandler = events.handlers.keyup
              keydownHandler = events.handlers.keydown
              clickHandler = events.handlers.click
              spyOn(utils, "removeEventListener").and.callThrough()
    Severity: Major
    Found in test/unit/hide-on-input.spec.js and 1 other location - About 2 hrs to fix
    test/unit/hide-on-input.spec.js on lines 143..149

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

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

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

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

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

    Refactorings

    Further Reading

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

            beforeEach(() => {
              keyupHandler = events.handlers.keyup
              keydownHandler = events.handlers.keydown
              clickHandler = events.handlers.click
              spyOn(utils, "removeEventListener").and.callThrough()
    Severity: Major
    Found in test/unit/hide-on-input.spec.js and 1 other location - About 2 hrs to fix
    test/unit/hide-on-input.spec.js on lines 328..334

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

    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

    File public.spec.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import * as helpers from "../utils/helpers.js"
    import * as placekeeper from "../../src/main.js"
    import * as utils from "../../src/utils.js"
    import * as events from "../../src/events.js"
    import * as support from "../../src/support.js"
    Severity: Minor
    Found in test/unit/public.spec.js - About 2 hrs to fix

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

      export const createInputElementWithNumericPlaceholder = function(hasPlaceholder, type) {
        let element = "<input type=\"" + (type || "text") +
                      "\" id=\"elem\" maxlength=\"12\""
        if (hasPlaceholder) {
          element += " placeholder=\"123456\""
      Severity: Major
      Found in test/utils/helpers.js and 4 other locations - About 2 hrs to fix
      test/utils/helpers.js on lines 135..144
      test/utils/helpers.js on lines 145..154
      test/utils/helpers.js on lines 165..174
      test/utils/helpers.js on lines 175..184

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

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

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

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

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

      Refactorings

      Further Reading

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

      export const createDisabledInputElement = function(hasPlaceholder, type) {
        let element = "<input type=\"" + (type || "text") +
                      "\" id=\"elem\" maxlength=\"12\""
        if (hasPlaceholder) {
          element += " placeholder=\"Test\""
      Severity: Major
      Found in test/utils/helpers.js and 4 other locations - About 2 hrs to fix
      test/utils/helpers.js on lines 135..144
      test/utils/helpers.js on lines 145..154
      test/utils/helpers.js on lines 155..164
      test/utils/helpers.js on lines 175..184

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

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

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

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

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

      Refactorings

      Further Reading

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

      export const createInputElement = function(hasPlaceholder, type) {
        let element = "<input type=\"" + (type || "text") +
                      "\" id=\"elem\" maxlength=\"12\""
        if (hasPlaceholder) {
          element += " placeholder=\"Test\""
      Severity: Major
      Found in test/utils/helpers.js and 4 other locations - About 2 hrs to fix
      test/utils/helpers.js on lines 135..144
      test/utils/helpers.js on lines 155..164
      test/utils/helpers.js on lines 165..174
      test/utils/helpers.js on lines 175..184

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

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

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

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

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

      Refactorings

      Further Reading

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

      export const createInputElementWithValue = function(hasPlaceholder, type) {
        let element = "<input type=\"" + (type || "text") +
                      "\" id=\"elem\""
        if (hasPlaceholder) {
          element += " placeholder=\"Test\" value=\"MyVal\""
      Severity: Major
      Found in test/utils/helpers.js and 4 other locations - About 2 hrs to fix
      test/utils/helpers.js on lines 145..154
      test/utils/helpers.js on lines 155..164
      test/utils/helpers.js on lines 165..174
      test/utils/helpers.js on lines 175..184

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

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

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

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

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

      Refactorings

      Further Reading

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

      export const createInputElementWithForm = function(hasPlaceholder, type) {
        let element = "<form method=get action=javascript:void(0);><input type=\"" + (type || "text") +
                      "\" id=\"elem\" maxlength=\"12\""
        if (hasPlaceholder) {
          element += " placeholder=\"Test\""
      Severity: Major
      Found in test/utils/helpers.js and 4 other locations - About 2 hrs to fix
      test/utils/helpers.js on lines 135..144
      test/utils/helpers.js on lines 145..154
      test/utils/helpers.js on lines 155..164
      test/utils/helpers.js on lines 165..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 83.

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

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

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

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

      Refactorings

      Further Reading

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

              if (clone != null) {
                it("should have called utils.removeEventListener for focus handler", () => {
                  expect(utils.removeEventListener)
                  .toHaveBeenCalledWith(clone, "focus", focusHandler)
                })
      Severity: Major
      Found in test/unit/public.spec.js and 1 other location - About 2 hrs to fix
      test/unit/public.spec.js on lines 89..99

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 77.

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

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

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

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

      Refactorings

      Further Reading

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

              if (element != null) {
                it("should have called utils.removeEventListener for blur handler", () => {
                  expect(utils.removeEventListener)
                  .toHaveBeenCalledWith(element, "blur", blurHandler)
                })
      Severity: Major
      Found in test/unit/public.spec.js and 1 other location - About 2 hrs to fix
      test/unit/public.spec.js on lines 74..84

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

      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

      Function checkForPlaceholder has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function checkForPlaceholder(element) {
      
        if (!element) {
          return
        }
      Severity: Minor
      Found in src/main.js - About 1 hr to fix

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

            beforeEach((done) => {
              helpers.spyOnCanChangeToTypeAndReturn(false)
              helpers.spyOnNativeSupportAndReturn(false)
              element = helpers.createInputElementWithValue(true)
              setTimeout(done, helpers.loopDurationForTests)
        Severity: Major
        Found in test/unit/change-value.spec.js and 1 other location - About 1 hr to fix
        test/unit/change-placeholder.spec.js on lines 93..99

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 72.

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

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

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

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

        Refactorings

        Further Reading

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

            beforeEach((done) => {
              helpers.spyOnCanChangeToTypeAndReturn(false)
              helpers.spyOnNativeSupportAndReturn(false)
              element = helpers.createInputElement(true)
              setTimeout(done, helpers.loopDurationForTests)
        Severity: Major
        Found in test/unit/change-placeholder.spec.js and 1 other location - About 1 hr to fix
        test/unit/change-value.spec.js on lines 13..19

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 72.

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

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

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

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

        Refactorings

        Further Reading

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

        export const createInputElementWithoutType = function(hasPlaceholder) {
          let element = "<input id=\"elem\" maxlength=\"12\""
          if (hasPlaceholder) {
            element += " placeholder=\"Test\""
          }
        Severity: Major
        Found in test/utils/helpers.js and 2 other locations - About 1 hr to fix
        test/utils/helpers.js on lines 196..204
        test/utils/helpers.js on lines 205..213

        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

        Severity
        Category
        Status
        Source
        Language