department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,827 of 12,827 total issues

Function SpouseGrossMonthlyIncomeInput has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

const SpouseGrossMonthlyIncomeInput = props => {
  const { goToPath, goBack, setFormData } = props;

  const editIndex = getJobIndex();

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

const GrossMonthlyIncomeInput = props => {
  const { goToPath, goBack, setFormData } = props;

  const editIndex = getJobIndex();

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

function parseTestFile(features, code) {
  const stack = [];
  const ast = parser.parse(code, { sourceType: 'module', plugins: ['jsx'] });
  traverse.default(ast, {
    enter(path) {
Severity: Minor
Found in src/applications/vaos/scripts/gherkin.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 FilterYourResults has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

export function FilterYourResults({
  dispatchFilterChange,
  dispatchError,
  filters,
  modalClose,
Severity: Minor
Found in src/applications/gi/containers/FilterYourResults.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

File PreSubmitSection.jsx has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// libs
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
Severity: Minor
Found in src/platform/forms/components/review/PreSubmitSection.jsx - About 2 hrs to fix

    File helpers.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import moment from 'moment';
    import { addDays, format, isValid } from 'date-fns';
    import { toggleValues } from '~/platform/site-wide/feature-toggles/selectors';
    import FEATURE_FLAG_NAMES from '~/platform/utilities/feature-toggles/featureFlagNames';
    import { deductionCodes } from '../constants/deduction-codes';
    Severity: Minor
    Found in src/applications/financial-status-report/utils/helpers.js - About 2 hrs to fix

      File InstitutionProfile.jsx has 274 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable jsx-a11y/anchor-has-content */
      import React from 'react';
      
      import { getScrollOptions } from 'platform/utilities/ui';
      import scrollTo from 'platform/utilities/ui/scrollTo';
      Severity: Minor
      Found in src/applications/gi/components/profile/InstitutionProfile.jsx - About 2 hrs to fix

        Function createDirectDepositPage has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function createDirectDepositPage() {
          const bankAccountProperties = {
            type: 'object',
            properties: {
              accountType: {
        Severity: Major
        Found in src/applications/edu-benefits/10203/pages/DirectDeposit.jsx - About 2 hrs to fix

          Function IntroductionPage has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function IntroductionPage(props) {
            const { route } = props;
            const { formConfig, pageList } = route;
            const { appType } = formConfig?.customText;
          
          
          Severity: Major
          Found in src/applications/ivc-champva/10-7959a/containers/IntroductionPage.jsx - About 2 hrs to fix

            Function libraryFilters has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function libraryFilters(el) {
              // Grab our current page from the active pager button.
              if (el.srcElement.classList.contains('pager-numbers')) {
                activePage = parseInt(el.srcElement.text, 10);
                sessionStorage.setItem('pageNum', parseInt(el.srcElement.text, 10));

              Function ArrivedAtFacility has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const ArrivedAtFacility = props => {
                const { router } = props;
                const { t } = useTranslation();
                const dispatch = useDispatch();
                const { goToNextPage } = useFormRouting(router);
              Severity: Major
              Found in src/applications/check-in/day-of/pages/ArrivedAtFacility.jsx - About 2 hrs to fix

                Function transformTOEForm has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function transformTOEForm(_formConfig, form) {
                  const formFieldUserFullName = form?.data['view:userFullName']?.userFullName;
                  const viewComponentUserFullName =
                    form?.loadedData?.formData['view:userFullName']?.userFullName;
                  const formFieldDateOfBirth = form?.data?.dateOfBirth;
                Severity: Major
                Found in src/applications/toe/utils/form-submit-transform.js - About 2 hrs to fix

                  Function IntroductionPage has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const IntroductionPage = props => {
                    const dispatch = useDispatch();
                    const { hasVaFileNumber, isLoading } = useSelector(
                      state => state?.vaFileNumber,
                    );

                    Function LandingPageUnauth has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const LandingPageUnauth = () => {
                      const dispatch = useDispatch();
                      const handleSignIn = () => {
                        dispatch(toggleLoginModal(true, 'mhv-sm-landing-page'));
                      };

                      Function selectRequestedAppointmentDetails has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function selectRequestedAppointmentDetails(state, id) {
                        const { appointmentDetailsStatus, facilityData } = state.appointments;
                        const featureVAOSServiceCCAppointments = selectFeatureVAOSServiceCCAppointments(
                          state,
                        );
                      Severity: Major
                      Found in src/applications/vaos/appointment-list/redux/selectors.js - About 2 hrs to fix

                        Function specializedMissionAttributes has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const specializedMissionAttributes = () => {
                            const options = [
                              {
                                name: 'specialMissionHbcu',
                                checked: specialMissionHbcu,
                        Severity: Major
                        Found in src/applications/gi/containers/FilterYourResults.jsx - About 2 hrs to fix

                          Function StemAskVAQuestions has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function StemAskVAQuestions() {
                            const handler = {
                              recordLinkClick: () => {
                                recordEvent({
                                  event: 'nav-ask-va-questions-link-click',
                          Severity: Major
                          Found in src/applications/claims-status/components/StemAskVAQuestions.jsx - About 2 hrs to fix

                            Function mapRating has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const mapRating = institution => {
                                const { type } = institution; // used to identify if the training is OJT
                                let ratingAverage = false;
                                let ratingCount = -1;
                                let institutionRatingIsNotNull = false;
                            Severity: Major
                            Found in src/applications/gi/containers/CompareLayout.jsx - About 2 hrs to fix

                              Function validateMilitaryHistory has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const validateMilitaryHistory = (errors, serviceRecords, formData) => {
                                // Map the highestRank to the corresponding Rank Description from jsonData
                                const rankMap = jsonData.reduce((map, rank) => {
                                  // eslint-disable-next-line no-param-reassign
                                  map[rank['Rank Code'].toUpperCase()] = rank[
                              Severity: Major
                              Found in src/applications/pre-need-integration/utils/helpers.js - About 2 hrs to fix

                                Function mapStateToProps has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const mapStateToProps = state => {
                                  const togglesLoaded = togglesAreLoaded(state);
                                  const profileToggles = selectProfileToggles(state);
                                  const signInServicesEligibleForDD = new Set([
                                    CSP_IDS.ID_ME,
                                Severity: Major
                                Found in src/applications/personalization/profile/components/Profile.jsx - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language