department-of-veterans-affairs/vets-website

View on GitHub
src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js

Summary

Maintainability
F
1 wk
Test Coverage

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

import React from 'react';
import userEvent from '@testing-library/user-event';
import { expect } from 'chai';

// eslint-disable-next-line import/no-unresolved

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

          expect(() => {
            for (let i = 0; i < miles.length - 1; i++) {
              if (
                Number.parseFloat(miles[i].textContent) >
                Number.parseFloat(miles[i + 1].textContent)
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 315..323
    src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderSortVariant.unit.spec.js on lines 230..238
    src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderSortVariant.unit.spec.js on lines 387..395
    src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/index.unit.spec.js on lines 509..517
    src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/index.unit.spec.js on lines 567..575
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 860..868

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

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

          expect(() => {
            for (let i = 0; i < miles.length - 1; i++) {
              if (
                Number.parseFloat(miles[i].textContent) >
                Number.parseFloat(miles[i + 1].textContent)
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 315..323
    src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderSortVariant.unit.spec.js on lines 230..238
    src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderSortVariant.unit.spec.js on lines 387..395
    src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/index.unit.spec.js on lines 509..517
    src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/index.unit.spec.js on lines 567..575
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 933..941

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

    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

          mockSchedulingConfigurations([
            getSchedulingConfigurationMock({
              id: '983',
              typeOfCareId: 'primaryCare',
              requestEnabled: true,
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 482..503
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 639..660

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

    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

          mockSchedulingConfigurations([
            getSchedulingConfigurationMock({
              id: '983',
              typeOfCareId: 'primaryCare',
              requestEnabled: true,
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 569..590
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 639..660

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

    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

          mockSchedulingConfigurations([
            getSchedulingConfigurationMock({
              id: '983',
              typeOfCareId: 'primaryCare',
              requestEnabled: true,
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 482..503
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 569..590

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

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

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

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

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

    Refactorings

    Further Reading

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

          const store = createTestStore({
            ...initialState,
            user: {
              ...initialState.user,
              profile: {
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 172..190
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 265..283
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 472..490
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 103..121
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 893..911
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 969..987

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

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

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

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

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

    Refactorings

    Further Reading

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

          const store = createTestStore({
            ...initialState,
            user: {
              ...initialState.user,
              profile: {
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 172..190
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 265..283
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 472..490
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 103..121
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 819..837
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 969..987

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

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

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

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

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

    Refactorings

    Further Reading

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

          const store = createTestStore({
            ...initialState,
            user: {
              ...initialState.user,
              profile: {
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 172..190
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 265..283
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 472..490
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 819..837
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 893..911
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 969..987

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

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

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

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

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

    Refactorings

    Further Reading

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

          const store = createTestStore({
            ...initialState,
            user: {
              ...initialState.user,
              profile: {
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 172..190
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 265..283
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 472..490
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 103..121
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 819..837
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 893..911

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

    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

          const state = {
            ...initialState,
            user: {
              ...initialState.user,
              profile: {
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 508..526

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

    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

          mockFacilitiesFetch({
            children: true,
            facilities: [
              createMockFacility({
                id: '983',
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 284..300

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

    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

          mockFacilitiesFetch({
            children: true,
            facilities: [
              createMockFacility({
                id: '983',
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 1263..1279

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

    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

          const store = createTestStore({
            ...initialState,
            user: {
              ...initialState.user,
              profile: {
    src/applications/vaos/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js on lines 90..104
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 592..606
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 1294..1308

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

    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

          const store = createTestStore({
            ...initialState,
            user: {
              ...initialState.user,
              profile: {
    src/applications/vaos/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js on lines 90..104
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 505..519
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 1294..1308

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

    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

          const store = createTestStore({
            ...initialState,
            user: {
              ...initialState.user,
              profile: {
    src/applications/vaos/covid-19-vaccine/components/ContactFacilitiesPage.unit.spec.js on lines 90..104
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 505..519
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 592..606

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

    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

          facilities.slice(0, 5).forEach(f => {
            expect(screen.baseElement).to.contain.text(f.attributes.name);
          });
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 114..116

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

    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

          facilities.slice(0, 5).forEach(f => {
            expect(screen.baseElement).to.contain.text(f.attributes.name);
          });
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 371..373

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

        const initialState = {
          featureToggles: {
            vaOnlineSchedulingDirect: true,
          },
          user: {
    src/applications/vaos/covid-19-vaccine/components/ReceivedDoseScreenerPage.unit.spec.js on lines 12..24
    src/applications/vaos/covid-19-vaccine/index.unit.spec.js on lines 19..31
    src/applications/vaos/new-appointment/components/TypeOfVisitPage.unit.spec.js on lines 14..26

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

    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

          mockSchedulingConfigurations([
            getSchedulingConfigurationMock({
              id: '983',
              typeOfCareId: 'primaryCare',
              directEnabled: false,
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.eligibility.unit.spec.js on lines 310..323
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.eligibility.unit.spec.js on lines 693..706
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 81..94

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 60.

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

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

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

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

    Refactorings

    Further Reading

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

          mockSchedulingConfigurations([
            getSchedulingConfigurationMock({
              id: '983',
              typeOfCareId: 'primaryCare',
              directEnabled: true,
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.eligibility.unit.spec.js on lines 310..323
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.eligibility.unit.spec.js on lines 693..706
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.unit.spec.js on lines 301..314

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 60.

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

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

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

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

    Refactorings

    Further Reading

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

            facilities: [
              createMockFacility({
                id: '983',
                name: 'San Diego VA Medical Center',
                address: {
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.eligibility.unit.spec.js on lines 63..75

    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

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

        const initialState = {
          featureToggles: {
            vaOnlineSchedulingDirect: true,
          },
          user: {
    src/applications/vaos/covid-19-vaccine/components/ClinicChoicePage.unit.spec.js on lines 18..27
    src/applications/vaos/covid-19-vaccine/components/SelectDate1Page.unit.spec.js on lines 21..30
    src/applications/vaos/new-appointment/components/ClinicChoicePage/index.unit.spec.js on lines 19..28
    src/applications/vaos/new-appointment/components/DateTimeSelectPage/index.unit.spec.js on lines 28..37
    src/applications/vaos/new-appointment/components/TypeOfAudiologyCarePage.unit.spec.js on lines 18..27
    src/applications/vaos/new-appointment/components/TypeOfEyeCarePage.unit.spec.js on lines 24..33
    src/applications/vaos/new-appointment/components/TypeOfSleepCarePage.unit.spec.js on lines 17..26

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

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

          await waitFor(() =>
            expect(screen.history.push.firstCall.args[0]).to.equal(
              '/new-appointment/how-to-schedule',
            ),
          );
    src/applications/vaos/appointment-list/components/AppointmentsPage/index.unit.spec.js on lines 94..96
    src/applications/vaos/covid-19-vaccine/components/ClinicChoicePage.unit.spec.js on lines 94..98
    src/applications/vaos/covid-19-vaccine/components/SecondDosePage.unit.spec.js on lines 117..121
    src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.unit.spec.js on lines 629..633
    src/applications/vaos/new-appointment/components/ClinicChoicePage/index.unit.spec.js on lines 155..159
    src/applications/vaos/new-appointment/components/ClinicChoicePage/index.unit.spec.js on lines 233..237
    src/applications/vaos/new-appointment/components/DateTimeSelectPage/index.unit.spec.js on lines 785..789
    src/applications/vaos/new-appointment/components/TypeOfCarePage/index.unit.spec.js on lines 151..155
    src/applications/vaos/new-appointment/components/TypeOfCarePage/index.unit.spec.js on lines 170..174
    src/applications/vaos/new-appointment/components/TypeOfCarePage/index.unit.spec.js on lines 435..439
    src/applications/vaos/new-appointment/components/VAFacilityPage/VAFacilityPageV2.eligibility.unit.spec.js on lines 735..739

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

    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