department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function NextStepsPage has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function NextStepsPage() {
  const { data: formData } = useSelector(state => state.form);
  const repType =
    formData['view:selectedRepresentative'].attributes?.individualType;
  const address = {
Severity: Major
Found in src/applications/representative-appoint/containers/NextStepsPage.jsx - About 3 hrs to fix

    Function sharingCardContent has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const sharingCardContent = () => {
        if (statusError) {
          if (['optin', 'optout'].includes(statusError.type)) {
            const optInError = statusError.type === 'optin';
            return (
    Severity: Major
    Found in src/applications/mhv-medical-records/containers/SettingsPage.jsx - About 3 hrs to fix

      Function buildPrescriptionsPDFList has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const buildPrescriptionsPDFList = prescriptions => {
        return prescriptions?.map(rx => {
          if (rx?.prescriptionSource === 'NV') {
            return {
              ...buildNonVAPrescriptionPDFList(rx)[0],
      Severity: Major
      Found in src/applications/mhv-medications/util/pdfConfigs.js - About 3 hrs to fix

        Consider simplifying this complex logical expression.
        Open

            if (prescription) {
              const dispStatus = prescription.dispStatus?.toString();
              return (
                <>
                  <div className="medication-details-div vads-u-border-top--1px vads-u-border-color--gray-lighter vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--3">

          File labels.jsx has 319 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          
          import { states } from 'platform/forms/address';
          import { createUSAStateLabels } from 'platform/forms-system/src/js/helpers';
          
          
          Severity: Minor
          Found in src/applications/edu-benefits/utils/labels.jsx - About 3 hrs to fix

            File claimInformation.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from 'react';
            import {
              titleUI,
              titleSchema,
              radioUI,
            Severity: Minor
            Found in src/applications/ivc-champva/10-7959a/chapters/claimInformation.js - About 3 hrs to fix

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

              import React from 'react';
              import PropTypes from 'prop-types';
              import manifest from '../manifest.json';
              import Alert from '../components/Alert';
              
              
              Severity: Minor
              Found in src/applications/verify-your-enrollment/constants/index.js - About 3 hrs to fix

                File event-generator.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import moment from 'moment-timezone';
                import { fleshOutRecurringEvents, removeDuplicateEvents } from '.';
                
                moment.tz.setDefault('America/New_York');
                const now = moment().clone();
                Severity: Minor
                Found in src/applications/static-pages/events/helpers/event-generator.js - About 3 hrs to fix

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

                  // Node modules.
                  import React from 'react';
                  import PropTypes from 'prop-types';
                  // Relative imports.
                  import { getCernerURL } from 'platform/utilities/cerner';

                    Function OverviewPage has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const OverviewPage = () => {
                      const { debtLetters, mcp } = useSelector(
                        ({ combinedPortal }) => combinedPortal,
                      );
                      const {

                      Function genBBoxFromAddress has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const genBBoxFromAddress = (query, expandedRadius = false) => {
                        // Prevent empty search request to Mapbox, which would result in error, and
                        // clear results list to respond with message of no facilities found.
                        if (!query.searchString) {
                          return {

                        Function createLocationEvents has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const createLocationEvents = () => {
                          const facilityEventData = {
                            fieldEventCost: 'Free',
                            fieldFacilityLocation: {
                              entity: {
                        Severity: Major
                        Found in src/applications/static-pages/events/helpers/event-generator.js - About 3 hrs to fix

                          Function editEmailAddressSuccess has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const editEmailAddressSuccess = () => {
                            // store the email address that's passed in via the POST or PUT call so we can
                            // return it with the GET user/ response
                            let newEmailAddress;
                            return [
                          Severity: Major
                          Found in src/applications/personalization/profile/msw-mocks.js - About 3 hrs to fix

                            Function MrBreadcrumbs has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const MrBreadcrumbs = () => {
                              const dispatch = useDispatch();
                              const location = useLocation();
                              const history = useHistory();
                              const crumbsList = useSelector(state => state.mr.breadcrumbs.crumbsList);
                            Severity: Major
                            Found in src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx - About 3 hrs to fix

                              Function RecordList has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const RecordList = props => {
                                const { records, type, perPage = 10, hidePagination } = props;
                                const totalEntries = records?.length;
                              
                                const history = useHistory();

                                File actions.js has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import * as Sentry from '@sentry/browser';
                                import moment from 'moment';
                                import recordEvent from 'platform/monitoring/record-event';
                                import localStorage from 'platform/utilities/storage/localStorage';
                                import { displayFileSize } from 'platform/utilities/ui/index';
                                Severity: Minor
                                Found in src/platform/forms-system/src/js/actions.js - About 3 hrs to fix

                                  File BenefitsForm.jsx has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import React, { useState } from 'react';
                                  import PropTypes from 'prop-types';
                                  import EbenefitsLink from 'platform/site-wide/ebenefits/containers/EbenefitsLink';
                                  import {
                                    ariaLabels,
                                  Severity: Minor
                                  Found in src/applications/gi/components/profile/BenefitsForm.jsx - About 3 hrs to fix

                                    File personalInformationHelper.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import VaTextInputField from 'platform/forms-system/src/js/web-component-fields/VaTextInputField';
                                    import {
                                      dateOfBirthSchema,
                                      dateOfBirthUI,
                                      selectSchema,

                                      Function SubTask has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const SubTask = props => {
                                        const { pages = [], formData, setFormData, router } = props;
                                        const [currentPage, setCurrentPage] = useState(pages[0] || {});
                                        const [subTaskData, setSubTaskData] = useState(getStoredSubTask());
                                        const [hasError, setHasError] = useState(false);
                                      Severity: Major
                                      Found in src/platform/forms/sub-task/index.js - About 3 hrs to fix

                                        Function getProfileInfoFieldAttributes has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const getProfileInfoFieldAttributes = fieldName => {
                                          let apiRoute;
                                          let convertCleanDataToPayload;
                                          let title;
                                          let uiSchema;
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language