Showing 3,724 of 12,675 total issues
Function prefillTransformerV4
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function prefillTransformerV4(pages, formData, metadata, state) {
const bankInformation = state.data?.bankInformation || {};
const claimant = state.data?.formData?.data?.attributes?.claimant || {};
const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
const contactInfo = claimant?.contactInfo || {};
Function addressUISchema
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addressUISchema = (
addressPath,
title,
reviewCard,
fieldsAreRequired = true,
File ctaWidgets.js
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Relative imports.
import backendServices from '~/platform/user/profile/constants/backendServices';
import featureFlagNames from '~/platform/utilities/feature-toggles/featureFlagNames';
import { mhvUrl } from '~/platform/site-wide/mhv/utilities';
import { getAppUrl } from '~/platform/utilities/registry-helpers';
File MOCK_VA_APPOINTMENTS.js
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const fns = require('date-fns');
const MOCK_VA_APPOINTMENTS = {
data: [
{
Function uploadFile
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function uploadFile(
file,
uiOptions,
onProgress,
onChange,
Function render
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { item, scopes } = this.props;
const { setShow } = this;
const { learnIcon, show } = this.state;
Function Confirmation
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Confirmation = props => {
const dispatch = useDispatch();
const refreshAppointments = useCallback(
() => {
dispatch(triggerRefresh());
Function UpcomingAppointmentsListItem
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UpcomingAppointmentsListItem = props => {
const { app, appointment, goToDetails, router, border, count } = props;
const { t } = useTranslation();
const { getCurrentPageFromRouter } = useFormRouting(router);
const page = getCurrentPageFromRouter();
Function generateData
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const generateData = (type, formData) => {
switch (type) {
case 'claimant-information':
return {
'Claimant’s first name': formData?.claimantFullName?.first
Function renderAdditionalInfo
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const renderAdditionalInfo = deductionCode => {
switch (deductionCode) {
case '30':
return (
<section className="vads-u-font-family--sans">
Function Folders
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Folders = () => {
const dispatch = useDispatch();
const location = useLocation();
const alertList = useSelector(state => state.sm.alerts?.alertList);
const folders = useSelector(state => state.sm.folders.folderList);
Function ContactInfoPage
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ContactInfoPage() {
const pageTitle = useSelector(state => getPageTitle(state, pageKey));
const history = useHistory();
const dispatch = useDispatch();
Function MicroDetails
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const MicroDetails = props => {
const { record, fullState, runningUnitTest } = props;
const user = useSelector(state => state.user.profile);
const allowTxtDownloads = useSelector(
state =>
Function fetchFlowEligibilityAndClinics
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
Open
export async function fetchFlowEligibilityAndClinics({
typeOfCare,
location,
directSchedulingEnabled,
useV2 = 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 ResultCard
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
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
File VerifyEnrollmentsPage.jsx
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import { connect, useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom';
File form.js
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import environment from 'platform/utilities/environment';
import footerContent from 'platform/forms/components/FormFooter';
import { scrollAndFocus } from 'platform/utilities/ui';
import manifest from '../manifest.json';
File MOCK_VA_APPOINTMENTS.js
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { addDays, formatISO } from 'date-fns';
export default {
data: [
{
Function DebtLettersSummary
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DebtLettersSummary = () => {
const { debtLetters, mcp } = useSelector(
({ combinedPortal }) => combinedPortal,
);
const showDebtLetterDownload = useSelector(state =>
File index.js
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as VAP_SERVICE from 'platform/user/profile/vap-svc/constants';
import { isEmpty, isEqual, pickBy } from 'lodash';
import { COPY_ADDRESS_MODAL_STATUS } from 'platform/user/profile/vap-svc/constants';