department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

File schemas.js has 293 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { createSelector } from 'reselect';
import { merge, omit } from 'lodash';
import fullSchema from 'vets-json-schema/dist/21-526EZ-ALLCLAIMS-schema.json';

import _ from 'platform/utilities/data';
Severity: Minor
Found in src/applications/disability-benefits/all-claims/utils/schemas.js - About 3 hrs to fix

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

    import _ from 'platform/utilities/data';
    import { isValidPhone, isValidEmail } from 'platform/forms/validations';
    import {
      MILITARY_CITY_CODES,
      MILITARY_STATE_CODES,
    Severity: Minor
    Found in src/applications/financial-status-report/utils/validations.js - About 3 hrs to fix

      File AttachmentsList.jsx has 292 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { useEffect, useRef, useState } from 'react';
      import PropTypes from 'prop-types';
      import recordEvent from 'platform/monitoring/record-event';
      import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
      import { VaAlert } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
      Severity: Minor
      Found in src/applications/mhv-secure-messaging/components/AttachmentsList.jsx - About 3 hrs to fix

        Function getFormDOM has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function getFormDOM(form) {
          const formDOM = form?.container || findDOMNode(form);
        
          if (!formDOM) {
            throw new Error(
        Severity: Major
        Found in src/platform/testing/unit/schemaform-utils.jsx - About 3 hrs to fix

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

          const OverviewPage = () => {
            const title = 'Your VA debt and bills';
            useHeaderPageTitle(title);
          
            useEffect(() => {

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

              render() {
                const { defaultSelectedItem } = this.state;
                const { showError, currentQuery, handleServiceTypeChange } = this.props;
                return (
                  <Downshift
            Severity: Major
            Found in src/applications/facility-locator/components/ServiceTypeAhead.jsx - About 3 hrs to fix

              Function priorServiceStatement has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const priorServiceStatement = formValues => {
                switch (formValues['12_priorService']) {
                  case '1':
                    return (
                      <AlertMessage

                Function priorServiceStatement has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const priorServiceStatement = () => {
                    switch (formResponses[SHORT_NAME_MAP.PRIOR_SERVICE]) {
                      case RESPONSES.PRIOR_SERVICE_PAPERWORK_YES:
                        return (
                          <AlertMessage

                  Consider simplifying this complex logical expression.
                  Open

                    if (isDomesticAddress) {
                      address = {
                        country: 'United States',
                        street:
                          address1 &&
                  Severity: Critical
                  Found in src/applications/edu-benefits/feedback-tool/helpers.js - About 3 hrs to fix

                    Function HomepageSearch has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const HomepageSearch = () => {
                      const [userInput, setUserInput] = useState('');
                      const [latestSuggestions, setLatestSuggestions] = useState([]);
                    
                      // fetch Typeahead suggestions from API
                    Severity: Major
                    Found in src/applications/static-pages/homepage/HomepageSearch.jsx - About 3 hrs to fix

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

                        render() {
                          if (
                            // Prevent RUM from running on local/CI environments.
                            environment.BASE_URL.indexOf('localhost') < 0 &&
                            // Prevent re-initializing the SDK.
                      Severity: Major
                      Found in src/applications/disability-benefits/2346/containers/App.jsx - About 3 hrs to fix

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

                          render() {
                            const rowId = `disability-row-${this.props.indx + 1}`;
                            const containerClasses = classNames(
                              'vads-u-padding-x--4 vads-u-margin-y--1',
                              this.props.disability.errorMessage

                          Function formConfig has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const formConfig = (pathname = null) => {
                            const { title, subTitle, formNumber } = getFormContent(pathname);
                          
                            return {
                              rootUrl: manifest.rootUrl,
                          Severity: Major
                          Found in src/applications/simple-forms/form-upload/config/form.js - About 3 hrs to fix

                            Function getEditView has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const getEditView = () => {
                                const { SchemaField } = registry.fields;
                                const newUISchema = omit(
                                  ['ui:field', 'ui:title', 'ui:description'],
                                  uiSchema,

                              Function TrashButton has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const TrashButton = props => {
                                const { activeFolder, messageId, threadId, visible } = props;
                                const dispatch = useDispatch();
                                const history = useHistory();
                                const [isDeleteVisible, setIsDeleteVisible] = useState(false);

                                Function initialSchema has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    initialSchema() {
                                      let newSchema = initialSchema;
                                
                                      let filteredClinics = clinics;
                                
                                

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if (isEditing) {
                                                return (
                                                  <div
                                                    key={index}
                                                    id={`${this.props.idSchema.$id}_${index}`}
                                  Severity: Critical
                                  Found in src/applications/pre-need-integration/components/DeceasedPersons.jsx - About 3 hrs to fix

                                    Function VitalListItem has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const VitalListItem = props => {
                                      const { record } = props;
                                      const displayName = vitalTypeDisplayNames[record.type];
                                    
                                      const updatedRecordType = useMemo(

                                      Function eobUploadSchema has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const eobUploadSchema = isPrimary => {
                                        const keyName = isPrimary ? 'primaryEob' : 'secondaryEob';
                                        return {
                                          CustomPage: FileFieldWrapped,
                                          CustomPageReview: null,
                                      Severity: Major
                                      Found in src/applications/ivc-champva/10-7959a/chapters/claimInformation.js - About 2 hrs to fix

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

                                        import {
                                          individualsInvolved,
                                          individualsInvolvedFollowUp,
                                          incidentSupport,
                                          incidentDate,
                                        Severity: Minor
                                        Found in src/applications/disability-benefits/all-claims/config/781/index.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language