department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

File SearchForm.jsx has 330 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useEffect, useMemo, useRef, useState } from 'react';
import FEATURE_FLAG_NAMES from '@department-of-veterans-affairs/platform-utilities/featureFlagNames';
import PropTypes from 'prop-types';
import { useLocation } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';

    Function AppointmentsPage has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function AppointmentsPage() {
      const location = useLocation();
      const [hasTypeChanged, setHasTypeChanged] = useState(false);
      let [pageTitle] = useState('VA online scheduling');
    
    

      Function useClinicFormState has 98 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function useClinicFormState() {
        const initialData = useSelector(getFormData);
        const location = useSelector(selectChosenFacilityInfo);
      
        const selectedTypeOfCare = getTypeOfCare(initialData);

        Function ClaimDetailLayout has 98 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function ClaimDetailLayout(props) {
          const { claim, clearNotification, currentTab, loading, message } = props;
        
          const tabs = ['Status', 'Files', 'Details', 'Overview'];
        
        
        Severity: Major
        Found in src/applications/claims-status/components/ClaimDetailLayout.jsx - About 3 hrs to fix

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

            render() {
              const { claim, lastPage } = this.props;
              const { claimPhaseDates, evidenceWaiverSubmitted5103 } = claim.attributes;
          
              let content;

            Function reducer has 98 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function reducer(state = initialState, action = {}) {
              switch (action.type) {
                case FETCH_STARTED: {
                  return { ...state, loadingStatus: LOADING_STATES.pending };
                }

              Function StepThree has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              const StepThree = ({ formValues }) => {
                const reasonCode = formValues['4_reason'];
                const noPrevApp = formValues['8_prevApplication'] === '2';
                const prevAppType = formValues['10_prevApplicationType'];
                const prevAppYear = formValues['9_prevApplicationYear'];
              Severity: Minor
              Found in src/applications/discharge-wizard/components/gpSteps/StepThree.jsx - About 3 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 AppointmentListItem has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              const AppointmentListItem = props => {
                const { appointment, goToDetails, router, app, page, count } = props;
                const { t } = useTranslation();
                const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
                const { isMedicationReviewContentEnabled } = useSelector(

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

              export default function getNewAppointmentFlow(state) {
                const featureBreadcrumbUrlUpdate = selectFeatureBreadcrumbUrlUpdate(state);
                const flowType = getFlowType(state);
                const isSingleVaFacility = selectSingleSupportedVALocation(state);
              
              
              Severity: Minor
              Found in src/applications/vaos/new-appointment/newAppointmentFlow.js - About 3 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 ComparePage has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              export function ComparePage({
                allLoaded,
                compare,
                dispatchFetchCompareDetails,
                dispatchRemoveCompareInstitution,
              Severity: Minor
              Found in src/applications/gi/containers/ComparePage.jsx - About 3 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 generateBlueButtonData has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              export const generateBlueButtonData = ({
                labsAndTests,
                notes,
                vaccines,
                allergies,
              Severity: Minor
              Found in src/applications/mhv-medical-records/util/pdfHelpers/blueButton.js - About 3 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 ConfirmationResponses.jsx has 329 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from 'react';
              import PropTypes from 'prop-types';
              import { format } from 'date-fns';
              import GetFormHelp from './GetFormHelp';
              
              
              Severity: Minor
              Found in src/applications/fry-dea/components/ConfirmationResponses.jsx - About 3 hrs to fix

                File EvidencePrivateRecords.jsx has 329 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useState, useEffect } from 'react';
                import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
                
                import { EVIDENCE_PRIVATE_PATH } from '../constants';
                import { content } from '../content/evidencePrivateRecords';

                  File EvidencePrivateRecords.jsx has 329 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React, { useState, useEffect } from 'react';
                  import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
                  
                  import { EVIDENCE_PRIVATE_PATH } from '../constants';
                  import { content } from '../content/evidencePrivateRecords';
                  Severity: Minor
                  Found in src/applications/appeals/995/components/EvidencePrivateRecords.jsx - About 3 hrs to fix

                    File helpers.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import appendQuery from 'append-query';
                    import * as Sentry from '@sentry/browser';
                    import React from 'react';
                    import fullSchema from 'vets-json-schema/dist/FEEDBACK-TOOL-schema.json';
                    import { transformForSubmit } from 'platform/forms-system/src/js/helpers';
                    Severity: Minor
                    Found in src/applications/edu-benefits/feedback-tool/helpers.js - About 3 hrs to fix

                      Function GuardianInformation has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function GuardianInformation(schema, options) {
                        // Use the defaults as necessary, but override with the options given
                        const { fields, required } = {
                          ...defaults(),
                          ...options,
                      Severity: Major
                      Found in src/applications/edu-benefits/5490/components/GuardianInformation.jsx - About 3 hrs to fix

                        Function IdentityPage has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const IdentityPage = props => {
                          const { router } = props;
                          const {
                            statusCode,
                            vesRecordFound,
                        Severity: Major
                        Found in src/applications/hca/containers/IdentityPage.jsx - About 3 hrs to fix

                          Function App has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const App = props => {
                            const {
                              children,
                              location,
                              setFormData,
                          Severity: Major
                          Found in src/applications/hca/containers/App.jsx - About 3 hrs to fix

                            Function CategorySelectPage has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const CategorySelectPage = props => {
                              const { onChange, loggedIn, goBack, goToPath, formData } = props;
                              const dispatch = useDispatch();
                            
                              const [apiData, setApiData] = useState([]);
                            Severity: Major
                            Found in src/applications/ask-va/containers/CategorySelectPage.jsx - About 3 hrs to fix

                              Function MessageReply has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const MessageReply = () => {
                                const dispatch = useDispatch();
                                const { replyId } = useParams();
                                const { drafts, error, messages } = useSelector(
                                  state => state.sm.threadDetails,
                              Severity: Major
                              Found in src/applications/mhv-secure-messaging/containers/MessageReply.jsx - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language