department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

File validations.js has 420 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import _ from 'platform/utilities/data';
import some from 'lodash/some';
import moment from 'moment';

import {
Severity: Minor
Found in src/applications/disability-benefits/all-claims/validations.js - About 6 hrs to fix

    File index.js has 420 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable camelcase */
    const simpleUser = {
      data: {
        id: '',
        type: 'users_scaffolds',
    Severity: Minor
    Found in src/applications/personalization/common/mocks/users/index.js - About 6 hrs to fix

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

      const ExtraDetails = rx => {
        const { dispStatus, refillRemaining } = rx;
        const pharmacyPhone = pharmacyPhoneNumber(rx);
        let noRefillRemaining = false;
        if (refillRemaining === 0 && dispStatus === 'Active') {
      Severity: Major
      Found in src/applications/mhv-medications/components/shared/ExtraDetails.jsx - About 6 hrs to fix

        Function uiSchema has 150 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function uiSchema(label = 'Address', useStreet3 = true) {
          let fieldOrder = [
            'street',
            'unitNumber',
            'street2',
        Severity: Major
        Found in src/applications/ask-va/config/schema-helpers/addressHelper.js - About 6 hrs to fix

          File display-conditions.js has 415 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { range } from 'lodash';
          import { months } from 'platform/static-data/options-for-select';
          import { RESPONSES } from './question-data-map';
          
          const get15YearsPast = () => `${new Date().getFullYear() - 15}`;
          Severity: Minor
          Found in src/applications/discharge-wizard/constants/display-conditions.js - About 5 hrs to fix

            Function FilterBox has 149 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const FilterBox = forwardRef((props, ref) => {
              const {
                category,
                setCategory,
                dateRange,
            Severity: Major
            Found in src/applications/mhv-secure-messaging/components/Search/FilterBox.jsx - About 5 hrs to fix

              File DownloadFileType.jsx has 415 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { useState, useCallback, useEffect, useMemo } from 'react';
              import { Link, useHistory } from 'react-router-dom';
              import { useDispatch, useSelector } from 'react-redux';
              import PropTypes from 'prop-types';
              import { formatDateLong } from '@department-of-veterans-affairs/platform-utilities/exports';

                File RadiologyDetails.jsx has 415 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  Function SearchControls has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const SearchControls = props => {
                    const {
                      currentQuery,
                      onChange,
                      onSubmit,
                  Severity: Minor
                  Found in src/applications/facility-locator/components/SearchControls.jsx - About 5 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 ApplicantAddressCopyPage has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function ApplicantAddressCopyPage({
                    contentBeforeButtons,
                    contentAfterButtons,
                    customAddressKey, // optional override of `applicantAddress` so we can target arbitrary addresses in the form
                    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 addressUISchema has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const addressUISchema = (
                    isMilitaryBaseAddress = false,
                    path,
                    callback,
                  ) => {
                  Severity: Minor
                  Found in src/applications/disability-benefits/2346/schemas/address-schema.js - About 5 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 getCalendarData has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function getCalendarData({ appointment, facility }) {
                    let data = {};
                    const isAtlas = appointment?.videoData.isAtlas;
                    const isHome = isVideoHome(appointment);
                    const videoKind = appointment?.videoData.kind;
                  Severity: Minor
                  Found in src/applications/vaos/services/appointment/index.js - About 5 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 LocationSearchResults has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function LocationSearchResults({
                    search,
                    filters,
                    preview,
                    dispatchUpdateEligibilityAndFilters,
                  Severity: Minor
                  Found in src/applications/gi/containers/search/LocationSearchResults.jsx - About 5 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 SchoolLocations has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function SchoolLocations({
                    calculator,
                    constants,
                    eligibility,
                    facilityMap,
                  Severity: Minor
                  Found in src/applications/gi/components/profile/SchoolLocations.jsx - About 5 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 form.js has 413 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React from 'react';
                  import get from '@department-of-veterans-affairs/platform-forms-system/get';
                  import fullSchemaBurials from 'vets-json-schema/dist/21P-530EZ-schema.json';
                  import { externalServices } from '@department-of-veterans-affairs/platform-monitoring/DowntimeNotification';
                  import FormFooter from '@department-of-veterans-affairs/platform-forms/FormFooter';
                  Severity: Minor
                  Found in src/applications/burials-ez/config/form.js - About 5 hrs to fix

                    File VitalDetails.jsx has 413 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React, { useEffect, useState, useRef, useMemo } from 'react';
                    import PropTypes from 'prop-types';
                    import { useDispatch, useSelector } from 'react-redux';
                    import { useParams } from 'react-router-dom';
                    import { chunk } from 'lodash';
                    Severity: Minor
                    Found in src/applications/mhv-medical-records/containers/VitalDetails.jsx - About 5 hrs to fix

                      File SearchApp.jsx has 413 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React, { useCallback, useEffect, useRef, useState } from 'react';
                      import PropTypes from 'prop-types';
                      import { withRouter } from 'react-router';
                      import { connect } from 'react-redux';
                      
                      
                      Severity: Minor
                      Found in src/applications/search/containers/SearchApp.jsx - About 5 hrs to fix

                        File demographics.js has 412 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { NO_INFO_REPORTED, NONE_RECORDED } from '../constants';
                        
                        export const generateDemographicsContent = record => {
                          const results = {
                            results: {
                        Severity: Minor
                        Found in src/applications/mhv-medical-records/util/pdfHelpers/demographics.js - About 5 hrs to fix

                          Function SpouseGrossMonthlyIncomeInput has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const SpouseGrossMonthlyIncomeInput = props => {
                            const { goToPath, goBack, setFormData } = props;
                          
                            const editIndex = getJobIndex();
                          
                          

                            Function VaccineDetails has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const VaccineDetails = props => {
                              const { runningUnitTest } = props;
                              const record = useSelector(state => state.mr.vaccines.vaccineDetails);
                              const vaccines = useSelector(state => state.mr.vaccines.vaccinesList);
                              const user = useSelector(state => state.user.profile);
                            Severity: Major
                            Found in src/applications/mhv-medical-records/containers/VaccineDetails.jsx - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language