Showing 3,724 of 12,675 total issues
File SearchForm.jsx
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useMemo, useRef, useState } from 'react';
import FEATURE_FLAG_NAMES from '@department-of-veterans-affairs/platform-utilities/featureFlagNames';
import PropTypes from 'prop-types';
import { useLocation } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';
Function AppointmentsPage
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function AppointmentsPage() {
const location = useLocation();
const [hasTypeChanged, setHasTypeChanged] = useState(false);
let [pageTitle] = useState('VA online scheduling');
Function useClinicFormState
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function useClinicFormState() {
const initialData = useSelector(getFormData);
const location = useSelector(selectChosenFacilityInfo);
const selectedTypeOfCare = getTypeOfCare(initialData);
Function ClaimDetailLayout
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ClaimDetailLayout(props) {
const { claim, clearNotification, currentTab, loading, message } = props;
const tabs = ['Status', 'Files', 'Details', 'Overview'];
Function render
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { claim, lastPage } = this.props;
const { claimPhaseDates, evidenceWaiverSubmitted5103 } = claim.attributes;
let content;
Function reducer
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case FETCH_STARTED: {
return { ...state, loadingStatus: LOADING_STATES.pending };
}
Function StepThree
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const StepThree = ({ formValues }) => {
const reasonCode = formValues['4_reason'];
const noPrevApp = formValues['8_prevApplication'] === '2';
const prevAppType = formValues['10_prevApplicationType'];
const prevAppYear = formValues['9_prevApplicationYear'];
- 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 AppointmentListItem
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const AppointmentListItem = props => {
const { appointment, goToDetails, router, app, page, count } = props;
const { t } = useTranslation();
const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
const { isMedicationReviewContentEnabled } = 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 getNewAppointmentFlow
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export default function getNewAppointmentFlow(state) {
const featureBreadcrumbUrlUpdate = selectFeatureBreadcrumbUrlUpdate(state);
const flowType = getFlowType(state);
const isSingleVaFacility = selectSingleSupportedVALocation(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 ComparePage
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export function ComparePage({
allLoaded,
compare,
dispatchFetchCompareDetails,
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 27 (exceeds 5 allowed). Consider refactoring. Open
export const generateBlueButtonData = ({
labsAndTests,
notes,
vaccines,
allergies,
- 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 ConfirmationResponses.jsx
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { format } from 'date-fns';
import GetFormHelp from './GetFormHelp';
File EvidencePrivateRecords.jsx
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect } from 'react';
import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { EVIDENCE_PRIVATE_PATH } from '../constants';
import { content } from '../content/evidencePrivateRecords';
File EvidencePrivateRecords.jsx
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect } from 'react';
import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { EVIDENCE_PRIVATE_PATH } from '../constants';
import { content } from '../content/evidencePrivateRecords';
File helpers.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import appendQuery from 'append-query';
import * as Sentry from '@sentry/browser';
import React from 'react';
import fullSchema from 'vets-json-schema/dist/FEEDBACK-TOOL-schema.json';
import { transformForSubmit } from 'platform/forms-system/src/js/helpers';
Function GuardianInformation
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function GuardianInformation(schema, options) {
// Use the defaults as necessary, but override with the options given
const { fields, required } = {
...defaults(),
...options,
Function IdentityPage
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IdentityPage = props => {
const { router } = props;
const {
statusCode,
vesRecordFound,
Function App
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
const App = props => {
const {
children,
location,
setFormData,
Function CategorySelectPage
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CategorySelectPage = props => {
const { onChange, loggedIn, goBack, goToPath, formData } = props;
const dispatch = useDispatch();
const [apiData, setApiData] = useState([]);
Function MessageReply
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MessageReply = () => {
const dispatch = useDispatch();
const { replyId } = useParams();
const { drafts, error, messages } = useSelector(
state => state.sm.threadDetails,