Showing 4,177 of 14,709 total issues
File SelectDate1Page.unit.spec.js
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { expect } from 'chai';
import moment from 'moment';
import { waitFor, waitForElementToBeRemoved } from '@testing-library/dom';
import { cleanup } from '@testing-library/react';
Function TravelMileage
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TravelMileage = props => {
const { router } = props;
const { t } = useTranslation();
const dispatch = useDispatch();
Function AppointmentsPage
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function AppointmentsPage() {
const history = useHistory();
const location = useLocation();
const dispatch = useDispatch();
const [hasTypeChanged, setHasTypeChanged] = useState(false);
File EvidenceSummaryLists.jsx
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { Link } from 'react-router';
import PropTypes from 'prop-types';
import readableList from 'platform/forms-system/src/js/utilities/data/readableList';
File topic.js
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { flatten, orderBy } from 'lodash';
import clone from 'platform/utilities/data/clone';
import get from 'platform/utilities/data/get';
import set from 'platform/utilities/data/set';
import { createSelector } from 'reselect';
File RequestedAppointmentDetailsPage.unit.spec.js
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';
import { fireEvent, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { expect } from 'chai';
File CCLayout.unit.spec.js
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { expect } from 'chai';
import moment from 'moment';
import {
createTestStore,
Function SipsDevModal
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SipsDevModal = props => {
const { pageList, form, locationPathname } = props || {};
const { formId, version, data, submission } = form || {};
const [isModalVisible, toggleModal] = useState(false);
Function render
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
benefitSummaryOptions,
requestOptions,
isVeteran,
Function AllergyListItem
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AllergyListItem = props => {
const { record } = props;
return (
<va-card
background
File ComboBox.jsx
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Description: ComboBox component for the disability benefits form.
import React from 'react';
import PropTypes from 'prop-types';
import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { fullStringSimilaritySearch } from 'platform/forms-system/src/js/utilities/addDisabilitiesStringSearch';
File helpers.js
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment-timezone';
import cheerio from 'cheerio';
import { generatePdf } from '@department-of-veterans-affairs/platform-pdf/exports';
import * as Sentry from '@sentry/browser';
import {
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 ResultCard
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export function ResultCard({
compare,
estimated,
dispatchAddCompareInstitution,
dispatchRemoveCompareInstitution,
- 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 generateBlueButtonData
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export const generateBlueButtonData = (
{
labsAndTests,
notes,
vaccines,
- 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 Description
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Description(props) {
const isClaimingBurialAllowance =
props.formData['view:claimedBenefits'].burialAllowance;
const serviceRequested =
props.formData?.burialAllowanceRequested?.service === true;
Function POARequestDetailsPage
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
const POARequestDetailsPage = () => {
const { poaRequests } = usePOARequests();
const { id } = useParams();
const poaRequest = poaRequests.find(r => r.id === Number(id))?.attributes;
File AttachmentsList.jsx
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useRef, useState } from 'react';
import { useDispatch } from 'react-redux';
import PropTypes from 'prop-types';
import recordEvent from 'platform/monitoring/record-event';
import { datadogRum } from '@datadog/browser-rum';
Function DownloadDateRange
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DownloadDateRange = () => {
const history = useHistory();
const [selectedDate, setSelectedDate] = useState('');
const [selectionError, setSelectionError] = useState(null);
const [customFromDate, setCustomFromDate] = useState('');