Showing 4,177 of 14,709 total issues
Function OtherResources
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const OtherResources = () => {
return (
<div>
<section>
<div className="va-h-ruled--stars" />
Function CreditCardBill
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CreditCardBill = props => {
const { data, goToPath, setFormData } = props;
const { expenses } = data;
const { creditCardBills = [] } = expenses;
File constants.js
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
Open
const PreSubmitCheckboxGroup = props => {
const {
onSectionComplete,
formData,
showError,
Function ContestableIssuesWidget
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ContestableIssuesWidget = props => {
const {
value = [],
id,
options,
Function useNotificationSettingsUtils
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useNotificationSettingsUtils = () => {
const communicationPreferences = useSelector(
state => state?.communicationPreferences,
);
Function NewAppointment
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function NewAppointment() {
const isCernerOnlyPatient = useSelector(selectIsCernerOnlyPatient);
const isNewAppointmentStarted = useSelector(selectIsNewAppointmentStarted);
const featureBreadcrumbUrlUpdate = useSelector(state =>
selectFeatureBreadcrumbUrlUpdate(state),
File ProfileInformationFieldController.jsx
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
// platform level imports
File ProfileInformationFieldController.jsx
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
// platform level imports
File ProfileInformationFieldController.jsx
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
// platform level imports
Function Confirmation
has 208 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Confirmation = () => {
useEffect(() => {
focusElement('#main h2');
scrollTo('topScrollElement');
});
File ApiInitializer.js
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import session from '../mocks/v2/sessions';
import preCheckInData from '../mocks/v2/pre-check-in-data';
import checkInData from '../mocks/v2/check-in-data';
import btsss from '../mocks/v2/btsss';
import sharedData from '../mocks/v2/shared';
Function generateData
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
Open
const generateData = (type, formData) => {
switch (type) {
case 'claimant-information':
return {
'Claimant’s first name': formData?.claimantFullName?.first
- 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 PrintDownload
has 206 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PrintDownload = props => {
const { onDownload, isSuccess, list, onPrint, onText, isLoading } = props;
const [isError, setIsError] = useState(false);
const [menuOpen, setMenuOpen] = useState(false);
File DeceasedPersons.jsx
has 509 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import {
toIdSchema,
File ProfileInformationFieldController.jsx
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
// platform level imports
File debtDetailsCardContent.js
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
import { endDate } from '../../utils/helpers';
const ContactDMC = () => (
Function MyVAHealth
has 204 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function MyVAHealth() {
const [{ loadingMessage, isLoading }, setLoadingMessage] = useState(
defaultMessage,
);
const [showDeclineModal, setShowDeclineModal] = useState(false);
Function generate
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const generate = async data => {
validate(data.details);
const doc = createAccessibleDoc(data, config);
Function MessageList
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
Open
const MessageList = props => {
const dispatch = useDispatch();
const { folder, messages, keyword, isSearch, sortOrder, page } = props;
const location = useLocation();
- 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"