Showing 3,724 of 12,675 total issues
Function InstallmentContract
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
const InstallmentContract = props => {
const { data, goToPath, setFormData } = props;
const { installmentContracts = [] } = data;
- 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 SearchForm
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
const SearchForm = props => {
const { folder, keyword, resultsCount, query, threadCount } = props;
const mhvSecureMessagingFilterAccordion = useSelector(
state =>
state.featureToggles[
- 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 blue_button_report.js
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Blue Button PDF template.
*
* NB: The order in which items are added to the document is important,
* and thus PDFKit requires performing operations synchronously.
Function render
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { supplies, order, eligibility } = this.props;
const currentDate = moment();
const batterySupplies = supplies.filter(
batterySupply => batterySupply.productGroup === BATTERY,
File validations.js
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'platform/utilities/data';
import some from 'lodash/some';
import moment from 'moment';
import {
Function FileInput
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FileInput = props => {
const {
attachments,
setAttachments,
setAttachFileSuccess,
Function AllergyDetails
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AllergyDetails = props => {
const { runningUnitTest } = props;
const allergy = useSelector(state => state.mr.allergies.allergyDetails);
const allergyList = useSelector(state => state.mr.allergies.allergiesList);
const user = useSelector(state => state.user.profile);
Function ExtraDetails
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ExtraDetails = rx => {
const { dispStatus, refillRemaining } = rx;
const pharmacyPhone = pharmacyPhoneNumber(rx);
let noRefillRemaining = false;
if (refillRemaining === 0 && dispStatus === 'Active') {
File ReviewPage.jsx
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
VaAccordion,
VaAccordionItem,
VaAlert,
} from '@department-of-veterans-affairs/component-library/dist/react-bindings';
File index.js
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable camelcase */
const simpleUser = {
data: {
id: '',
type: 'users_scaffolds',
File helpers.js
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { snakeCase } from 'lodash';
import URLSearchParams from 'url-search-params';
import { useLocation } from 'react-router-dom';
import constants from 'vets-json-schema/dist/constants.json';
File LandingPage.jsx
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { Link } from 'react-router-dom';
import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
import {
Function uiSchema
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function uiSchema(label = 'Address', useStreet3 = true) {
let fieldOrder = [
'street',
'unitNumber',
'street2',
File display-conditions.js
has 415 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { range } from 'lodash';
import { months } from 'platform/static-data/options-for-select';
import { RESPONSES } from './question-data-map';
const get15YearsPast = () => `${new Date().getFullYear() - 15}`;
Function render
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const showUploadModal =
this.props.uploading && this.state.canShowUploadModal;
return (
Function ChooseDateAndTime
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ChooseDateAndTime = () => {
const history = useHistory();
const selectedDates = useSelector(state => getSelectedDate(state));
const dispatch = useDispatch();
const startMonth = format(startOfMonth(referral.preferredDate), 'yyyy-MM');
Function EvidenceVaRecords
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
const EvidenceVaRecords = ({
data,
goBack,
goForward,
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 addressUISchema
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
export const addressUISchema = (
isMilitaryBaseAddress = false,
path,
callback,
) => {
- 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 DeleteDraft
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
const DeleteDraft = props => {
const history = useHistory();
const location = useLocation();
const dispatch = useDispatch();
const deleteDraftButtonRef = useRef();
- 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 getCalendarData
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
export function getCalendarData({ appointment, facility }) {
let data = {};
const isAtlas = appointment?.videoData.isAtlas;
const isHome = isVideoHome(appointment);
const videoKind = appointment?.videoData.kind;
- 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"