department-of-veterans-affairs/vets-website

View on GitHub
src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js

Summary

Maintainability
F
2 wks
Test Coverage

File formSubmitTransformers.unit.spec.js has 875 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { expect } from 'chai';

import {
  transformFormToCCRequest,
  transformFormToVARequest,

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

      it('should transform form for Eye Care into VA request', () => {
        const state = {
          newAppointment: {
            data: {
              phoneNumber: '5035551234',
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 109..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 410.

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

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

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

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

    Refactorings

    Further Reading

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

      it('should transform form for Sleep Care into VA request', () => {
        const state = {
          newAppointment: {
            data: {
              phoneNumber: '5035551234',
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 550..641

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

    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

          newAppointment: {
            data: {
              phoneNumber: '5035551234',
              bestTimeToCall: {
                morning: true,
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.v2.unit.spec.js on lines 19..92

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

    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

        expect(data).to.deep.equal({
          typeOfCare: 'CCPRMYRTNE',
          typeOfCareId: 'CCPRMYRTNE',
          appointmentType: 'Primary care',
          facility: {
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 270..316
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 388..434
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 835..881

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

    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

        expect(data).to.deep.equal({
          typeOfCare: 'CCAUDHEAR',
          typeOfCareId: 'CCAUDHEAR',
          appointmentType: 'Hearing aid support',
          facility: {
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 270..316
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 717..763
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 835..881

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

    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

        expect(data).to.deep.equal({
          typeOfCare: 'CCPRMYRTNE',
          typeOfCareId: 'CCPRMYRTNE',
          appointmentType: 'Primary care',
          facility: {
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 388..434
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 717..763
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 835..881

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

    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

        expect(data).to.deep.equal({
          typeOfCare: 'CCPRMYRTNE',
          typeOfCareId: 'CCPRMYRTNE',
          appointmentType: 'Primary care',
          facility: {
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 270..316
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 388..434
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 717..763

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

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

            ccEnabledSystems: [
              {
                id: '983',
                vistaId: '983',
                name: 'CHYSHR-Cheyenne VA Medical Center',
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 241..259
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 359..377
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 688..706

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

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

            ccEnabledSystems: [
              {
                id: '983',
                vistaId: '983',
                name: 'CHYSHR-Cheyenne VA Medical Center',
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 359..377
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 688..706
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 806..824

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

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

            ccEnabledSystems: [
              {
                id: '983',
                vistaId: '983',
                name: 'CHYSHR-Cheyenne VA Medical Center',
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 241..259
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 688..706
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 806..824

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

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

            ccEnabledSystems: [
              {
                id: '983',
                vistaId: '983',
                name: 'CHYSHR-Cheyenne VA Medical Center',
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 241..259
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 359..377
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 806..824

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

    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

              communityCareProvider: {
                firstName: 'asdf',
                lastName: 'asdf',
                name: 'Practice',
                address: {
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 221..232

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

    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

              communityCareProvider: {
                firstName: 'asdf',
                lastName: 'asdf',
                name: 'Practice',
                address: {
    src/applications/vaos/new-appointment/redux/helpers/formSubmitTransformers.unit.spec.js on lines 338..349

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

    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