Showing 4,177 of 14,709 total issues
Function Allergies
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Allergies = props => {
const { runningUnitTest } = props;
const dispatch = useDispatch();
const updatedRecordList = useSelector(
responses
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
Open
const responses = {
'GET /vaos/v0/appointments': (req, res) => {
if (req.query.type === 'cc') {
return res.json(confirmedCC);
}
File form.js
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import merge from 'lodash/merge';
import get from 'platform/utilities/data/get';
import unset from 'platform/utilities/data/unset';
import fullSchema1990 from 'vets-json-schema/dist/22-1990-schema.json';
Function uiSchema
has 166 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function uiSchema(
label = 'Address',
useStreet3 = false,
isRequired = null,
ignoreRequired = false,
File get.js
has 443 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* istanbul ignore file */
const dateFns = require('date-fns');
const { utcToZonedTime, zonedTimeToUtc, format } = require('date-fns-tz');
const {
singleAppointment,
File FormPage.jsx
has 442 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
import classNames from 'classnames';
File ConfirmationPage.jsx
has 442 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { connect } from 'react-redux';
import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
import scrollToTop from 'platform/utilities/ui/scrollToTop';
import classNames from 'classnames';
Function render
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { showWizard } = this.props;
if (showWizard === undefined) return null;
Function MessageList
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const MessageList = props => {
const dispatch = useDispatch();
const { folder, messages, keyword, isSearch, sortOrder, page } = props;
const location = useLocation();
File index.jsx
has 441 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useMemo, useState, useLayoutEffect } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { useTranslation, Trans } from 'react-i18next';
import isValid from 'date-fns/isValid';
import PropTypes from 'prop-types';
Function parseRadiologyReport
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
Open
export const parseRadiologyReport = radiologyReportText => {
const radiologyReportMap = {};
const lines = radiologyReportText ? radiologyReportText.split(/\r?\n/) : [];
let i = 0;
let clinicalHistory = '';
- 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 FileInput
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const FileInput = props => {
const {
attachments,
setAttachments,
setAttachFileSuccess,
Function AdmissionAndDischargeDetails
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AdmissionAndDischargeDetails = props => {
const { record, runningUnitTest } = props;
const user = useSelector(state => state.user.profile);
const allowTxtDownloads = useSelector(
state =>
File conditionOptions.js
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export const conditionObjects = [
{ option: 'ACL tear (anterior cruciate ligament tear)', sideOfBody: true },
{ option: 'acne' },
{ option: 'adjustment disorder' },
{ option: 'agoraphobia' },
File index.js
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Node modules.
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import appendQuery from 'append-query';
import { connect } from 'react-redux';
File index.unit.spec.js
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import MockDate from 'mockdate';
import { expect } from 'chai';
import moment from 'moment';
import userEvent from '@testing-library/user-event';
Function ViewAppeal
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ViewAppeal = () => {
useEffect(() => {
focusElement('h2');
scrollTo('topScrollElement');
});
Function getGroupedPreviousEnrollments
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getGroupedPreviousEnrollments = month => {
const { transactDate, actBegin, actEnd, id, paymentDate } = month[0];
const myUUID = uuidv4();
return (
Function PastAppointmentsListNew
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function PastAppointmentsListNew() {
const history = useHistory();
const dispatch = useDispatch();
const [isInitialMount, setInitialMount] = useState(true);
const dateRangeOptions = getPastAppointmentDateRangeOptions();
Function RequestedAppointmentDetailsPage
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function RequestedAppointmentDetailsPage() {
const { id } = useParams();
const dispatch = useDispatch();
useEffect(