department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

File accelerated.js has 11047 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable no-unused-vars */
const entries = [
  {
    fullUrl:
      'https://sandbox-api.va.gov/services/fhir/v0/r4/Observation/4-1bKlpYjrXYfgnN',
Severity: Major
Found in src/platform/mhv/api/mocks/medical-records/vitals/accelerated.js - About 1 mo to fix

    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 2287 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const all = {
        entry: [
          // #####################################################################################
          // ##################################################################################### Heart Rate
          // #####################################################################################
      Severity: Major
      Found in src/platform/mhv/api/mocks/medical-records/vitals/index.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 seiVaccines.js has 1963 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          const vaccines = {
            success: true,
            failure: false,
            pojoObject: [
              {
          Severity: Major
          Found in src/platform/mhv/api/mocks/medical-records/self-entered/seiVaccines.js - About 5 days to fix

            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 mockData.js has 1883 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 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 835 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          File inboxThreads.js has 1507 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          const { sub, formatISO } = require('date-fns');
                          const {
                            senderInfo,
                            categoryInfo,
                            triageGroupNames,
                          Severity: Major
                          Found in src/platform/mhv/api/mocks/secure-messaging/threads/inboxThreads.js - About 4 days to fix

                            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 Prescriptions has 755 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const Prescriptions = () => {
                                    const { search } = useLocation();
                                    const history = useHistory();
                                    const dispatch = useDispatch();
                                    const paginatedPrescriptionsList = useSelector(
                                  Severity: Major
                                  Found in src/applications/mhv-medications/containers/Prescriptions.jsx - About 3 days to fix

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

                                    import React from 'react';
                                    import { Link } from 'react-router';
                                    
                                    import currentOrPastDateUI from 'platform/forms-system/src/js/definitions/currentOrPastDate';
                                    
                                    

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

                                      const LandingPage = () => {
                                        const dispatch = useDispatch();
                                        const fullState = useSelector(state => state);
                                        const displayNotes = useSelector(selectNotesFlag);
                                        const displayVaccines = useSelector(selectVaccinesFlag);
                                      Severity: Major
                                      Found in src/applications/mhv-medical-records/containers/LandingPage.jsx - About 3 days to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language