Showing 3,724 of 12,675 total issues
Function createDebtsSuccess
has 244 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createDebtsSuccess = () => {
return {
hasDependentDebts: false,
debts: [
{
Function FileField
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
Open
const FileField = props => {
const {
enableShortWorkflow,
errorSchema,
formContext,
- 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 Prescriptions
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
Open
const Prescriptions = () => {
const { search } = useLocation();
const history = useHistory();
const dispatch = useDispatch();
const paginatedPrescriptionsList = useSelector(
- 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 PrescriptionPrintOnly
has 243 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PrescriptionPrintOnly = props => {
const { rx, hideLineBreak, refillHistory, isDetailsRx } = props;
const pharmacyPhone = pharmacyPhoneNumber(rx);
const activeNonVaContent = pres => (
Function appointmentsReducer
has 241 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function appointmentsReducer(state = initialState, action) {
switch (action.type) {
case FETCH_FUTURE_APPOINTMENTS:
return {
...state,
Function DashboardCards
has 240 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DashboardCards = () => {
const [error, hasError] = useState(false);
const [inquiries, setInquiries] = useState([]);
const [lastUpdatedFilter, setLastUpdatedFilter] = useState('newestToOldest');
const [statusFilter, setStatusFilter] = useState('All');
Function render
has 238 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
activeIndex,
isOpen,
inputValue,
Function ReviewPage
has 237 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ReviewPage = props => {
const [showAlert, setShowAlert] = useState(true);
const dispatch = useDispatch();
const scrollToChapter = chapterKey => {
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';
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';
File form.js
has 555 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 getHelp from '../../shared/components/GetFormHelp';
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';
File FileField.jsx
has 552 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 arrayBuilderPages
has 231 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function arrayBuilderPages(options, pageBuilderCallback) {
let introPath;
let summaryPath;
let hasItemsKey;
const itemPages = [];
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)
Function ResponseInboxPage
has 230 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ResponseInboxPage = () => {
const [error, hasError] = useState(false);
const [sendReply, setSendReply] = useState({ reply: '', attachments: [] });
const [loading, isLoading] = useState(true);
const [inquiryData, setInquiryData] = useState([]);
File CompareLayout.jsx
has 550 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
import _ from 'lodash';
import environment from 'platform/utilities/environment';
Function VAFacilityPageV2
has 228 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function VAFacilityPageV2() {
const pageTitle = useSelector(state => getPageTitle(state, pageKey));
const history = useHistory();
const dispatch = useDispatch();
File formFlowHelper.js
has 545 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import _ from 'lodash';
import {
CategoryEducation,
CHAPTER_2,
CHAPTER_3,
File actions.js
has 544 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable no-prototype-builtins */
import moment from 'moment';
import * as Sentry from '@sentry/browser';
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
import {