Showing 4,177 of 14,709 total issues
File FileField.jsx
has 613 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
import PropTypes from 'prop-types';
import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
Function render
has 267 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
uiSchema,
errorSchema,
idSchema,
Function DownloadFileType
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
const DownloadFileType = props => {
const { runningUnitTest = false } = props;
const history = useHistory();
const [fileType, setFileType] = useState('');
- 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.js
has 607 lines of code (exceeds 250 allowed). Consider refactoring. Open
import merge from 'lodash/merge';
import fullSchema from 'vets-json-schema/dist/FEEDBACK-TOOL-schema.json';
import phoneUI from 'platform/forms-system/src/js/definitions/phone';
import emailUI from 'platform/forms-system/src/js/definitions/email';
import { validateBooleanGroup } from 'platform/forms-system/src/js/validation';
File helpers.js
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useEffect, useRef } from 'react';
import { add, getYear } from 'date-fns';
import { intersection, matches, merge, uniq } from 'lodash';
import shouldUpdate from 'recompose/shouldUpdate';
import { deepEquals } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
File form.jsx
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import fullSchemaPreNeed from 'vets-json-schema/dist/40-10007-INTEGRATION-schema.json';
import environment from 'platform/utilities/environment';
Function FacilitySearch
has 263 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FacilitySearch = props => {
const { data: formData, goBack, goForward, goToPath } = props;
const [query, setQuery] = useState('');
const [submittedQuery, setSubmittedQuery] = useState('');
const [loading, setLoading] = useState(false);
Function IntroductionPage
has 262 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IntroductionPage = props => {
const { route } = props;
// WIP: need to keep unit-tests passing with these new selector-hooks
const userLoggedIn = useSelector(state => isLoggedIn(state));
const userIdVerified = useSelector(state => isLOA3(state));
File constants.js
has 603 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { useSelector } from 'react-redux';
import { VA_FORM_IDS } from 'platform/forms/constants';
export const PrimaryActionLink = ({ href = '/', children, onClick = null }) => (
File InPersonLayout.unit.spec.js
has 603 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { expect } from 'chai';
import moment from 'moment';
import {
createTestStore,
File FileField.jsx
has 602 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
import PropTypes from 'prop-types';
import React, { useEffect, useState, useMemo, useRef } from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
File index.js
has 602 lines of code (exceeds 250 allowed). Consider refactoring. Open
import appendQuery from 'append-query';
import { fetchAndUpdateSessionExpiration as fetch } from 'platform/utilities/api';
import mbxGeo from '@mapbox/mapbox-sdk/services/geocoding';
import { api, apiV0 } from '../config';
Function arrayBuilderPages
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
export function arrayBuilderPages(options, pageBuilderCallback) {
let introPath;
let summaryPath;
let hasItemsKey;
const itemPages = [];
- 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 local-vapsvc.js
has 600 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { uniqueId } from 'lodash';
import * as VAP_SERVICE from '../constants';
export function isVAProfileServiceConfigured() {
return (
File form.js
has 594 lines of code (exceeds 250 allowed). Consider refactoring. Open
// platform imports
import environment from 'platform/utilities/environment';
import FormFooter from 'platform/forms/components/FormFooter';
import { VA_FORM_IDS } from 'platform/forms/constants';
import { externalServices } from 'platform/monitoring/DowntimeNotification';
Function FileField
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. 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 FolderThreadListView
has 256 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FolderThreadListView = props => {
const { testing } = props;
const dispatch = useDispatch();
const error = null;
const threadsPerPage = THREADS_PER_PAGE_DEFAULT;
File index.jsx
has 593 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { APP_URLS, LAST_YEAR } from '../../utils/constants';
/** CHAPTER 1: Veteran Information */
export const BirthInfoDescription = (
File FileField.jsx
has 592 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
import PropTypes from 'prop-types';
import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
Function IntroductionPage
has 255 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IntroductionPage = props => {
const { route, toggleLoginModal, loggedIn } = props;
const { formConfig, pageList, pathname, formData } = route;
const [inquiryData, setInquiryData] = useState(false);
const [searchReferenceNumber, setSearchReferenceNumber] = useState('');