Showing 3,723 of 12,673 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 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
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;
Function SearchForm
has 303 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SearchForm = props => {
const { folder, keyword, resultsCount, query, threadCount } = props;
const mhvSecureMessagingFilterAccordion = useSelector(
state =>
state.featureToggles[
Function VaPrescription
has 298 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VaPrescription = prescription => {
const showRefillContent = useSelector(selectRefillContentFlag);
const isDisplayingDocumentation = useSelector(
state =>
state.featureToggles[
File SearchDropdownComponent.js
has 663 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { isSearchTermValid } from '~/platform/utilities/search-utilities';
File LandingPage.jsx
has 657 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 addressUI
has 293 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 654 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';
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,
Function addressUI
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
export function addressUI(options) {
let cachedPath;
let cityMaxLength = 100;
const omit = key => options?.omit?.includes(key);
- 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 index.js
has 644 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import moment from 'moment';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
import { VaTelephone } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
Function InstallmentContract
has 284 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstallmentContract = props => {
const { data, goToPath, setFormData } = props;
const { installmentContracts = [] } = data;
File form.js
has 639 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { merge, omit } from 'lodash';
import get from 'platform/utilities/data/get';
import fullSchema5490 from 'vets-json-schema/dist/22-5490-schema.json';
import currentOrPastDateUI from 'platform/forms-system/src/js/definitions/currentOrPastDate';
File Prescriptions.jsx
has 634 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useCallback,
useEffect,
useMemo,
useRef,
Function content
has 280 lines of code (exceeds 25 allowed). Consider refactoring. Open
const content = () => {
if (prescription) {
const dispStatus = prescription.dispStatus?.toString();
return (
<>