department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

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

  render() {
    const {
      value: items,
      id,
      options,

    Function Compose has 122 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Compose = () => {
      const dispatch = useDispatch();
      const recipients = useSelector(state => state.sm.recipients);
      const { drafts, saveError } = useSelector(state => state.sm.threadDetails);
      const signature = useSelector(state => state.sm.preferences.signature);
    Severity: Major
    Found in src/applications/mhv-secure-messaging/containers/Compose.jsx - About 4 hrs to fix

      Function DirectDeposit has 122 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const DirectDeposit = () => {
        const directDepositHookResult = useDirectDeposit();
      
        const {
          ui,

        Function RadiologyDetails has 122 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const RadiologyDetails = props => {
          const { record, fullState, runningUnitTest } = props;
          const user = useSelector(state => state.user.profile);
          const allowTxtDownloads = useSelector(
            state =>

          Function prescriptionsReducer has 122 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const prescriptionsReducer = (state = initialState, action) => {
            switch (action.type) {
              case Actions.Prescriptions.SET_DETAILS:
              case Actions.Prescriptions.GET_DETAILS: {
                return {
          Severity: Major
          Found in src/applications/mhv-medications/reducers/prescriptions.js - About 4 hrs to fix

            File SearchControls.jsx has 369 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, { useEffect, useRef, useState } from 'react';
            import recordEvent from 'platform/monitoring/record-event';
            import { focusElement } from 'platform/utilities/ui';
            import classNames from 'classnames';
            import {
            Severity: Minor
            Found in src/applications/facility-locator/components/SearchControls.jsx - About 4 hrs to fix

              Function FormStartControls has 121 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const FormStartControls = props => {
                const {
                  formId,
                  migrations,
                  startPage,
              Severity: Major
              Found in src/platform/forms/save-in-progress/FormStartControls.jsx - About 4 hrs to fix

                Function WhatToDoNext has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const WhatToDoNext = props => {
                  const { router, appointments, action, goToDetails } = props;
                  const selectApp = useMemo(makeSelectApp, []);
                  const { app } = useSelector(selectApp);
                  const { t } = useTranslation();
                Severity: Major
                Found in src/applications/check-in/components/WhatToDoNext.jsx - About 4 hrs to fix

                  File form.js has 367 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import FormFooter from 'platform/forms/components/FormFooter';
                  
                  // import CustomPageWrapper from '../components/CustomPageWrapper';
                  import IntroductionPage from '../containers/IntroductionPage';
                  import taskList from '../pages/taskList';
                  Severity: Minor
                  Found in src/applications/appeals/testing/nod-new/config/form.js - About 4 hrs to fix

                    File calculator.js has 367 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { isFinite } from 'lodash';
                    import camelCaseKeysRecursive from 'camelcase-keys-recursive';
                    
                    import {
                      CALCULATOR_INPUTS_CHANGED,
                    Severity: Minor
                    Found in src/applications/gi/reducers/calculator.js - About 4 hrs to fix

                      File labsAndTests.js has 367 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { parseISO } from 'date-fns';
                      import { Actions } from '../util/actionTypes';
                      import {
                        concatObservationInterpretations,
                        dateFormatWithoutTimezone,
                      Severity: Minor
                      Found in src/applications/mhv-medical-records/reducers/labsAndTests.js - About 4 hrs to fix

                        Function generate has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const generate = async data => {
                          validate(data.details);
                        
                          const doc = createAccessibleDoc(data, config);
                        
                        
                        Severity: Major
                        Found in src/platform/pdf/templates/veteran_status.js - About 4 hrs to fix

                          Function ResourcesAndSupportSearchApp has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const ResourcesAndSupportSearchApp = () => {
                            const [articles, errorMessage] = useArticleData();
                            const [userInput, setUserInput] = useState('');
                            const [query, setQuery] = useState('');
                            const [page, setPage] = useState(1);

                            Function applicantInformationUpdate has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function applicantInformationUpdate(schema, options) {
                              // Use the defaults as necessary, but override with the options given
                              const prefix = options && options.isVeteran ? 'veteran' : 'relative';
                              const { fields, required, labels } = {
                                ...defaults(prefix),

                              File EvidenceRecords.jsx has 365 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import React from 'react';
                              import PropTypes from 'prop-types';
                              import { Link } from 'react-router';
                              
                              import {
                              Severity: Minor
                              Found in src/applications/appeals/testing/sc/components/EvidenceRecords.jsx - About 4 hrs to fix

                                Function ChooseCommunityCare has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function ChooseCommunityCare() {
                                  const history = useHistory();
                                
                                  const [providers, setProviders] = useState([
                                    {
                                Severity: Major
                                Found in src/applications/vaos/referral-appointments/ChooseCommunityCare.jsx - About 4 hrs to fix

                                  Function render has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    render() {
                                      const {
                                        value: items,
                                        id,
                                        options,

                                  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 ConfirmationPage.jsx has 364 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import moment from 'moment';
                                  import PropTypes from 'prop-types';
                                  import React from 'react';
                                  import { connect } from 'react-redux';
                                  import environment from 'platform/utilities/environment';

                                    File ConfirmationPage.jsx has 364 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import moment from 'moment';
                                    import PropTypes from 'prop-types';
                                    import React from 'react';
                                    import { connect } from 'react-redux';
                                    import environment from 'platform/utilities/environment';

                                      Function prefillTransformerV1 has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function prefillTransformerV1(pages, formData, metadata, state) {
                                        const bankInformation = state.data?.bankInformation || {};
                                        const claimant = state.data?.formData?.data?.attributes?.claimant || {};
                                        const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
                                        const contactInfo = claimant?.contactInfo || {};
                                      Severity: Major
                                      Found in src/applications/my-education-benefits/helpers.js - About 4 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language