Showing 4,177 of 14,709 total issues
Function AddIssue
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
const AddIssue = ({
validations,
description,
data,
goToPath,
- 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 Autocomplete
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
const Autocomplete = ({
availableResults,
debounceDelay,
formData,
id,
- 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 _override
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
_override: error => {
if (typeof error === 'string') {
if (error?.endsWith('startDate') || error?.endsWith('endDate')) {
const errorParts = error.split('.');
if (error.startsWith('toxicExposure.gulfWar1990Details')) {
- 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 getNewAppointmentFlow
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export default function getNewAppointmentFlow(state) {
const featureBreadcrumbUrlUpdate = selectFeatureBreadcrumbUrlUpdate(state);
const flowType = getFlowType(state);
const isSingleVaFacility = selectSingleSupportedVALocation(state);
- 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 VaPrescription.jsx
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import { Link } from 'react-router-dom';
import FEATURE_FLAG_NAMES from '@department-of-veterans-affairs/platform-utilities/featureFlagNames';
Function updateSchema
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateSchema = () => {
if (addressFormData) {
// if livesOnMilitaryBase is checked
if (addressFormData?.['view:livesOnMilitaryBase']) {
const filteredRequiredArray = addressFormRequiredData.filter(
Function parseLabsAndTests
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const parseLabsAndTests = records => {
return `
${txtLine}
1) Lab and test results
Function getBlueButtonReportData
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getBlueButtonReportData = (options = {}) => async dispatch => {
const fetchMap = {
labsAndTests: getLabsAndTests,
notes: getNotes,
vaccines: getVaccineList,
Function content
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
const content = () => {
const status = prescription?.dispStatus?.toString();
return (
<div className="medication-details-div vads-u-border-top--1px vads-u-border-color--gray-lighter vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--3">
<h2 className="vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--2 no-print">
File index.js
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
const all = {
resourceType: 'Bundle',
id: '12121',
meta: {
lastUpdated: '2023-09-29T11:04:31.316-04:00',
Function MobileLinks
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function MobileLinks(props) {
const { links, visible, langConfig, minimalFooter } = props;
return (
<div
Function exports
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async (on, config) => {
if (process.env.CODE_COVERAGE === 'true') {
require('@cypress/code-coverage/task')(on, config);
on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'));
}
Function SubTask
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SubTask = props => {
const { pages = [], formData, setFormData, router, focusOnAlertRole } = props;
const [currentPage, setCurrentPage] = useState(pages[0] || {});
const [subTaskData, setSubTaskData] = useState(getStoredSubTask());
const [hasError, setHasError] = useState(false);
Function FormSaved
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FormSaved = props => {
const {
router,
route,
lastSavedDate,
Function genBBoxFromAddress
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const genBBoxFromAddress = (query, expandedRadius = false) => {
// Prevent empty search request to Mapbox, which would result in error, and
// clear results list to respond with message of no facilities found.
if (!query.searchString) {
return {
Function transform
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function transform(formConfig, form) {
const usFormTransform = () =>
JSON.parse(transformForSubmit(formConfig, form));
const prefillTransforms = formData => {
File labels.jsx
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { states } from 'platform/forms/address';
import { createUSAStateLabels } from 'platform/forms-system/src/js/helpers';
File labels.jsx
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { states } from 'platform/forms/address';
import { createUSAStateLabels } from 'platform/forms-system/src/js/helpers';
Function Avs
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Avs = props => {
useDatadogRum();
const user = useSelector(selectUser);
const { avsEnabled, featureTogglesLoading } = useSelector(
Function TravelIntro
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TravelIntro = props => {
const { router } = props;
const { t } = useTranslation();
const { goToNextPage } = useFormRouting(router);