Showing 3,724 of 12,675 total issues
Function render
has 225 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
currentPageNumber,
errorMessages,
facilityCodeSelected,
Function formReducer
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
export default function formReducer(state = initialState, action) {
switch (action.type) {
case FORM_PAGE_OPENED: {
const { data, schema } = setupFormData(
state.data,
- 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 helpers.js
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { dropRight, merge } from 'lodash';
import { getDefaultFormState } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
import dataGet from '../../../../utilities/data/get';
import set from '../../../../utilities/data/set';
import unset from '../../../../utilities/data/unset';
File SearchPage.jsx
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable react-hooks/exhaustive-deps */
import React, { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { connect, useStore } from 'react-redux';
File index.js
has 536 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable camelcase */
/**
* Functions related to fetching Apppointment data and pulling information from that data
* @module services/Appointment
*/
Function debtSummaryText
has 221 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const debtSummaryText = (diaryCode, dateOfLetter, balance) => {
const endDateText = endDate(dateOfLetter, diaryCode);
switch (diaryCode) {
case '71':
File applicantFileUpload.js
has 535 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { titleUI } from 'platform/forms-system/src/js/web-component-patterns';
import { fileUploadBlurbCustom } from 'applications/ivc-champva/shared/components/fileUploads/attachments';
import { applicantWording } from '../../../shared/utilities';
import ApplicantField from '../../../shared/components/applicantLists/ApplicantField';
File index.jsx
has 535 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable react/jsx-key */
import PropTypes from 'prop-types';
import React from 'react';
import moment from 'moment';
import * as Sentry from '@sentry/browser';
Function OtherResources
has 219 lines of code (exceeds 25 allowed). Consider refactoring. Open
const OtherResources = () => {
return (
<div>
<section>
<div className="va-h-ruled--stars" />
Function RefillPrescriptions
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. 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 ReplyDraftItem.jsx
has 531 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useEffect,
useMemo,
useState,
useCallback,
Function ManageFolderButtons
has 214 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ManageFolderButtons = props => {
const { ErrorMessages, Alerts } = Constants;
const dispatch = useDispatch();
const history = useHistory();
const { folder } = props;
Function CreditCardBill
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CreditCardBill = props => {
const { data, goToPath, setFormData } = props;
const { expenses } = data;
const { creditCardBills = [] } = expenses;
Function MoveMessageToFolderBtn
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MoveMessageToFolderBtn = props => {
const {
threadId,
allFolders,
isVisible,
File inboxThreads.js
has 521 lines of code (exceeds 250 allowed). Consider refactoring. Open
const { sub, formatISO } = require('date-fns');
const inboxThreads = {
data: [
{
File constants.js
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
export const TITLE = 'Request priority processing for an existing claim';
export const SUBTITLE = 'Priority processing request (VA form 20-10207)';
Function PreSubmitCheckboxGroup
has 211 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PreSubmitCheckboxGroup = props => {
const {
onSectionComplete,
formData,
showError,
Function ReplyDraftItem
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
const ReplyDraftItem = props => {
const {
draft,
drafts,
cannotReply,
- 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 FilterBeforeResults
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
export function FilterBeforeResults({
dispatchFilterChange,
dispatchError,
filters,
modalClose,
- 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 form-submit-transform.js
has 517 lines of code (exceeds 250 allowed). Consider refactoring. Open
// this constant maps the values on address.js in vets.json schema from VA.gov values to LTS values
import { formFields } from '../constants';
// the lts values were found on the LTS database and LTS validates them, so we need to send correct value from here