Showing 4,177 of 14,709 total issues
File FileField.jsx
has 567 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import React, { useEffect, useState, useRef } from 'react';
import classNames from 'classnames';
import { VaModal } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
Function render
has 240 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
activeIndex,
isOpen,
inputValue,
Function render
has 240 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
activeIndex,
isOpen,
inputValue,
Function ConfirmationPageV2
has 239 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ConfirmationPageV2 = () => {
resetStoredSubTask();
const form = useSelector(state => state.form || {});
const profile = useSelector(state => selectProfile(state));
Function CalculationInstructions
has 238 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const CalculationInstructions = () => {
return (
<div className="vads-l-grid-container vads-u-margin-top--4">
<h1 className="vads-u-margin-top--2">
Calculation instructions for VA Form 22-10215: Statement of Assurance of
Function EditContactList
has 237 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EditContactList = () => {
const dispatch = useDispatch();
const location = useLocation();
const history = useHistory();
const [allTriageTeams, setAllTriageTeams] = useState(null);
File RenderErrorContainer.jsx
has 560 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { AUTH_ERRORS, AUTH_LEVEL } from 'platform/user/authentication/errors';
import ContactCenterInformation from 'platform/user/authentication/components/ContactCenterInformation';
Function BlockedTriageGroupAlert
has 236 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const BlockedTriageGroupAlert = props => {
const {
alertStyle,
parentComponent,
currentRecipient,
Function renderProfileCalculatorModals
has 236 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderProfileCalculatorModals = () => {
const whenUsedGiBill = (
<div>
<p>
Effective January 1, 2018, the Post-9/11 GI Bill monthly housing
File form.js
has 559 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// we're not using JSON schema for this form
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import footerContent from 'platform/forms/components/FormFooter';
import { externalServices } from 'platform/monitoring/DowntimeNotification';
import getHelp from '../../shared/components/GetFormHelp';
File CompareLayout.jsx
has 558 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import classNames from 'classnames';
import _ from 'lodash';
File ReviewCardField.jsx
has 557 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
getDefaultFormState,
getDefaultRegistry,
} from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
import * as Sentry from '@sentry/browser';
Function content
has 234 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const content = () => {
return (
<div className="landing-page no-print">
<h1 data-testid="list-page-title" className="vads-u-margin-bottom--2">
Medications
File ReplyDraftItem.jsx
has 556 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, {
useEffect,
useMemo,
useState,
useCallback,
File index.js
has 553 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable camelcase */
/**
* Functions related to fetching Apppointment data and pulling information from that data
* @module services/Appointment
*/
Function RefillPrescriptions
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
Open
const RefillPrescriptions = ({ isLoadingList = true }) => {
// Hooks
const location = useLocation();
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
File blue_button_report.js
has 552 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Blue Button PDF template.
*
* NB: The order in which items are added to the document is important,
* and thus PDFKit requires performing operations synchronously.
File ReviewCardField.jsx
has 552 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
getDefaultFormState,
getDefaultRegistry,
} from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
import * as Sentry from '@sentry/browser';
Function DateAndTimeContent
has 231 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const DateAndTimeContent = props => {
const { currentReferral, provider, appointmentsByMonth } = props;
const dispatch = useDispatch();
const history = useHistory();
File address-schema.js
has 551 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* The intent for this module is to provide a flexible, reusable address schema and widget that can be used in any form throughout VA.gov.
* The address uiSchema should be flexible enough to handle these cases:
* 1. Top level address property (schema.properties.address)
* 2. Nested address property (schema.properties.someProperty.properties.address)