Showing 4,177 of 14,709 total issues
Function reducer
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case FETCH_STARTED: {
return { ...state, loadingStatus: LOADING_STATES.pending };
}
Function StepThree
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const StepThree = ({ formValues }) => {
const reasonCode = formValues['4_reason'];
const noPrevApp = formValues['8_prevApplication'] === '2';
const prevAppType = formValues['10_prevApplicationType'];
const prevAppYear = formValues['9_prevApplicationYear'];
- 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 AppointmentListItem
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const AppointmentListItem = props => {
const { appointment, goToDetails, router, app, page, count } = props;
const { t } = useTranslation();
const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
const { isMedicationReviewContentEnabled } = useSelector(
- 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 ComparePage
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export function ComparePage({
allLoaded,
compare,
dispatchFetchCompareDetails,
dispatchRemoveCompareInstitution,
- 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 validateMilitaryHistory
has a Cognitive Complexity of 27 (exceeds 5 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[
- 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 ConfirmationResponses.jsx
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { format } from 'date-fns';
import GetFormHelp from './GetFormHelp';
File EvidencePrivateRecords.jsx
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect } from 'react';
import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { EVIDENCE_PRIVATE_PATH } from '../constants';
import { content } from '../content/evidencePrivateRecords';
File EvidencePrivateRecords.jsx
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect } from 'react';
import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { EVIDENCE_PRIVATE_PATH } from '../constants';
import { content } from '../content/evidencePrivateRecords';
File migrations.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import get from 'platform/utilities/data/get';
import set from 'platform/utilities/data/set';
import { isValidDateRange } from 'platform/forms/validations';
import { convertToDateField } from 'platform/forms-system/src/js/validation';
import { isValidCentralMailPostalCode } from 'platform/forms/address/validations';
File YourClaimsPageV2.jsx
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { connect } from 'react-redux';
import { VaPagination } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import PropTypes from 'prop-types';
File SchoolLocations.jsx
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { BrowserRouter as Router, Link } from 'react-router-dom';
import recordEvent from 'platform/monitoring/record-event';
import { waitForRenderThenFocus } from 'platform/utilities/ui';
Function GuardianInformation
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function GuardianInformation(schema, options) {
// Use the defaults as necessary, but override with the options given
const { fields, required } = {
...defaults(),
...options,
Function getSignlePreviousEnrollmentsDGIB
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getSignlePreviousEnrollmentsDGIB = enrollment => {
const myUUID = uuidv4();
return (
<div className="vye-top-border" key={myUUID}>
{!!enrollment?.verificationMethod &&
Function IdentityPage
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IdentityPage = props => {
const { router } = props;
const {
statusCode,
vesRecordFound,
Function EkgDetails
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EkgDetails = props => {
const { record, runningUnitTest } = props;
const allowTxtDownloads = useSelector(
state =>
state.featureToggles[
File profile.js
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import {
isValidEmail,
Function UnderReview
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function UnderReview(response, name) {
return (
<>
<div>
<va-alert
Function createAppointments
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createAppointments = (
token = defaultUUID,
demographicsNeedsUpdate = false,
demographicsConfirmedAt = null,
nextOfKinNeedsUpdate = false,
Function StepComponent
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const StepComponent = props => {
const { step, clickHandler } = props;
const data = orientationSteps[step];
let content;
Function adaptPayload
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const adaptPayload = formData => {
const payload = {};
const {
fullName: { firstName: first, lastName: last },
date,