Showing 4,177 of 14,709 total issues
Function updateRequiredFields
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export function updateRequiredFields(schema, uiSchema, formData, index = null) {
if (!uiSchema) {
return schema;
}
- Read upRead up
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 render
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { location } = this.props;
if (!location) {
return null;
- Read upRead up
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 Dropdown
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const Dropdown = ({
shortName,
router,
formResponses,
formValue,
- Read upRead up
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 nextQuestion
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
function nextQuestion(currentQuestion, answer, state) {
let next;
const noGeneralCourtMartial = ['2', '3'].includes(state['7_courtMartial']);
const dischargeYear = state['2_dischargeYear'];
const dischargeMonth = state['3_dischargeMonth'] || 1;
- Read upRead up
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 RadioGroup
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const RadioGroup = ({
formError,
formResponses,
formValue,
hint,
- Read upRead up
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 ProfilePageHeader
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const ProfilePageHeader = ({
compare,
dispatchAddCompareInstitution,
dispatchRemoveCompareInstitution,
institution,
- Read upRead up
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 getDerivedAttributes
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export function getDerivedAttributes(constant, eligibility, institution) {
const your = eligibility;
const its = institution;
const chapter = Number(your.giBillChapter);
let monthlyRate;
- Read upRead up
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 NewRecordsIndicator
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const NewRecordsIndicator = ({
refreshState,
extractType,
newRecordsFound,
reloadFunction,
- Read upRead up
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 helpers.js
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment-timezone';
import DOMPurify from 'dompurify';
import {
DefaultFolders as Folders,
Paths,
Function SearchQueryReducer
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SearchQueryReducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
case SEARCH_STARTED:
return {
...state,
Function render
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { showWizard } = this.props;
if (showWizard === undefined) return null;
return (
File SearchControls.jsx
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useRef, useState } from 'react';
import recordEvent from 'platform/monitoring/record-event';
import { focusElement } from 'platform/utilities/ui';
import classNames from 'classnames';
import {
File medicareInformation.js
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import {
titleUI,
titleSchema,
textUI,
File MissingFileOverview.jsx
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
OVERVIEW:
The MissingFileOverview component is responsible for tracking file uploads
within the form and displaying a message to the user indicating which files
they have yet to upload before the application is considered complete.
File confirmation-page.jsx
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
import DownloadPDF from '../components/DownloadPDF';
File form.js
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { VA_FORM_IDS } from 'platform/forms/constants';
import preSubmitInfo from 'platform/forms/preSubmitInfo';
import FormFooter from 'platform/forms/components/FormFooter';
import { externalServices as services } from 'platform/monitoring/DowntimeNotification';
File form.js
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
import environment from 'platform/utilities/environment';
import commonDefinitions from 'vets-json-schema/dist/definitions.json';
import { arrayBuilderPages } from 'platform/forms-system/src/js/patterns/array-builder';
import manifest from '../manifest.json';
import IntroductionPage from '../containers/IntroductionPage';
File selectors.js
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { selectVAPResidentialAddress } from 'platform/user/selectors';
import {
getTimezoneByFacilityId,
getTimezoneDescByFacilityId,
File ConfirmationPage.jsx
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect, useSelector } from 'react-redux';
import { ConfirmationView } from 'platform/forms-system/src/js/components/ConfirmationView';
File form.js
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
import footerContent from 'platform/forms/components/FormFooter';
import { externalServices } from 'platform/monitoring/DowntimeNotification';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import manifest from '../manifest.json';