department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function FileField has 543 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FileField = props => {
  const {
    enableShortWorkflow,
    errorSchema,
    formContext,
Severity: Major
Found in src/applications/simple-forms/40-0247/components/FileField.jsx - About 2 days to fix

    File moment-tz.js has 1071 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* istanbul ignore file */
    //! moment-timezone.js
    //! version : 0.5.25
    //! Copyright (c) JS Foundation and other contributors
    //! license : MIT
    Severity: Major
    Found in src/applications/vaos/lib/moment-tz.js - About 2 days to fix

      Function FileField has 533 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const FileField = props => {
        const {
          enableShortWorkflow,
          errorSchema,
          formContext,
      Severity: Major
      Found in src/applications/pre-need/components/FileField.jsx - About 2 days to fix

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

        import fullSchema from 'vets-json-schema/dist/686C-674-schema.json';
        import environment from 'platform/utilities/environment';
        import { arrayBuilderPages } from 'platform/forms-system/src/js/patterns/array-builder';
        import FormFooter from 'platform/forms/components/FormFooter';
        import { externalServices } from 'platform/monitoring/DowntimeNotification';
        Severity: Major
        Found in src/applications/disability-benefits/686c-674-v2/config/form.js - About 2 days to fix

          Function content has 530 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const content = () => {
              return (
                <>
                  <div className="main-content">
                    <section className="vads-u-margin-bottom--3 mobile-lg:vads-u-margin-bottom--4">
          Severity: Major
          Found in src/applications/mhv-medications/containers/LandingPage.jsx - About 2 days to fix

            File Modals.jsx has 1016 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from 'react';
            import PropTypes from 'prop-types';
            import { connect } from 'react-redux';
            import recordEvent from 'platform/monitoring/record-event';
            import { VaModal } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
            Severity: Major
            Found in src/applications/gi/containers/Modals.jsx - About 2 days to fix

              Function ReplyDraftItem has 502 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const ReplyDraftItem = props => {
                const {
                  draft,
                  drafts,
                  cannotReply,

                Function FileField has 501 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const FileField = props => {
                  const {
                    errorSchema,
                    formContext,
                    formData = [],
                Severity: Major
                Found in src/applications/appeals/shared/components/FileField.jsx - About 2 days to fix

                  Function getDebtDetailsCardContent has 488 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const getDebtDetailsCardContent = (debt, dateOfLetter, amountDue) => {
                    const endDateText = endDate(dateOfLetter, debt.diaryCode);
                  
                    switch (debt.diaryCode) {
                      case '71':

                    File seiFamilyHealthHistory.js has 943 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    const familyHealthHistory = {
                      success: true,
                      failure: false,
                      pojoObject: [
                        {

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

                      /* eslint-disable camelcase */
                      import moment from 'moment';
                      import * as Sentry from '@sentry/browser';
                      import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
                      import { selectVAPResidentialAddress } from '@department-of-veterans-affairs/platform-user/selectors';
                      Severity: Major
                      Found in src/applications/vaos/new-appointment/redux/actions.js - About 2 days to fix

                        Function V3BasePage has 461 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function V3BasePage() {
                          /** @param {import('react').FormEvent | import('@department-of-veterans-affairs/web-components/dist/types/components').VaSelectCustomEvent } evt */
                          function updateValue(evt) {
                            const { value, name } = /** @type {HTMLInputElement} */ (evt.target);
                            const display = document.getElementById(`${name}Value`);
                        Severity: Major
                        Found in src/applications/ds-v3-playground/pages/V3BasePage.jsx - About 2 days to fix

                          File seiFoodJournal.js has 915 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          const foodJournal = [
                            {
                              foodJournalId: 20208041,
                              oplock: null,
                              glassesOfWater: 5,

                            Function ComposeForm has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const ComposeForm = props => {
                              const { pageTitle, headerRef, draft, recipients, signature } = props;
                              const {
                                noAssociations,
                                allTriageGroupsBlocked,

                            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 CalculateYourBenefitsForm has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function CalculateYourBenefitsForm({
                              calculatorInputChange,
                              displayedInputs,
                              eligibility,
                              eligibilityChange,
                            Severity: Minor
                            Found in src/applications/gi/components/profile/CalculateYourBenefitsForm.jsx - About 2 days 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 ComposeForm.jsx has 892 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React, { useState, useEffect, useMemo, useCallback } from 'react';
                            import PropTypes from 'prop-types';
                            import { validateNameSymbols } from 'platform/forms-system/src/js/web-component-patterns/fullNamePattern';
                            import { useDispatch, useSelector } from 'react-redux';
                            import { useHistory } from 'react-router-dom';

                              File V1V3Page.jsx has 886 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /**
                               * This page is for testing the compatibility of running v1 and v3 components on the same page.
                               */
                              
                              import React, { useState } from 'react';
                              Severity: Major
                              Found in src/applications/ds-playground/pages/V1V3Page.jsx - About 2 days to fix

                                Function getNextEvents has 426 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function getNextEvents(appeal) {
                                  const { type: currentStatus, details } = appeal.attributes.status;
                                  const appealType = appeal.type;
                                
                                  switch (currentStatus) {
                                Severity: Major
                                Found in src/applications/claims-status/utils/appeals-v2-helpers.jsx - About 2 days to fix

                                  Function covid19VaccineReducer has 425 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export default function covid19VaccineReducer(state = initialState, action) {
                                    switch (action.type) {
                                      case FORM_PAGE_OPENED: {
                                        const { newBooking } = state;
                                        const { data, schema } = setupFormData(
                                  Severity: Major
                                  Found in src/applications/vaos/covid-19-vaccine/redux/reducer.js - About 2 days to fix

                                    File formSubmitTransformers.unit.spec.js has 875 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { expect } from 'chai';
                                    
                                    import {
                                      transformFormToCCRequest,
                                      transformFormToVARequest,
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language