department-of-veterans-affairs/vets-website

View on GitHub
src/applications/vaos/appointment-list/redux/selectors.js

Summary

Maintainability
F
1 wk
Test Coverage

File selectors.js has 742 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { createSelector } from 'reselect';
import { selectIsCernerOnlyPatient } from 'platform/user/cerner-dsot/selectors';
import moment from 'moment';
import { selectCernerFacilityIds } from 'platform/site-wide/drupal-static-data/source-files/vamc-ehr/selectors';
import { lowerCase } from 'lodash';
Severity: Major
Found in src/applications/vaos/appointment-list/redux/selectors.js - About 1 day to fix

    Function selectConfirmedAppointmentData has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function selectConfirmedAppointmentData(state, appointment) {
      const comment = selectComment(appointment);
      const isCommunityCare = appointment?.vaos?.isCommunityCare;
      const appointmentTypePrefix = isCommunityCare ? 'cc' : 'va';
    
    
    Severity: Major
    Found in src/applications/vaos/appointment-list/redux/selectors.js - About 2 hrs to fix

      Function selectRequestedAppointmentDetails has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function selectRequestedAppointmentDetails(state, id) {
        const { appointmentDetailsStatus, facilityData } = state.appointments;
        const featureVAOSServiceCCAppointments = selectFeatureVAOSServiceCCAppointments(
          state,
        );
      Severity: Major
      Found in src/applications/vaos/appointment-list/redux/selectors.js - About 2 hrs to fix

        Function selectRequestedAppointmentData has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function selectRequestedAppointmentData(state, appointment) {
          const featureVAOSServiceCCAppointments = selectFeatureVAOSServiceCCAppointments(
            state,
          );
          const { facilityData } = state?.appointments || [];
        Severity: Major
        Found in src/applications/vaos/appointment-list/redux/selectors.js - About 2 hrs to fix

          Function selectAppointmentLocality has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

          export function selectAppointmentLocality(
            appointment,
            isPendingAppointment = false,
          ) {
            const practitioner = selectPractitionerName(appointment);
          Severity: Minor
          Found in src/applications/vaos/appointment-list/redux/selectors.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function selectModalityText has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

          export function selectModalityText(appointment, isPendingAppointment = false) {
            const isCommunityCare = selectIsCommunityCare(appointment);
            const isInPerson = selectIsInPerson(appointment);
            const isPhone = selectIsPhone(appointment);
            const isVideoAtlas = selectIsAtlasVideo(appointment);
          Severity: Minor
          Found in src/applications/vaos/appointment-list/redux/selectors.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function selectApptDetailAriaText has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function selectApptDetailAriaText(appointment, isRequest = false) {
            const appointmentDate = selectStartDate(appointment);
            const isCanceled = selectIsCanceled(appointment);
            const isCommunityCare = selectIsCommunityCare(appointment);
            const isPhone = selectIsPhone(appointment);
          Severity: Minor
          Found in src/applications/vaos/appointment-list/redux/selectors.js - About 1 hr to fix

            Function selectModalityText has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function selectModalityText(appointment, isPendingAppointment = false) {
              const isCommunityCare = selectIsCommunityCare(appointment);
              const isInPerson = selectIsInPerson(appointment);
              const isPhone = selectIsPhone(appointment);
              const isVideoAtlas = selectIsAtlasVideo(appointment);
            Severity: Minor
            Found in src/applications/vaos/appointment-list/redux/selectors.js - About 1 hr to fix

              Function getCancelInfo has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function getCancelInfo(state) {
                const {
                  appointmentToCancel,
                  showCancelModal,
                  cancelAppointmentStatus,
              Severity: Minor
              Found in src/applications/vaos/appointment-list/redux/selectors.js - About 1 hr to fix

                Function selectAppointmentLocality has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function selectAppointmentLocality(
                  appointment,
                  isPendingAppointment = false,
                ) {
                  const practitioner = selectPractitionerName(appointment);
                Severity: Minor
                Found in src/applications/vaos/appointment-list/redux/selectors.js - About 1 hr to fix

                  Function selectComment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function selectComment(appointment) {
                    if (!appointment) return '';
                  
                    if (appointment.version === 2) {
                      return appointment.comment ? appointment.comment : 'none';
                  Severity: Minor
                  Found in src/applications/vaos/appointment-list/redux/selectors.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function selectAppointmentDetails has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function selectAppointmentDetails(appointment) {
                    if (!appointment) return '';
                  
                    if (appointment.version === 2) {
                      return appointment.comment ? appointment.comment : 'none';
                  Severity: Minor
                  Found in src/applications/vaos/appointment-list/redux/selectors.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function selectApptDetailAriaText has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function selectApptDetailAriaText(appointment, isRequest = false) {
                    const appointmentDate = selectStartDate(appointment);
                    const isCanceled = selectIsCanceled(appointment);
                    const isCommunityCare = selectIsCommunityCare(appointment);
                    const isPhone = selectIsPhone(appointment);
                  Severity: Minor
                  Found in src/applications/vaos/appointment-list/redux/selectors.js - About 55 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Consider simplifying this complex logical expression.
                  Open

                    if (selectIsCommunityCare(appointment)) {
                      // NOTE: appointment.communityCareProvider is populated for booked CC only
                      const { providerName, name } = appointment.communityCareProvider || {
                        providerName: null,
                        name: null,
                  Severity: Major
                  Found in src/applications/vaos/appointment-list/redux/selectors.js - About 40 mins to fix

                    Avoid too many return statements within this function.
                    Open

                      return `${isCommunityCare ? 'Community care' : 'VA appointment'}`;
                    Severity: Major
                    Found in src/applications/vaos/appointment-list/redux/selectors.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        return '';
                      Severity: Major
                      Found in src/applications/vaos/appointment-list/redux/selectors.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return facilityName ? `At ${facilityName}` : 'At VA facility';
                        Severity: Major
                        Found in src/applications/vaos/appointment-list/redux/selectors.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                            if (isCommunityCare) return 'Community care';
                          Severity: Major
                          Found in src/applications/vaos/appointment-list/redux/selectors.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return `${
                                    isCommunityCare ? 'Community care' : 'VA'
                                  } appointment with ${practitioner}`;
                            Severity: Major
                            Found in src/applications/vaos/appointment-list/redux/selectors.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                if (isPhone) return 'Phone';
                              Severity: Major
                              Found in src/applications/vaos/appointment-list/redux/selectors.js - About 30 mins to fix

                                Function selectFutureStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function selectFutureStatus(state) {
                                  const { pendingStatus, confirmedStatus } = state.appointments;
                                  if (
                                    pendingStatus === FETCH_STATUS.failed ||
                                    confirmedStatus === FETCH_STATUS.failed
                                Severity: Minor
                                Found in src/applications/vaos/appointment-list/redux/selectors.js - About 25 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

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

                                export function selectAppointmentDetails(appointment) {
                                  if (!appointment) return '';
                                
                                  if (appointment.version === 2) {
                                    return appointment.comment ? appointment.comment : 'none';
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 5 hrs to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 228..242

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

                                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

                                export function selectComment(appointment) {
                                  if (!appointment) return '';
                                
                                  if (appointment.version === 2) {
                                    return appointment.comment ? appointment.comment : 'none';
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 5 hrs to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 204..221

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

                                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

                                  return {
                                    appointment,
                                    bookingNotes,
                                    cancelInfo,
                                    canceled,
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 4 hrs to fix
                                src/applications/ivc-champva/shared/components/fileUploads/MissingFileOverview.jsx on lines 183..208

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

                                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 facilityPhone =
                                    appointment?.vaos.apiData.extension?.clinic?.phoneNumber ||
                                    facility?.telecom?.find(tele => tele.system === 'covid')?.value ||
                                    facility?.telecom?.find(tele => tele.system === 'phone')?.value;
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 2 hrs to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 814..817

                                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 facilityPhone =
                                    appointment?.vaos.apiData.extension?.clinic?.phoneNumber ||
                                    facility?.telecom?.find(tele => tele.system === 'covid')?.value ||
                                    facility?.telecom?.find(tele => tele.system === 'phone')?.value;
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 2 hrs to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 747..750

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

                                export function getUpcomingAppointmentListInfo(state) {
                                  return {
                                    facilityData: state.appointments.facilityData,
                                    futureStatus: state.appointments.confirmedStatus,
                                    appointmentsByMonth: selectUpcomingAppointments(state),
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 1 hr to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 244..252

                                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

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

                                export function getRequestedAppointmentListInfo(state) {
                                  return {
                                    facilityData: state.appointments.facilityData,
                                    pendingStatus: state.appointments.pendingStatus,
                                    pendingAppointments: selectPendingAppointments(state),
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 1 hr to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 254..262

                                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

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

                                export function selectTypeOfCareAriaText(appointment) {
                                  const typeOfCareText = selectAppointmentLocality(appointment);
                                  const isCanceled = selectIsCanceled(appointment);
                                  return `${isCanceled ? 'canceled ' : ''}${typeOfCareText}`;
                                }
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 1 hr to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 614..618

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

                                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

                                export function selectModalityAriaText(appointment) {
                                  const modalityText = selectModalityText(appointment);
                                  const isCanceled = selectIsCanceled(appointment);
                                  return `${isCanceled ? 'canceled ' : ''}${modalityText} appointment`;
                                }
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 1 hr to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 609..613

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

                                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

                                  confirmed => {
                                    if (!confirmed) {
                                      return null;
                                    }
                                
                                
                                Severity: Minor
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 40 mins to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 152..162

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

                                    past => {
                                      if (!past) {
                                        return null;
                                      }
                                
                                
                                Severity: Minor
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 40 mins to fix
                                src/applications/vaos/appointment-list/redux/selectors.js on lines 117..127

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

                                export function selectProviderTelecom(appointment, system) {
                                  return appointment?.communityCareProvider?.telecom?.find(
                                    t => t.system === system,
                                  )?.value;
                                }
                                Severity: Minor
                                Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 35 mins to fix
                                src/applications/vaos/services/appointment/index.js on lines 288..290

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

                                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