department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

File EstimatedBenefits.jsx has 255 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import _ from 'lodash';
import { createId } from '../../utils/helpers';
Severity: Minor
Found in src/applications/gi/components/profile/EstimatedBenefits.jsx - About 2 hrs to fix

    Function perTermSections has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const perTermSections = () => {
        const { perTerm } = outputs;
    
        const sections = Object.keys(perTerm).map(section => {
          const {
    Severity: Major
    Found in src/applications/gi/components/profile/EstimatedBenefits.jsx - About 2 hrs to fix

      Function CareSummariesDetails has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const CareSummariesDetails = () => {
        const dispatch = useDispatch();
        const careSummary = useSelector(
          state => state.mr.careSummariesAndNotes.careSummariesAndNotesDetails,
        );

        Function generateAccountSummaryContent has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const generateAccountSummaryContent = record => {
          const { authenticationSummary, vaTreatmentFacilities } = record;
        
          return {
            details: {

          Function convertDemographics has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const convertDemographics = patient => {
            if (!patient) return null;
            const { userProfile: profile } = patient;
            return {
              firstName: profile.name.firstName || NONE_ENTERED,
          Severity: Major
          Found in src/applications/mhv-medical-records/reducers/selfEnteredData.js - About 2 hrs to fix

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

            const all = {
              id: '868a0f70-f920-4483-9be4-fa64f65d2e85',
              meta: {
                lastUpdated: '2023-07-21T12:22:25.721-04:00',
              },
            Severity: Minor
            Found in src/platform/mhv/api/mocks/medical-records/vaccines/index.js - About 2 hrs to fix

              File VerificationReviewWrapper.jsx has 254 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* eslint-disable no-unused-expressions */
              import React, { useState, useEffect } from 'react';
              import { useHistory } from 'react-router-dom';
              import PropTypes from 'prop-types';
              import { connect, useDispatch } from 'react-redux';

                File index.jsx has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useEffect, useState } from 'react';
                import PropTypes from 'prop-types';
                import { connect } from 'react-redux';
                import { cloneDeep } from 'lodash';
                import { setData } from 'platform/forms-system/src/js/actions';
                Severity: Minor
                Found in src/applications/caregivers/components/PreSubmitInfo/index.jsx - About 2 hrs to fix

                  Function createRichTextDetailItem has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const createRichTextDetailItem = async (doc, config, x, item) => {
                    let titleText = item.title ?? '';
                    const content = [];
                  
                    if (titleText) {
                  Severity: Minor
                  Found in src/platform/pdf/templates/utils.js - About 2 hrs 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 waitForRenderThenFocus has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function waitForRenderThenFocus(
                    selector,
                    root = document,
                    timeInterval = defaultTime,
                    // added because we first need to wait for a component to be rendered, then we
                  Severity: Minor
                  Found in src/platform/utilities/ui/focus.js - About 2 hrs 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 componentDidUpdate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                    componentDidUpdate(prevProps) {
                      const {
                        fieldName,
                        forceEditView,
                        successCallback,

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

                  const ProfileInformationView = props => {
                    const { data, fieldName, title, id } = props;
                  
                    const titleLower = title.toLowerCase();
                  
                  

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

                  const ReviewPage = ({
                    dependentsInput,
                    editMode,
                    pastMode,
                    router,
                  Severity: Minor
                  Found in src/applications/income-limits/containers/ReviewPage.jsx - About 2 hrs 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 getBoardExplanation has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getBoardExplanation = formResponses => {
                    const reason = formResponses[SHORT_NAME_MAP.REASON];
                    const noPrevApp =
                      formResponses[SHORT_NAME_MAP.PREV_APPLICATION] === RESPONSES.NO;
                    const prevAppType = formResponses[SHORT_NAME_MAP.PREV_APPLICATION_TYPE];
                  Severity: Minor
                  Found in src/applications/discharge-wizard/helpers/index.jsx - About 2 hrs 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 IntroductionPage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const IntroductionPage = props => {
                    const dispatch = useDispatch();
                    const { hasVaFileNumber, isLoading } = useSelector(
                      state => state?.vaFileNumber,
                    );
                  Severity: Minor
                  Found in src/applications/686c-674/containers/IntroductionPage.jsx - About 2 hrs 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 componentDidUpdate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                    componentDidUpdate(prevProps) {
                      const {
                        fieldName,
                        forceEditView,
                        successCallback,

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

                  export const ContactInfo = ({
                    data,
                    goBack,
                    goForward,
                    onReviewPage,

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

                    componentDidUpdate(prevProps) {
                      const {
                        fieldName,
                        forceEditView,
                        successCallback,

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

                    componentDidUpdate(prevProps) {
                      const {
                        fieldName,
                        forceEditView,
                        successCallback,

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

                  export function prefillTransformerV2(pages, formData, metadata, state) {
                    const bankInformation = state.data?.bankInformation || {};
                    const claimant = state.data?.formData?.data?.attributes?.claimant || {};
                    const contactInfo = claimant?.contactInfo || {};
                    const sponsors = state.data?.formData?.attributes?.sponsors;
                  Severity: Minor
                  Found in src/applications/toe/helpers.jsx - About 2 hrs 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

                  Severity
                  Category
                  Status
                  Source
                  Language