department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

File FileField.jsx has 595 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
/* Customized copy of Platform's FileField component
  * - Adds new optional prop `ariaLabelAdditionalText` to append additional
  *   text to the upload button's aria-label attribute.
*/
Severity: Major
Found in src/applications/simple-forms/40-0247/components/FileField.jsx - About 1 day to fix

    Function FolderThreadListView has 256 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const FolderThreadListView = props => {
      const { testing } = props;
      const dispatch = useDispatch();
      const error = null;
      const threadsPerPage = THREADS_PER_PAGE_DEFAULT;

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

      import merge from 'lodash/merge';
      import fullSchema from 'vets-json-schema/dist/FEEDBACK-TOOL-schema.json';
      import dateRangeUI from 'platform/forms-system/src/js/definitions/dateRange';
      import phoneUI from 'platform/forms-system/src/js/definitions/phone';
      import emailUI from 'platform/forms-system/src/js/definitions/email';
      Severity: Major
      Found in src/applications/edu-benefits/feedback-tool/config/form.js - About 1 day to fix

        File FileField.jsx has 592 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
        import PropTypes from 'prop-types';
        import React, { useEffect, useState, useRef } from 'react';
        import { connect } from 'react-redux';
        import classNames from 'classnames';
        Severity: Major
        Found in src/applications/pre-need/components/FileField.jsx - About 1 day to fix

          Function FacilitySearch has 255 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const FacilitySearch = props => {
            const { data: formData, goBack, goForward, goToPath } = props;
            const [query, setQuery] = useState('');
            const [submittedQuery, setSubmittedQuery] = useState('');
            const [loading, setLoading] = useState(false);
          Severity: Major
          Found in src/applications/caregivers/components/FormFields/FacilitySearch.jsx - About 1 day to fix

            Function EditContactList has 253 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const EditContactList = () => {
              const dispatch = useDispatch();
              const location = useLocation();
              const history = useHistory();
              const [allTriageTeams, setAllTriageTeams] = useState(null);
            Severity: Major
            Found in src/applications/mhv-secure-messaging/containers/EditContactList.jsx - About 1 day to fix

              File getStatusContents.jsx has 588 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from 'react';
              import { format } from 'date-fns';
              import _ from 'lodash';
              import * as Sentry from '@sentry/browser';
              import { Link } from 'react-router';

                Function FileField has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                Open

                const FileField = props => {
                  const {
                    enableShortWorkflow,
                    errorSchema,
                    formContext,
                Severity: Minor
                Found in src/applications/simple-forms/40-0247/components/FileField.jsx - About 1 day 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 render has 252 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    const {
                      uiSchema,
                      errorSchema,
                      idSchema,
                Severity: Major
                Found in src/platform/forms-system/src/js/fields/ArrayField.jsx - About 1 day to fix

                  Function SearchControls has 252 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const SearchControls = props => {
                    const {
                      currentQuery,
                      onChange,
                      geolocateUser,

                    Function DashboardCards has 252 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const DashboardCards = () => {
                      const [error, hasError] = useState(false);
                      const [inquiries, setInquiries] = useState([]);
                      const [lastUpdatedFilter, setLastUpdatedFilter] = useState('newestToOldest');
                      const [statusFilter, setStatusFilter] = useState('All');
                    Severity: Major
                    Found in src/applications/ask-va/containers/DashboardCardsMock.jsx - About 1 day to fix

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

                      import fullSchemaHca from 'vets-json-schema/dist/10-10EZ-schema.json';
                      
                      // platform imports
                      import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                      import FormFooter from '@department-of-veterans-affairs/platform-forms/FormFooter';
                      Severity: Major
                      Found in src/applications/hca/config/form.js - About 1 day to fix

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

                        const ConfirmationPage = props => {
                          const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
                          const showUpdatedConfirmation = useToggleValue(
                            TOGGLE_NAMES.pensionConfirmationUpdate,
                          );
                        Severity: Major
                        Found in src/applications/pensions/containers/ConfirmationPage.jsx - About 1 day to fix

                          Function transform has 250 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const transform = (formConfig, form) => {
                            const {
                              questions,
                              personalIdentification,
                              personalData: {
                          Severity: Major
                          Found in src/applications/financial-status-report/utils/transform.js - About 1 day to fix

                            File disabilityLabelsRevised.js has 582 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            // note: the id's are no longer used for classification, but are kept here for compatibility with the old code
                            
                            export default {
                              0: 'ACL tear (anterior cruciate ligament tear), bilateral',
                              1: 'ACL tear (anterior cruciate ligament tear), left',

                              Function FileField has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const FileField = props => {
                                const {
                                  enableShortWorkflow,
                                  errorSchema,
                                  formContext,
                              Severity: Minor
                              Found in src/platform/forms-system/src/js/fields/FileField.jsx - About 1 day 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 FileField has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const FileField = props => {
                                const {
                                  errorSchema,
                                  formContext,
                                  formData = [],
                              Severity: Minor
                              Found in src/applications/appeals/shared/components/FileField.jsx - About 1 day 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 SectionField.jsx has 577 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import React from 'react';
                              import { formatSSN } from 'platform/utilities/ui';
                              import { getJobTitleOrType } from '../helpers';
                              
                              export const convertDateFormat = date => {
                              Severity: Major
                              Found in src/applications/pensions/components/SectionField.jsx - About 1 day to fix

                                Function renderProfileCalculatorModals has 246 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  const renderProfileCalculatorModals = () => {
                                    const whenUsedGiBill = (
                                      <div>
                                        <p>
                                          Effective January 1, 2018, the Post-9/11 GI Bill monthly housing
                                Severity: Major
                                Found in src/applications/gi/containers/Modals.jsx - About 1 day to fix

                                  Function TermsOfUse has 244 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export default function TermsOfUse() {
                                    const isAuthenticatedWithSiS = useSelector(isAuthenticatedWithOAuth);
                                    const isAuthenticatedWithIAM = useSelector(isAuthenticatedWithSSOe);
                                    const [isDisabled, setIsDisabled] = useState(false);
                                    const [isMiddleAuth, setIsMiddleAuth] = useState(true);
                                  Severity: Major
                                  Found in src/applications/terms-of-use/containers/TermsOfUse.jsx - About 1 day to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language