department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

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

import React from 'react';
import { parseISO, startOfDay } from 'date-fns';
import { format, utcToZonedTime } from 'date-fns-tz';
import { ELIGIBILITY } from './eligibility';
import { VISTA_CHECK_IN_STATUS_IENS } from '../appConstants';
Severity: Minor
Found in src/applications/check-in/utils/appointment/index.js - About 2 hrs to fix

    File transform.js has 271 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import moment from 'moment';
    import * as Sentry from '@sentry/browser';
    import {
      isStreamlinedShortForm,
      isStreamlinedLongForm,
    Severity: Minor
    Found in src/applications/financial-status-report/utils/transform.js - About 2 hrs to fix

      Function paginatedThreads has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const paginatedThreads = (req, res) => {
        const { index } = req.params;
        const { pageSize, pageNumber, sortField, sortOrder } = req.query;
      
        const sortFunc = (a, b) => {
      Severity: Major
      Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js - About 2 hrs to fix

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

          render() {
            const {
              columnThreeLinkClicked,
              href,
              linkClicked,
        Severity: Major
        Found in src/platform/site-wide/mega-menu/components/MenuSection.jsx - About 2 hrs to fix

          File profileAddress.js has 270 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * This uiSchema is modeled after how addresses are handled in the Profile application, and makes the same pattern
           * available for use inside forms generated by the platform's form system.
           */
          
          
          Severity: Minor
          Found in src/platform/forms-system/src/js/definitions/profileAddress.js - About 2 hrs to fix

            Function updateUiSchema has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  updateUiSchema: formData => {
                    const arrayData = formData?.[arrayPath];
                    return arrayData?.length
                      ? {
                          'ui:title':

              Function getAllFormLinks has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const getAllFormLinks = getAppUrlImpl => {
                if (!getAppUrlImpl) {
                  throw new Error(
                    'getAppUrlImpl is required as an argument of getAllFormLinks()',
                  );
              Severity: Major
              Found in src/platform/forms/constants.js - About 2 hrs to fix

                Function searchWithBounds has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  static searchWithBounds(
                    address = null,
                    bounds,
                    locationType,
                    serviceType,
                Severity: Major
                Found in src/applications/facility-locator/api/LocatorApi.js - About 2 hrs to fix

                  Function ClaimantInformation has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function ClaimantInformation(props) {
                    const { values, setFieldValue } = useFormikContext();
                    const getOptions = [
                      { label: 'Spouse', value: 'spouse', key: 1 },
                      { label: 'Child', value: 'child', key: 2 },
                  Severity: Major
                  Found in src/applications/burial-poc-v6/pages/ClaimantInformation.jsx - About 2 hrs to fix

                    Function onAddFile has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const onAddFile = async (event, index = null, password) => {
                        if (event.target?.files?.length) {
                          // Only upload the first file; when va-file-input v3 supports multiple
                          // files, we'll need to update this entire component
                          const currentFile = event.target.files[0];
                    Severity: Major
                    Found in src/applications/appeals/shared/components/FileField.jsx - About 2 hrs to fix

                      Function renderMedicalRecordInfo has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const renderMedicalRecordInfo = formResponses => {
                        if (
                          [
                            RESPONSES.REASON_PTSD,
                            RESPONSES.REASON_TBI,

                        Function RadioWidget has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function RadioWidget(props) {
                          const { options, formContext = {}, value, disabled, onChange, id } = props;
                          const { enumOptions, labels = {} } = options;
                        
                          const onReviewPage = formContext?.onReviewPage || false;
                        Severity: Major
                        Found in src/applications/pre-need/components/PreparerRadioWidget.jsx - About 2 hrs to fix

                          Function AuthBenefitsPackagePage has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const AuthBenefitsPackagePage = props => {
                            const { location, route, router } = props;
                            const { pathname } = location;
                            const { pageList } = route;
                            const { schema } = definition;
                          Severity: Major
                          Found in src/applications/hca/containers/AuthBenefitsPackagePage.jsx - About 2 hrs to fix

                            Function VetCenterHours has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const VetCenterHours = props => {
                              const hoursH4Style = props.isSatelliteLocation
                                ? 'force-small-header vads-u-margin-top--0 vads-u-line-height--1 vads-u-margin-bottom--1'
                                : 'vads-u-font-size--lg vads-u-margin-top--0 vads-u-line-height--1 vads-u-margin-bottom--1';
                              if (props.hours.length === 0)
                            Severity: Major
                            Found in src/applications/static-pages/facilities/vetCentersHours.jsx - About 2 hrs to fix

                              Function CustomReviewTopContent has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const CustomReviewTopContent = () => {
                                const { form } = useSelector(state => state || {});
                                const { uploadedFile, idNumber, address, fullName } = form?.data;
                              
                                const renderFileInfo = file => (

                                Function ConfirmationPage has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const ConfirmationPage = () => {
                                  const { user, form } = useSelector(state => state);
                                  const { submission, data } = form;
                                  const {
                                    login: { currentlyLoggedIn },
                                Severity: Major
                                Found in src/applications/ask-va/containers/ConfirmationPage.jsx - About 2 hrs to fix

                                  Function aboutTheSchoolOptions has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function aboutTheSchoolOptions(
                                    excludeCautionFlags,
                                    accredited,
                                    studentVeteran,
                                    yellowRibbonScholarship,
                                  Severity: Major
                                  Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 2 hrs to fix

                                    Function typeOfInstitution has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      const typeOfInstitution = () => {
                                        const title = 'Filter your results';
                                        return (
                                          <>
                                            <hr />
                                    Severity: Major
                                    Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 2 hrs to fix

                                      Function RadioWidget has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export default function RadioWidget(props) {
                                        const { options, formContext = {}, value, disabled, onChange, id } = props;
                                        const { enumOptions, labels = {} } = options;
                                      
                                        const onReviewPage = formContext?.onReviewPage || false;

                                        Function GenderIdentityAdditionalInfo has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export default function GenderIdentityAdditionalInfo() {
                                          return (
                                            <>
                                              <p className="vads-u-color--gray-medium vads-u-display--block vads-u-font-weight--normal vads-u-margin--0 vads-u-width--full">
                                                You can change your selection at any time. If you decide you no longer
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language