department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,745 of 12,716 total issues

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

const all = {
  resourceType: 'Bundle',
  id: '8d8b7708-da2e-41f6-90ec-12b8477635f1',
  meta: {
    lastUpdated: '2024-05-31T11:21:05.570-04:00',
Severity: Major
Found in src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js - About 1 wk to fix

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

    const all = {
      entry: [
        {
          // #####################################################################################
          // ##################################################################################### Blood pressure
    Severity: Major
    Found in src/platform/mhv/api/mocks/medical-records/vitals/index.js - About 1 wk to fix

      File mockData.js has 2226 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      export const healthFacilityMockData = {
        data: [
          {
            id: 'vba_349b',
            type: 'facility',
      Severity: Major
      Found in src/applications/ask-va/utils/mockData.js - About 6 days to fix

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

        const all = {
          id: '5177513c-0db5-4c07-8b5f-05f57e00c044',
          meta: {
            lastUpdated: '2024-07-01T16:06:49.182-04:00',
          },

          File appeals-v2-helpers.jsx has 1901 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import moment from 'moment';
          import { find, get, startCase } from 'lodash';
          import * as Sentry from '@sentry/browser';
          import { Link } from 'react-router-dom-v5-compat';
          Severity: Major
          Found in src/applications/claims-status/utils/appeals-v2-helpers.jsx - About 5 days to fix

            File messageDetails.js has 1793 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            const { sub, formatISO } = require('date-fns');
            
            const messageDetails = {
              data: [
                {
            Severity: Major
            Found in src/platform/mhv/api/mocks/secure-messaging/messages/messageDetails.js - About 4 days to fix

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

              const set = require('lodash/set');
              const cloneDeep = require('lodash/cloneDeep');
              /**
               * Loops through the claims array and adds the claims to the user object
               *
              Severity: Major
              Found in src/applications/personalization/profile/mocks/endpoints/user/index.js - About 4 days to fix

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

                const has3Copays = {
                  data: [
                    {
                      id: '53a48388-38d3-41da-a187-b7680462db4c',
                      pSSeqNum: 1,

                  Function getDerivedValues has a Cognitive Complexity of 213 (exceeds 5 allowed). Consider refactoring.
                  Open

                    (constant, eligibility, institution, inputs) => {
                      if (
                        [constant, eligibility, institution, inputs].some(e => !e || isEmpty(e))
                      ) {
                        return {};
                  Severity: Minor
                  Found in src/applications/gi/selectors/calculator.js - About 4 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

                  Function V1V3Page has 860 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function V1V3Page() {
                    /** @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-playground/pages/V1V3Page.jsx - About 4 days to fix

                    Function ComposeForm has 813 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

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

                      const set = require('lodash/set');
                      const cloneDeep = require('lodash/cloneDeep');
                      /**
                       * Loops through the claims array and adds the claims to the user object
                       *

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

                        const set = require('lodash/set');
                        const cloneDeep = require('lodash/cloneDeep');
                        /**
                         * Loops through the claims array and adds the claims to the user object
                         *
                        Severity: Major
                        Found in src/applications/representative-appoint/mocks/endpoints/user/index.js - About 3 days to fix

                          File responses.js has 1454 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          const commonResponses = require('../../../platform/testing/local-dev-mock-api/common');
                          
                          module.exports = {
                            ...commonResponses,
                            'GET /v0/feature_toggles': {
                          Severity: Major
                          Found in src/applications/financial-status-report/mocks/responses.js - About 3 days to fix

                            Function getDerivedValues has 768 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              (constant, eligibility, institution, inputs) => {
                                if (
                                  [constant, eligibility, institution, inputs].some(e => !e || isEmpty(e))
                                ) {
                                  return {};
                            Severity: Major
                            Found in src/applications/gi/selectors/calculator.js - About 3 days to fix

                              Function formReducer has 664 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function formReducer(state = initialState, action) {
                                switch (action.type) {
                                  case FORM_PAGE_OPENED: {
                                    const { data, schema } = setupFormData(
                                      state.data,
                              Severity: Major
                              Found in src/applications/vaos/new-appointment/redux/reducer.js - About 3 days to fix

                                File countryList.js has 1243 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                const countryList = [
                                  {
                                    key: 'AFG',
                                    label: 'Afghanistan',
                                    value: 'AFG',
                                Severity: Major
                                Found in src/applications/check-in/utils/appConstants/countryList.js - About 3 days to fix

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

                                  import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                                  import React from 'react';
                                  import { externalServices } from 'platform/monitoring/DowntimeNotification';
                                  import {
                                    checkboxGroupSchema,
                                  Severity: Major
                                  Found in src/applications/ivc-champva/10-10D/config/form.js - About 3 days to fix

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

                                    import React from 'react';
                                    import { createSelector } from 'reselect';
                                    
                                    import fullSchema5490 from 'vets-json-schema/dist/22-5490-schema.json';
                                    import commonDefinitions from 'vets-json-schema/dist/definitions.json';
                                    Severity: Major
                                    Found in src/applications/fry-dea/config/form.js - About 3 days to fix

                                      Function LandingPage has 629 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const LandingPage = () => {
                                        const user = useSelector(selectUser);
                                        const dispatch = useDispatch();
                                        const location = useLocation();
                                        const fullState = useSelector(state => state);
                                      Severity: Major
                                      Found in src/applications/mhv-medications/containers/LandingPage.jsx - About 3 days to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language