Showing 4,177 of 14,709 total issues
Function addressUI
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
export function addressUI(options) {
let cachedPath;
let cityMaxLength = 100;
const omit = key => options?.omit?.includes(key);
- 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 parseLabsAndTests
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. 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 SettingsPage
has 288 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SettingsPage = () => {
const dispatch = useDispatch();
const fullState = useSelector(state => state);
const isSharing = useSelector(state => state.mr.sharing.isSharing);
File VideoLayoutAtlas.unit.spec.js
has 646 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { expect } from 'chai';
import {
createTestStore,
renderWithStoreAndRouter,
Function render
has 287 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { route, loggedIn, formId, isBDDForm, showWizard } = this.props;
const { formConfig, pageList } = route;
const pageTitle = `${getPageTitle(isBDDForm)} ${PAGE_TITLE_SUFFIX}`;
const startText = getStartText(isBDDForm);
File form.js
has 644 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { merge, omit } from 'lodash';
import get from 'platform/utilities/data/get';
import fullSchema5490 from 'vets-json-schema/dist/22-5490-schema.json';
import currentOrPastDateUI from 'platform/forms-system/src/js/definitions/currentOrPastDate';
File index.js
has 640 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
import { VaTelephone } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { endDate } from '../../utils/helpers';
Function InstallmentContract
has 284 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstallmentContract = props => {
const { data, goToPath, setFormData } = props;
const { installmentContracts = [] } = data;
File index.unit.spec.js
has 638 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { expect } from 'chai';
import userEvent from '@testing-library/user-event';
import { waitFor } from '@testing-library/dom';
import { cleanup } from '@testing-library/react';
File formFlowHelper.js
has 636 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash';
import {
CategoryEducation,
CHAPTER_2,
CHAPTER_3,
Function ReviewPage
has 280 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ReviewPage = props => {
const [showAlert, setShowAlert] = useState(true);
const [isDisabled, setIsDisabled] = useState(false);
const dispatch = useDispatch();
Function IntroductionPage
has 278 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IntroductionPage = props => {
const { route } = props;
const { formConfig, pageList } = route;
const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
Function content
has 278 lines of code (exceeds 25 allowed). Consider refactoring. Open
const content = () => {
if (prescription) {
const dispStatus = prescription.dispStatus?.toString();
return (
<>
File FacilitiesMap.jsx
has 629 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useRef, useState } from 'react';
import { connect } from 'react-redux';
import appendQuery from 'append-query';
import mapboxgl from 'mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';
File index.unit.spec.js
has 627 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable no-plusplus */
import React from 'react';
import { expect } from 'chai';
import {
Function addressUISchema
has 274 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addressUISchema = (
isMilitaryBaseAddress = false,
path,
callback,
) => {
Function FacilitiesMap
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
const FacilitiesMap = props => {
const [map, setMap] = useState(null);
const searchResultTitleRef = useRef(null);
const searchResultMessageRef = useRef();
const [isMobile, setIsMobile] = useState(window.innerWidth <= 481);
- 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.jsx
has 620 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { merge } from 'lodash';
import get from 'platform/utilities/data/get';
Function render
has 271 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
enableShortWorkflow,
errorSchema,
formContext,
Function render
has 271 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
enableShortWorkflow,
errorSchema,
formContext,