teamdigitale/italia-app

View on GitHub
ts/utils/__tests__/input.test.ts

Summary

Maintainability
D
2 days
Test Coverage

File input.test.ts has 285 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as O from "fp-ts/lib/Option";
import * as E from "fp-ts/lib/Either";
import MockDate from "mockdate";
import { testableAddCardScreen } from "../../screens/wallet/AddCardScreen";
import {
Severity: Minor
Found in ts/utils/__tests__/input.test.ts - About 2 hrs to fix

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

      it("should be true since it is not in a valid format", () => {
        expect(
          testableAddCardScreen?.isCreditCardDateExpiredOrInvalid!(O.some("1/b"))
        ).toEqual(O.some(true));
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 7 other locations - About 55 mins to fix
    ts/utils/__tests__/input.test.ts on lines 134..138
    ts/utils/__tests__/input.test.ts on lines 140..144
    ts/utils/__tests__/input.test.ts on lines 146..150
    ts/utils/__tests__/input.test.ts on lines 158..162
    ts/utils/__tests__/input.test.ts on lines 164..168
    ts/utils/__tests__/input.test.ts on lines 170..174
    ts/utils/__tests__/input.test.ts on lines 176..180

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

    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 be true since it is not in a valid format", () => {
        expect(
          testableAddCardScreen?.isCreditCardDateExpiredOrInvalid!(O.some("01/"))
        ).toEqual(O.some(true));
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 7 other locations - About 55 mins to fix
    ts/utils/__tests__/input.test.ts on lines 134..138
    ts/utils/__tests__/input.test.ts on lines 140..144
    ts/utils/__tests__/input.test.ts on lines 146..150
    ts/utils/__tests__/input.test.ts on lines 152..156
    ts/utils/__tests__/input.test.ts on lines 158..162
    ts/utils/__tests__/input.test.ts on lines 164..168
    ts/utils/__tests__/input.test.ts on lines 170..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 54.

    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 be true since it is not in a valid format", () => {
        expect(
          testableAddCardScreen?.isCreditCardDateExpiredOrInvalid!(O.some("a/27"))
        ).toEqual(O.some(true));
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 7 other locations - About 55 mins to fix
    ts/utils/__tests__/input.test.ts on lines 134..138
    ts/utils/__tests__/input.test.ts on lines 140..144
    ts/utils/__tests__/input.test.ts on lines 146..150
    ts/utils/__tests__/input.test.ts on lines 152..156
    ts/utils/__tests__/input.test.ts on lines 158..162
    ts/utils/__tests__/input.test.ts on lines 164..168
    ts/utils/__tests__/input.test.ts on lines 176..180

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

    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 be true since it is expired", () => {
        expect(
          testableAddCardScreen?.isCreditCardDateExpiredOrInvalid!(O.some("12/19"))
        ).toEqual(O.some(true));
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 7 other locations - About 55 mins to fix
    ts/utils/__tests__/input.test.ts on lines 134..138
    ts/utils/__tests__/input.test.ts on lines 146..150
    ts/utils/__tests__/input.test.ts on lines 152..156
    ts/utils/__tests__/input.test.ts on lines 158..162
    ts/utils/__tests__/input.test.ts on lines 164..168
    ts/utils/__tests__/input.test.ts on lines 170..174
    ts/utils/__tests__/input.test.ts on lines 176..180

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

    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 be false since it is not expired", () => {
        expect(
          testableAddCardScreen?.isCreditCardDateExpiredOrInvalid!(O.some("03/20"))
        ).toEqual(O.some(false));
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 7 other locations - About 55 mins to fix
    ts/utils/__tests__/input.test.ts on lines 140..144
    ts/utils/__tests__/input.test.ts on lines 146..150
    ts/utils/__tests__/input.test.ts on lines 152..156
    ts/utils/__tests__/input.test.ts on lines 158..162
    ts/utils/__tests__/input.test.ts on lines 164..168
    ts/utils/__tests__/input.test.ts on lines 170..174
    ts/utils/__tests__/input.test.ts on lines 176..180

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

    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 be true since it is not in a valid format", () => {
        expect(
          testableAddCardScreen?.isCreditCardDateExpiredOrInvalid!(O.some("03/2"))
        ).toEqual(O.some(true));
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 7 other locations - About 55 mins to fix
    ts/utils/__tests__/input.test.ts on lines 134..138
    ts/utils/__tests__/input.test.ts on lines 140..144
    ts/utils/__tests__/input.test.ts on lines 146..150
    ts/utils/__tests__/input.test.ts on lines 152..156
    ts/utils/__tests__/input.test.ts on lines 158..162
    ts/utils/__tests__/input.test.ts on lines 170..174
    ts/utils/__tests__/input.test.ts on lines 176..180

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

    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 be true since it is not in a valid format", () => {
        expect(
          testableAddCardScreen?.isCreditCardDateExpiredOrInvalid!(O.some("aa/bb"))
        ).toEqual(O.some(true));
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 7 other locations - About 55 mins to fix
    ts/utils/__tests__/input.test.ts on lines 134..138
    ts/utils/__tests__/input.test.ts on lines 140..144
    ts/utils/__tests__/input.test.ts on lines 152..156
    ts/utils/__tests__/input.test.ts on lines 158..162
    ts/utils/__tests__/input.test.ts on lines 164..168
    ts/utils/__tests__/input.test.ts on lines 170..174
    ts/utils/__tests__/input.test.ts on lines 176..180

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

    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 be true since it is not in a valid format", () => {
        expect(
          testableAddCardScreen?.isCreditCardDateExpiredOrInvalid!(O.some("3/21"))
        ).toEqual(O.some(true));
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 7 other locations - About 55 mins to fix
    ts/utils/__tests__/input.test.ts on lines 134..138
    ts/utils/__tests__/input.test.ts on lines 140..144
    ts/utils/__tests__/input.test.ts on lines 146..150
    ts/utils/__tests__/input.test.ts on lines 152..156
    ts/utils/__tests__/input.test.ts on lines 164..168
    ts/utils/__tests__/input.test.ts on lines 170..174
    ts/utils/__tests__/input.test.ts on lines 176..180

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

    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 reject invalid CVCs, round 2", () => {
        invalidCVCs.forEach(d =>
          expect(isValidSecurityCode(O.some(d))).toBeFalsy()
        );
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 3 other locations - About 50 mins to fix
    ts/utils/__tests__/input.test.ts on lines 61..63
    ts/utils/__tests__/input.test.ts on lines 76..78
    ts/utils/__tests__/input.test.ts on lines 202..206

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

    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 reject invalid PANs, round 2", () => {
        invalidPANs.forEach(d => expect(isValidPan(O.some(d))).toBeFalsy());
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 3 other locations - About 50 mins to fix
    ts/utils/__tests__/input.test.ts on lines 61..63
    ts/utils/__tests__/input.test.ts on lines 202..206
    ts/utils/__tests__/input.test.ts on lines 214..218

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

    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 accept valid PANs, round 2", () => {
        validPANs.forEach(d => expect(isValidPan(O.some(d))).toBeTruthy());
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 3 other locations - About 50 mins to fix
    ts/utils/__tests__/input.test.ts on lines 76..78
    ts/utils/__tests__/input.test.ts on lines 202..206
    ts/utils/__tests__/input.test.ts on lines 214..218

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

    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 accept valid CVCs, round 2", () => {
        validCVCs.forEach(d =>
          expect(isValidSecurityCode(O.fromNullable(d))).toBeTruthy()
        );
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 3 other locations - About 50 mins to fix
    ts/utils/__tests__/input.test.ts on lines 61..63
    ts/utils/__tests__/input.test.ts on lines 76..78
    ts/utils/__tests__/input.test.ts on lines 214..218

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

    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

      [
        "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
        "0123456789"
      ].forEach(notAccentedCardHolder =>
        it(`should return true if the input string is composed by character different from accented character: ${notAccentedCardHolder}`, () => {
    Severity: Minor
    Found in ts/utils/__tests__/input.test.ts and 1 other location - About 50 mins to fix
    ts/utils/__tests__/input.test.ts on lines 222..245

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

    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

      [
        "á",
        "à",
        "ã",
        "â",
    Severity: Minor
    Found in ts/utils/__tests__/input.test.ts and 1 other location - About 50 mins to fix
    ts/utils/__tests__/input.test.ts on lines 251..258

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

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

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

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

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

    Refactorings

    Further Reading

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

      it("should reject invalid PANs", () => {
        invalidPANs.forEach(d => expect(CreditCardPan.is(d)).toBeFalsy());
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 4 other locations - About 35 mins to fix
    ts/utils/__tests__/input.test.ts on lines 28..30
    ts/utils/__tests__/input.test.ts on lines 57..59
    ts/utils/__tests__/input.test.ts on lines 198..200
    ts/utils/__tests__/input.test.ts on lines 210..212

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

      it("should accept valid CVCs", () => {
        validCVCs.forEach(d => expect(CreditCardCVC.is(d)).toBeTruthy());
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 4 other locations - About 35 mins to fix
    ts/utils/__tests__/input.test.ts on lines 28..30
    ts/utils/__tests__/input.test.ts on lines 57..59
    ts/utils/__tests__/input.test.ts on lines 72..74
    ts/utils/__tests__/input.test.ts on lines 210..212

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

      it("should reject invalid CVCs", () => {
        invalidCVCs.forEach(d => expect(CreditCardCVC.is(d)).toBeFalsy());
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 4 other locations - About 35 mins to fix
    ts/utils/__tests__/input.test.ts on lines 28..30
    ts/utils/__tests__/input.test.ts on lines 57..59
    ts/utils/__tests__/input.test.ts on lines 72..74
    ts/utils/__tests__/input.test.ts on lines 198..200

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

      it("should accept valid PANs", () => {
        validPANs.forEach(d => expect(CreditCardPan.is(d)).toBeTruthy());
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 4 other locations - About 35 mins to fix
    ts/utils/__tests__/input.test.ts on lines 28..30
    ts/utils/__tests__/input.test.ts on lines 72..74
    ts/utils/__tests__/input.test.ts on lines 198..200
    ts/utils/__tests__/input.test.ts on lines 210..212

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

      it("should accept valid holders", () => {
        validHolders.forEach(h => expect(CreditCardHolder.is(h)).toBeTruthy());
      });
    Severity: Major
    Found in ts/utils/__tests__/input.test.ts and 4 other locations - About 35 mins to fix
    ts/utils/__tests__/input.test.ts on lines 57..59
    ts/utils/__tests__/input.test.ts on lines 72..74
    ts/utils/__tests__/input.test.ts on lines 198..200
    ts/utils/__tests__/input.test.ts on lines 210..212

    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