Showing 3,723 of 12,673 total issues
File helpers.js
has 760 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import moment from 'moment';
import { DATE_TIMESTAMP, formFields } from './constants';
import { getSchemaCountryCode } from './utils/form-submit-transform';
Function addressUISchema
has 351 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addressUISchema = (
isMilitaryBaseAddress = false,
path,
callback,
) => {
Function addressUISchema
has 351 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const addressUISchema = (
isMilitaryBaseAddress = false,
path,
callback,
) => {
Function ReviewPage
has 350 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ReviewPage(props) {
const state = useFormikContext();
const location = useLocation();
useLayoutEffect(() => scrollToSection(location), [location]);
Function getAlertContent
has 349 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function getAlertContent(alert, appealIsActive) {
const { type, details } = alert;
switch (type) {
case ALERT_TYPES.form9Needed: {
Function returnAddressUI
has 346 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return (function returnAddressUI() {
return {
[MILITARY_BASE_PATH]: {
'ui:title': `${checkBoxTitleState} receive mail outside of the United States on a U.S. military base.`,
'ui:options': {
Function returnAddressUI
has 346 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return (function returnAddressUI() {
return {
[MILITARY_BASE_PATH]: {
'ui:title': `${checkBoxTitleState} receive mail outside of the United States on a U.S. military base.`,
'ui:options': {
File selectors.js
has 742 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { createSelector } from 'reselect';
import { selectIsCernerOnlyPatient } from 'platform/user/cerner-dsot/selectors';
import moment from 'moment';
import { selectCernerFacilityIds } from 'platform/site-wide/drupal-static-data/source-files/vamc-ehr/selectors';
import { lowerCase } from 'lodash';
File SearchApp.jsx
has 733 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router';
import { connect } from 'react-redux';
import { getDay, getHours, setHours, setMinutes, setSeconds } from 'date-fns';
File AppointmentDetails.unit.spec.jsx
has 727 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable camelcase */
import React from 'react';
import sinon from 'sinon';
import { expect } from 'chai';
import { render } from '@testing-library/react';
Function CustomPage
has 335 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function CustomPage(props) {
const {
index: updateItemIndex,
nounSingular: updatedNounSingular,
} = getUpdatedItemFromPath();
Function parseLabsAndTests
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
Open
export const parseLabsAndTests = records => {
return `
${txtLine}
1) Lab and test results
- 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 SearchControls
has 331 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SearchControls = props => {
const {
currentQuery,
onChange,
onSubmit,
Function IntroductionPage
has 327 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IntroductionPage = props => {
const { route, toggleLoginModal, loggedIn } = props;
const { formConfig, pageList, pathname, formData } = route;
const [inquiryData, setInquiryData] = useState(false);
const [searchReferenceNumber, setSearchReferenceNumber] = useState('');
Function StatusDropdown
has 323 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const StatusDropdown = props => {
const { status } = props;
const content = () => {
switch (status) {
File polyfill-timezone-data.js
has 704 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Everything in here is copied from @formatjs/intl-datetimeformat (add-all-tz
* and locale-data/en) and pared down as small as possible (in theory).
*/
File index.js
has 703 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import * as Sentry from '@sentry/browser';
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/exports';
File form.js
has 701 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import fullSchema from 'vets-json-schema/dist/21-526EZ-ALLCLAIMS-schema.json';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import FormFooter from '@department-of-veterans-affairs/platform-forms/FormFooter';
Function VitalDetails
has 319 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VitalDetails = props => {
const { runningUnitTest } = props;
const records = useSelector(state => state.mr.vitals.vitalDetails);
const vitalsList = useSelector(state => state.mr.vitals.vitalsList);
const user = useSelector(state => state.user.profile);
Function content
has 319 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const content = () => {
switch (status) {
case dispStatusObj.active: {
const dropdownContent = () => {
return (