Showing 3,724 of 12,675 total issues
Function ChangeOfAddressWrapper
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
const ChangeOfAddressWrapper = ({ mailingAddress, loading, applicantName }) => {
const { loading: isLoading, error, data: response } = useSelector(
state => state.updateAddress,
);
const {
- 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 35 (exceeds 5 allowed). Consider refactoring. Open
export default function App({ children }) {
const dispatch = useDispatch();
const profileLoading = useSelector(state => isProfileLoading(state));
const userLoggedIn = useSelector(state => isLoggedIn(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
Function transform
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export function transform(formConfig, form) {
// Grab isBDD before things are changed/deleted
const isBDDForm = isBDD(form.data);
// Grab ratedDisabilities before they're deleted in case the page is inactive
// We need to send all of these to vets-api even if the veteran doesn't apply
- 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 SettingsPage
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
const SettingsPage = () => {
const dispatch = useDispatch();
const fullState = useSelector(state => state);
const isSharing = useSelector(state => state.mr.sharing.isSharing);
- 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 exportsFile.js
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
export {
selectUser,
isLoggedIn,
selectProfile,
isVAPatient,
File ProfilePageHeader.jsx
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import React, { useState } from 'react';
import { connect } from 'react-redux';
import _ from 'lodash';
import classNames from 'classnames';
Function render
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { location } = this.props;
if (!location) {
return null;
Function render
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
benefitSummaryOptions,
requestOptions,
isVeteran,
Function ConfirmedAppointmentDetailsPage
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ConfirmedAppointmentDetailsPage() {
const dispatch = useDispatch();
const { id } = useParams();
const {
appointment,
File ProfileInformationEditView.jsx
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { focusElement } from 'platform/utilities/ui';
File ProfileInformationEditView.jsx
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { focusElement } from 'platform/utilities/ui';
File ResultCard.jsx
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
import appendQuery from 'append-query';
import { Link } from 'react-router-dom';
Function FieldTemplate
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function FieldTemplate(props) {
const {
id,
schema,
help,
Function alertMessage
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
const alertMessage = (alertType, appType) => {
switch (alertType) {
case ALERT_TYPES.ALL_ZERO:
return {
alertStatus: 'info',
Function render
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const downloadStatus = this.props.letterDownloadStatus;
const letterItems = (this.props.letters || []).map((letter, index) => {
let content;
let letterTitle;
Function AppointmentsPage
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AppointmentsPage = props => {
const { router } = props;
const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
const { isUpcomingAppointmentsEnabled } = useSelector(selectFeatureToggles);
const selectApp = useMemo(makeSelectApp, []);
Function MessageThreadItem
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MessageThreadItem = props => {
const dispatch = useDispatch();
const accordionItemRef = useRef();
const { message, isDraftThread, open, forPrint } = props;
const {
Function createSuccessPayment
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSuccessPayment = (hasRecentPayment = false) => {
return {
data: {
id: '',
type: 'bgs_va_payment_history_response',
File ContactInfo.jsx
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState, useRef } from 'react';
import { useSelector } from 'react-redux';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import { Element } from 'react-scroll';
File form-submit-transform.js
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
// this constant maps the values on address.js in vets.json schema from VA.gov values to LTS values
// the lts values were found on the LTS database and LTS validates them, so we need to send correct value from here
const countries = [
{ schemaValue: 'USA', ltsValue: 'US', label: 'United States' },
{ schemaValue: 'AFG', ltsValue: 'AF', label: 'Afghanistan' },