Showing 4,231 of 14,884 total issues
Function displayConditionsMet
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const displayConditionsMet = (SHORT_NAME, formResponses) => {
const displayConditionsForShortName = DISPLAY_CONDITIONS[SHORT_NAME];
const questionRequirements = Object.keys(displayConditionsForShortName);
if (questionRequirements.includes('FORK')) {
- 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 PreviousEnrollmentVerifications
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const PreviousEnrollmentVerifications = ({
enrollmentData,
enrollmentVerifications,
claimantId,
}) => {
- 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 getInitialFormValues
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getInitialFormValues = options => {
const { fieldName, data, modalData } = options;
if (fieldName === FIELD_NAMES.EMAIL) {
return data ? { ...data } : { emailAddress: '' };
- 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 getProfileInfoFieldAttributes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getProfileInfoFieldAttributes = fieldName => {
let apiRoute;
let convertCleanDataToPayload;
let title;
let uiSchema;
- 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 getInitialFormValues
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getInitialFormValues = options => {
const { fieldName, data, modalData } = options;
if (fieldName === FIELD_NAMES.EMAIL) {
return data ? { ...data } : { emailAddress: '' };
- 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 getInitialFormValues
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getInitialFormValues = options => {
const { fieldName, data, modalData } = options;
if (fieldName === FIELD_NAMES.EMAIL) {
return data ? { ...data } : { emailAddress: '' };
- 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 ReviewPage
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const ReviewPage = props => {
const [showAlert, setShowAlert] = useState(true);
const [isDisabled, setIsDisabled] = useState(false);
const dispatch = useDispatch();
- 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 AddOtherExpense
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const AddOtherExpense = ({ data, goToPath, setFormData }) => {
const { otherExpenses = [] } = data;
// Borrowed from 995 AddIssue
// get index from url '/add-issue?index={index}'
- 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 PayrollDeductionChecklist
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const PayrollDeductionChecklist = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
- 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 EmploymentQuestion
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const EmploymentQuestion = props => {
const {
data,
goBack,
goToPath,
- 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 SpousePayrollDeductionChecklist
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const SpousePayrollDeductionChecklist = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
- 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 ThreadListItem
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const ThreadListItem = props => {
const location = useLocation();
const { keyword, activeFolder } = props;
const {
senderName,
- 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 App
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const App = ({ children }) => {
const user = useSelector(selectUser);
const userServices = user.profile.services;
const hasMhvAccount = user.profile.mhvAccountState !== 'NONE';
- 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 labsAndTestsReducer
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const labsAndTestsReducer = (state = initialState, action) => {
switch (action.type) {
case Actions.LabsAndTests.GET: {
if ('phrDetails' in action.response) {
// Special case to handle radiology.
- 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 PrescriptionPrintOnly
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const PrescriptionPrintOnly = props => {
const { rx, hideLineBreak, refillHistory, isDetailsRx } = props;
const pharmacyPhone = pharmacyPhoneNumber(rx);
const latestTrackingStatus = rx?.trackingList?.[0];
- 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 LandingPage
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const LandingPage = () => {
const user = useSelector(selectUser);
const dispatch = useDispatch();
const location = useLocation();
const fullState = useSelector(state => state);
- 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 address.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createSelector } from 'reselect';
import {
countries,
states,
isValidUSZipCode,
File v2.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* istanbul ignore file */
import appendQuery from 'append-query';
// eslint-disable-next-line import/no-unresolved
import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/exports';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
Function createAdditionalInfoWidget
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createAdditionalInfoWidget() {
const widgets = qSA(document, '.additional-info-container');
if (widgets.length) {
widgets.forEach((el, index) => {
Function debtsReducer
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const debtsReducer = (state = debtInitialState, action) => {
switch (action.type) {
case DEBTS_FETCH_INITIATED:
return {
...state,