department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function CheckInConfirmation has 157 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CheckInConfirmation = props => {
  const { selectedAppointment, triggerRefresh, router } = props;
  const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
  const featureToggles = useSelector(selectFeatureToggles);
  const {

    Function RadiologySingleImage has 157 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const RadiologySingleImage = () => {
      const dispatch = useDispatch();
      const { labId, imageId } = useParams();
      // const labAndTestDetails = useSelector(
      //   state => state.mr.labsAndTests.labsAndTestsDetails,

      Function VerifyEnrollmentsPage has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

      export const VerifyEnrollmentsPage = ({
        editMonthVerification,
        enrollmentVerification,
        enrollmentVerificationFetchFailure,
        enrollmentVerificationSubmitted,

      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 useGetCheckInData has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

      const useGetCheckInData = ({
        refreshNeeded,
        appointmentsOnly = false,
        reload = false,
        router,
      Severity: Minor
      Found in src/applications/check-in/hooks/useGetCheckInData.jsx - About 6 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 SearchApp has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

      const SearchApp = ({
        fetchSearchResults,
        router,
        search,
        searchGovMaintenance,
      Severity: Minor
      Found in src/applications/search/containers/SearchApp.jsx - About 6 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

      File components.jsx has 427 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { useEffect, useRef } from 'react';
      import classNames from 'classnames';
      import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
      import {
        VaAlert,

        Function IntroductionPage has 156 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const IntroductionPage = props => {
          useEffect(() => {
            focusElement('h1');
            scrollTo('topContentElement');
        
        
        Severity: Major
        Found in src/applications/appeals/testing/sc/containers/IntroductionPage.jsx - About 6 hrs to fix

          Function render has 156 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const { submission, data } = this.props.form;
              const { response } = submission;
              const veteranFirstName = data?.veteranInformation?.fullName?.first || '';
              const veteranLastName = data?.veteranInformation?.fullName?.last || '';

            File ReviewCollapsibleChapter.jsx has 426 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import PropTypes from 'prop-types';
            import React from 'react';
            import { connect } from 'react-redux';
            import { withRouter } from 'react-router';
            import { Element } from 'platform/utilities/scroll';
            Severity: Minor
            Found in src/platform/forms-system/src/js/review/ReviewCollapsibleChapter.jsx - About 6 hrs to fix

              File constants.js has 426 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              export const recordType = {
                ALLERGIES: 'allergies',
                VACCINES: 'vaccines',
                CARE_SUMMARIES_AND_NOTES: 'care summaries and notes',
                LABS_AND_TESTS: 'lab and test results',
              Severity: Minor
              Found in src/applications/mhv-medical-records/util/constants.js - About 6 hrs to fix

                File utils.js has 425 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /**
                 * Template utils.
                 */
                import { unset } from 'lodash';
                import registerFonts from '../registerFonts';
                Severity: Minor
                Found in src/platform/pdf/templates/utils.js - About 6 hrs to fix

                  Function render has 154 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      const {
                        uiSchema,
                        errorSchema,
                        idSchema,
                  Severity: Major
                  Found in src/platform/forms-system/src/js/fields/ObjectField.jsx - About 6 hrs to fix

                    Function ThreadListItem has 153 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const ThreadListItem = props => {
                      const location = useLocation();
                      const { keyword, activeFolder } = props;
                      const {
                        senderName,

                      Function getNewAppointmentFlow has 153 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function getNewAppointmentFlow(state) {
                        const featureBreadcrumbUrlUpdate = selectFeatureBreadcrumbUrlUpdate(state);
                        const flowType = getFlowType(state);
                        const isSingleVaFacility = selectSingleSupportedVALocation(state);
                      
                      
                      Severity: Major
                      Found in src/applications/vaos/new-appointment/newAppointmentFlow.js - About 6 hrs to fix

                        Function SearchResultsHeader has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const SearchResultsHeader = ({
                          results,
                          facilityType,
                          serviceType,
                          context,
                        Severity: Minor
                        Found in src/applications/facility-locator/components/SearchResultsHeader.jsx - About 6 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 EvidenceVaRecords has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const EvidenceVaRecords = ({
                          data,
                          goBack,
                          goForward,
                          goToPath,
                        Severity: Minor
                        Found in src/applications/appeals/testing/sc/components/EvidenceVaRecords.jsx - About 6 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 InstallmentContract has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const InstallmentContract = props => {
                          const { data, goToPath, setFormData } = props;
                        
                          const { installmentContracts = [] } = data;
                        
                        

                        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 DeleteDraft has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const DeleteDraft = props => {
                          const history = useHistory();
                          const location = useLocation();
                          const dispatch = useDispatch();
                          const deleteDraftButtonRef = useRef();

                        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 render has 152 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          render() {
                            const { supplies, order, eligibility } = this.props;
                            const currentDate = moment();
                            const batterySupplies = supplies.filter(
                              batterySupply => batterySupply.productGroup === BATTERY,

                          Function UneditableData has 152 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const UneditableData = () => {
                            const name = `${USER.FIRST_NAME} ${USER.MIDDLE_NAME} ${USER.LAST_NAME}`;
                            const parsedDob = parse(USER.BIRTH_DATE, 'yyyyMMdd', new Date());
                            const dob = format(parsedDob, 'MMMM d, yyyy');
                            const gender = genderLabels[USER.GENDER];
                            Severity
                            Category
                            Status
                            Source
                            Language