Showing 3,724 of 12,675 total issues
Function EvidenceSummary
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
const EvidenceSummary = ({
data,
goBack,
goForward,
setFormData,
- 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 getMissingInfo
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
const missingInfo = [];
// If both home & mobile selected, make only one phone required
const phones = [keys.homePhone, '|', keys.mobilePhone];
const eitherPhone =
- 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 28 (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
Function PrintDownload
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
const PrintDownload = props => {
const { onDownload, isSuccess, list, onPrint, onText } = props;
const [isError, setIsError] = useState(false);
const [menuOpen, setMenuOpen] = useState(false);
- 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 FolderHeader
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FolderHeader = props => {
const { folder, searchProps, threadCount } = props;
const location = useLocation();
const userFacilities = useSelector(state => state?.user?.profile?.facilities);
const showInnerNav =
File component-library-analytics-setup.js
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable camelcase */
/**
* Attaches CustomEvent 'component-library-analytics' listener to document.body
* to translate component library actions into analytics dataLayer events.
*/
Function prefillTransformer
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function prefillTransformer(pages, formData, metadata) {
const prefillRatedDisabilities = data => {
const { disabilities } = data;
if (!disabilities) {
Function threadDetailsReducer
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const threadDetailsReducer = (state = initialState, action) => {
switch (action.type) {
case Actions.Thread.GET_THREAD:
return {
...initialState,
Function GettingStartedWithBenefits
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GettingStartedWithBenefits = () => {
return (
<div>
<div className="vads-u-margin-top--neg1p5 vads-u-padding-left--2p5 small-screen-font">
<div className="vads-u-margin-y--2p5">
Function renderYellowRibbon
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderYellowRibbon = () => {
if (!displayedInputs.yellowRibbon) return null;
let {
yellowRibbonDegreeLevelOptions,
File DeselectableObjectField.jsx
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import groupBy from 'lodash/groupBy';
import {
File Modals.jsx
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import {
VaModal,
VaButton,
} from '@department-of-veterans-affairs/web-components/react-bindings';
Function arrayBuilderYesNoUI
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const arrayBuilderYesNoUI = (
arrayBuilderOptions,
yesNoOptions,
yesNoOptionsMore,
) => {
Function EnrollmentStatusFAQ
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EnrollmentStatusFAQ = () => {
const { statusCode } = useSelector(selectEnrollmentStatus);
// Declare content blocks for use
const {
Function DependentSummary
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DependentSummary = props => {
const {
data,
goBack,
goForward,
Function FileUpload
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FileUpload = props => {
const {
acceptFileTypes = '.pdf,.jpeg,.png',
buttonText = 'Upload file',
error,
Function letters
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
function letters(state = initialState, action) {
switch (action.type) {
case GET_LETTERS_SUCCESS: {
const letterDownloadStatus = {};
action.data.letters.forEach(letter => {
Function ThirdFAQSection
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ThirdFAQSection = () => {
return (
<>
<h3 className="dhp-faq-section-header">Troubleshooting</h3>
<va-accordion
File EvidenceRecords.jsx
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import {
File form.js
has 333 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';