Showing 3,724 of 12,675 total issues
Function ConfirmationPage
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ConfirmationPage(props) {
const { values } = useFormikContext();
const benefits = {
burialAllowance: values?.benefitsSelection?.burialAllowance,
Function updateProgramDetailsSchema
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateProgramDetailsSchema() {
const usaStates = states.USA.map(state => state.value);
const usaLabels = states.USA.map(state => state.label);
const canProvinces = states.CAN.map(state => state.value);
const canLabels = states.CAN.map(state => state.label);
Function transformForSubmit
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function transformForSubmit(formConfig, form) {
const transformedData = JSON.parse(
formsSystemTransformForSubmit(formConfig, form),
);
Function SubtopicSelect
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SubtopicSelect = props => {
const { id, onChange, value, loggedIn, topicID } = props;
const [apiData, setApiData] = useState([]);
const [loading, isLoading] = useState(false);
Function getFormSchema
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getFormSchema = (formData = {}) => {
const defaultCountry =
countries.find(
country => country.countryCodeISO3 === formData?.countryCodeIso3,
)?.countryCodeISO3 || 'USA';
File ConfirmationPage.jsx
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { utcToZonedTime, format } from 'date-fns-tz';
import { connect } from 'react-redux';
Function ArrayBuilderCancelButton
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const ArrayBuilderCancelButton = ({
arrayPath,
setFormData,
formData,
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 RequiredLoginView
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const RequiredLoginView = props => {
const { user, verify, useSiS, showProfileErrorMessage = false } = props;
const shouldSignIn = useCallback(() => !user.login.currentlyLoggedIn, [
user.login.currentlyLoggedIn,
- 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 SearchBar
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function SearchBar({ onInputChange, previousValue, setSearchData, userInput }) {
const [isGlobalSearch, setGlobalSearch] = useState(false);
const [expanded, setExpanded] = useState(false);
const [inputError, setInputError] = useState(false);
const GLOBAL = 'All VA.gov';
- 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 ReportModal
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const ReportModal = ({
representativeName,
representativeId,
address,
phone,
- 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 transformForSubmit
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export default function transformForSubmit(formConfig, form) {
const hasReceivedMedicalTreatment =
form?.data?.['view:hasReceivedMedicalTreatment'];
const transformedData = JSON.parse(
- 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 PrimaryAddressWithAutofill
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const PrimaryAddressWithAutofill = props => {
const {
errorSchema,
formContext,
formData,
- 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 GET /vaos/v2/appointments
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
'GET /vaos/v2/appointments': (req, res) => {
// merge arrays together
const appointments = confirmedV2.data.concat(requestsV2.data, mockAppts);
const filteredAppointments = appointments.filter(appointment => {
return req.query.statuses.some(status => {
- 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 RecentActivity
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export default function RecentActivity({ claim }) {
const { TOGGLE_NAMES, useToggleValue } = useFeatureToggle();
const cst5103UpdateEnabled = useToggleValue(
TOGGLE_NAMES.cst5103UpdateEnabled,
);
- 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 EstimatedBenefits
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export default function EstimatedBenefits({
outputs,
calculator,
isOJT,
dispatchShowModal,
- 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 ResultsList.jsx
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { toggleValues } from 'platform/site-wide/feature-toggles/selectors';
Function ReviewPage
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ReviewPage = props => {
const [privacyCheckbox, setPrivacyCheckbox] = useState(false);
const [submitted, setSubmitted] = useState(false);
const { chapterTitles, getChapterPagesFromChapterIndex } = setupPages();
Function FindVaForms
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FindVaForms = () => {
return (
<>
<SearchForm />
<SearchResults />
File form.js
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import footerContent from '@department-of-veterans-affairs/platform-forms/FormFooter';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import {
Function SignatureInput
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SignatureInput = props => {
const {
fullName,
required,
label,