Showing 4,177 of 14,709 total issues
File LocationSearchResults.jsx
has 693 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable react/jsx-no-bind */
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable react/prop-types */
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
Function addressUISchema
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
export const addressUISchema = (
isMilitaryBaseAddress = false,
path,
callback,
) => {
- 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 addressUISchema
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
export const addressUISchema = (
isMilitaryBaseAddress = false,
path,
callback,
) => {
- 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 Prescriptions
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
const Prescriptions = () => {
const { search } = useLocation();
const history = useHistory();
const dispatch = useDispatch();
const paginatedPrescriptionsList = 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
File LandingPage.jsx
has 688 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useRef, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { Link, useLocation } from 'react-router-dom';
import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
import FEATURE_FLAG_NAMES from '@department-of-veterans-affairs/platform-utilities/featureFlagNames';
Function render
has 309 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
newBenefit,
serviceBenefitBasedOn,
transferredEduBenefits,
Function vapService
has 307 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function vapService(state = initialState, action) {
switch (action.type) {
case VAP_SERVICE_TRANSACTIONS_FETCH_SUCCESS: {
const transactions = action.data.map(transactionData =>
// Wrap in a "data" property to imitate the API response for a single transaction
File newAppointmentFlow.unit.spec.js
has 678 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { expect } from 'chai';
import sinon from 'sinon';
import {
mockFetch,
Function default
has 306 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(state = INITIAL_STATE, action) {
switch (action.type) {
case CALCULATOR_INPUTS_CHANGED: {
const { field, value } = action;
let convertedValue = value;
File addStudentsArrayPages.js
has 676 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { capitalize } from 'lodash';
import {
titleUI,
textUI,
textSchema,
Function arrayBuilderPages
has 303 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function arrayBuilderPages(options, pageBuilderCallback) {
let introPath;
let summaryPath;
let hasItemsKey;
const itemPages = [];
File SearchDropdownComponent.js
has 665 lines of code (exceeds 250 allowed). Consider refactoring. Open
// March 2024: This file is duplicated from the search application (src/applications/search) because we
// converted the search app used on the page in /search/?query={query} to use web components
// The header cannot support web components yet due to its integration with TeamSites, so this is the original
// non-web-component version of the Search app
import React from 'react';
File SearchDropdownComponent.js
has 665 lines of code (exceeds 250 allowed). Consider refactoring. Open
// March 2024: This file is duplicated from the search application (src/applications/search) because we
// converted the search app used on the page in /search/?query={query} to use web components
// The header cannot support web components yet due to its integration with TeamSites, so this is the original
// non-web-component version of the Search app
import React from 'react';
File seiVitals.js
has 663 lines of code (exceeds 250 allowed). Consider refactoring. Open
const vitals = {
userProfileId: 15176497,
bloodPreassureReadings: [
{
dateEntered: '01/07/2022',
Function VaPrescription
has 296 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VaPrescription = prescription => {
const showRefillContent = useSelector(selectRefillContentFlag);
const isDisplayingDocumentation = useSelector(
state =>
state.featureToggles[
Function addressUI
has 294 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function addressUI(options) {
let cachedPath;
let cityMaxLength = 100;
const omit = key => options?.omit?.includes(key);
File helpers.js
has 656 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { merge } from 'lodash';
import PropTypes from 'prop-types';
import get from 'platform/utilities/data/get';
import omit from 'platform/utilities/data/omit';
File VAFacilityPageV2.eligibility.unit.spec.js
has 652 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { expect } from 'chai';
import {
mockFetch,
Function getCalculatedBenefits
has 291 lines of code (exceeds 25 allowed). Consider refactoring. Open
(eligibility, institution, form, derived) => {
const calculatedBenefits = {};
if ([eligibility, institution, form, derived].some(e => !e || isEmpty(e))) {
return calculatedBenefits;
File appointment.utils.unit.spec.js
has 651 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { expect } from 'chai';
import { render } from '@testing-library/react';
import MockDate from 'mockdate';
import {
appointmentWasCanceled,