Showing 4,177 of 14,709 total issues
Function validateDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateDate = (errors, rawDateString = '', fullData) => {
const date = createDateObject(rawDateString);
const error =
(fullData?.dateType || 'decisions') === 'decisions'
? sharedErrorMessages.decisions
- 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 EvidenceSummaryReview
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const EvidenceSummaryReview = ({ data, editPage }) => {
const { limitedConsent = '' } = data;
const editRef = useRef(null);
- 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 onFormLoaded
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const onFormLoaded = props => {
const { formData, returnUrl, router } = props;
const { locations = [] } = formData;
if (showScNewForm(formData) && locations.length) {
formData.locations = locations.map(location => {
- 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 validateDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const validateDate = (errors, rawDateString = '', fullData) => {
const date = createDateObject(rawDateString);
const error =
(fullData?.dateType || 'decisions') === 'decisions'
? sharedErrorMessages.decisions
- 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 handleTokenRequest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const handleTokenRequest = async ({
code,
state,
csp,
generateOAuthError,
- 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 EvidencePrivateRecordsAuthorization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const EvidencePrivateRecordsAuthorization = ({
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 _override
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_override: err => {
if (typeof err === 'string') {
if (
err?.startsWith('locations[') ||
err?.startsWith('providerFacility[')
- 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 ConfirmationPersonalInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ConfirmationPersonalInfo = ({
dob = '',
homeless,
userFullName = {},
veteran = {},
- 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 PrevApplicationYear
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const PrevApplicationYear = ({
formResponses,
setPrevApplicationYear,
router,
viewedIntroPage,
- 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 useSetToggleParam
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useSetToggleParam = toggleValue => {
useEffect(
() => {
const urlParams = new URLSearchParams(window.location.search);
if (toggleValue != null && toggleValue !== 'undefined') {
- 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 ConfirmationPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const ConfirmationPage = () => {
const alertRef = useRef(null);
const form = useSelector(state => state.form || {});
const { submission, formId, data = {} } = form;
const { fullName } = data;
- 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 BenefitSelectionWarning
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function BenefitSelectionWarning(chapter, relationship) {
let warningText = '';
if (chapter === 'chapter33') {
// Fry
if (relationship === 'child') {
- 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 HandlePrefilledSSN
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function HandlePrefilledSSN(fieldProps) {
const props = vaTextInputFieldMapping(fieldProps);
const [val, setVal] = useState(props.value);
const [displayVal, setDisplayVal] = useState(props.value);
const [cleared, setCleared] = 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 mapEnrollmentVerificationsForSubmission
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const mapEnrollmentVerificationsForSubmission = ev => {
// The enrollments are in order with the most recent first. Look
// for the first non-null verificationStatus (or, the most recent
// month) that was verified as either correct or incorrect.
const mostRecentVerifiedEnrollmentIndex = ev.enrollmentVerifications.findIndex(
- 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 ChangeOfDirectDepositWrapper
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ChangeOfDirectDepositWrapper = ({ applicantName }) => {
const prefix = 'GI-Bill-Chapters-';
const [toggleDirectDepositForm, setToggleDirectDepositForm] = useState(false);
const [formData, setFormData] = useState();
const [showModal, setShowModal] = 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 MonthReviewCard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function MonthReviewCard({
month,
informationIncorrectMonth,
onEditMonth,
reviewPage = 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 MegaMenu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MegaMenu = ({ megaMenuData }) => {
const [levelOneIndexOpen, setLevelOneIndexOpen] = useState(null);
const [levelTwoIndexOpen, setLevelTwoIndexOpen] = useState(null);
const clearMenu = () => {
- 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 appendReportsFromLocalStorage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const appendReportsFromLocalStorage = resultsArray => {
const localReportsArray = localStorage.getItem('vaReports');
if (localReportsArray) {
const parsedLocalReportsArray = JSON.parse(localReportsArray);
- 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 personalInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const personalInfo = (state = initialState, action) => {
switch (action.type) {
case FETCH_PERSONAL_INFO:
return {
...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 MegaMenu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const MegaMenu = ({
isDesktop,
levelOneIndexOpen,
levelTwoMenuOpen,
megaMenuData,
- 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"