Showing 3,724 of 12,675 total issues
File migrations.js
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
import get from 'platform/utilities/data/get';
import set from 'platform/utilities/data/set';
import { isValidDateRange } from 'platform/forms/validations';
import { convertToDateField } from 'platform/forms-system/src/js/validation';
import { isValidCentralMailPostalCode } from 'platform/forms/address/validations';
Function DebtLettersDownload
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DebtLettersDownload = () => {
const { debtLinks, isError, isVBMSError, hasDependentDebts } = useSelector(
({ combinedPortal }) => combinedPortal.debtLetters,
);
Function ConfirmationPage
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ConfirmationPage(props) {
const { form } = props;
const { submission, data } = form;
const submitDate = new Date(submission?.timestamp);
Function SubTopicSelectPage
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SubTopicSelectPage = props => {
const { onChange, loggedIn, goBack, goToPath, formData, topicID } = props;
const [apiData, setApiData] = useState([]);
const [loading, isLoading] = useState(false);
File helpers.js
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment-timezone';
import {
DefaultFolders as Folders,
Paths,
RecipientStatus,
File index.js
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
const allFolders = {
data: [
{
attributes: {
count: 3,
File RefillPrescriptions.jsx
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect, useMemo } from 'react';
import PropTypes from 'prop-types';
import { useLocation } from 'react-router-dom';
import { useSelector, useDispatch } from 'react-redux';
import {
Function subscribeComponentAnalyticsEvents
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export function subscribeComponentAnalyticsEvents(
e,
recordEvent = _recordEvent,
) {
// Is it a component we are tracking?
- 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 checkValidSchema
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export function checkValidSchema(schema, errors = [], path = ['root']) {
if (typeof schema.type !== 'string') {
errors.push(`Missing type in ${path.join('.')} schema.`);
}
- 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 ContestableIssuesWidget
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
const ContestableIssuesWidget = props => {
const {
value = [],
id,
options,
- 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 App
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const App = ({ loggedIn, toggleLoginModal, displayToggle }) => {
const [lastUpdated, updateLastUpdated] = useState('');
const [year, updateYear] = useState(0);
const [formError, updateFormError] = useState({ error: false, type: '' }); // types: "not found", "download error"
const [formType, updateFormType] = useState('pdf');
- 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 EmploymentRecord
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
const EmploymentRecord = ({
idSchema,
uiSchema,
formData,
setFormData,
- 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 KeywordSearch
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export function KeywordSearch({
className,
inputValue,
label,
labelAdditional,
- 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 SearchResult.jsx
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable @department-of-veterans-affairs/prefer-button-component */
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import {
File index.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { toggleLoginModal as toggleLoginModalAction } from '@department-of-veterans-affairs/platform-site-wide/actions';
import { useFeatureToggle } from 'platform/utilities/feature-toggles';
File CompareDrawer.jsx
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import { useHistory } from 'react-router-dom';
import classNames from 'classnames';
import { removeCompareInstitution, compareDrawerOpened } from '../actions';
File Profile.jsx
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { BrowserRouter, Route, Switch, Redirect } from 'react-router-dom';
import { LastLocationProvider } from 'react-router-last-location';
Function render
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
uiSchema,
errorSchema,
idSchema,
Function DynamicRadioWidget
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function DynamicRadioWidget(props) {
const { onChange } = props;
let locationsList = null;
let upperContent = null;
const [locations, setLocations] = useState([]);
Function CancelPageLayout
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function CancelPageLayout() {
const { id } = useParams();
const {
appointment,
bookingNotes,