Showing 4,231 of 14,884 total issues
Function medsIntro
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const medsIntro = (avs, fullState) => {
return (
<>
<p>
The medications listed below were reviewed with you by your provider and
Function VetCenterHours
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VetCenterHours = props => {
const hoursH4Style = props.isSatelliteLocation
? 'force-small-header vads-u-margin-top--0 vads-u-line-height--1 vads-u-margin-bottom--1'
: 'vads-u-font-size--lg vads-u-margin-top--0 vads-u-line-height--1 vads-u-margin-bottom--1';
if (props.hours.length === 0)
Function HomepageSearch
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const HomepageSearch = () => {
const [userInput, setUserInput] = useState('');
const [latestSuggestions, setLatestSuggestions] = useState([]);
const [typeaheadClicked, setTypeaheadClicked] = useState(false);
Function LanguagePicker
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function LanguagePicker() {
const { i18n } = useTranslation();
const { language } = i18n;
function getUrl(lang) {
Function useSendTravelPayClaim
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useSendTravelPayClaim = appointment => {
const [isLoading, setIsLoading] = useState(false);
const [travelPayClaimError, setTravelPayClaimError] = useState(false);
const [travelPayClaimRequested, setTravelPayClaimRequested] = useState();
Function EmergencyContact
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EmergencyContact = props => {
const { router } = props;
const { t } = useTranslation();
const selectVeteranData = useMemo(makeSelectVeteranData, []);
const { demographics } = useSelector(selectVeteranData);
Function NextOfKin
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NextOfKin = props => {
const { router } = props;
const { t } = useTranslation();
const selectVeteranData = useMemo(makeSelectVeteranData, []);
const { demographics } = useSelector(selectVeteranData);
Function IntroductionPage
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IntroductionPage = props => {
const { route } = props;
const userLoggedIn = useSelector(state => isLoggedIn(state));
const userIdVerified = useSelector(state => isLOA3(state));
Function DeductionSampleTable
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DeductionSampleTable = () => {
return (
<>
<p className="sr-only">
A sample two-column table from a pay stub showing common deductions and
Function updateFormData
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateFormData = e => {
e.preventDefault();
if (isEditing) {
// find the one we are editing in the employeeRecords array
const updatedRecords = spEmploymentRecords.map((item, arrayIndex) => {
Function MessageThreadMeta
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MessageThreadMeta = props => {
const {
message,
fromMe,
replyMessage,
Function selectRequestedAppointmentDetails
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function selectRequestedAppointmentDetails(state, id) {
const { appointmentDetailsStatus, facilityData } = state.appointments;
const featureVAOSServiceCCAppointments = selectFeatureVAOSServiceCCAppointments(
state,
);
Function useAcceleratedData
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useAcceleratedData = () => {
const dispatch = useDispatch();
const isAcceleratedDeliveryEnabled = useSelector(
state =>
File helpers.js
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
import constants from 'vets-json-schema/dist/constants.json';
export const isChapterFieldRequired = (formData, option) =>
File EditContactList.jsx
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { getVamcSystemNameFromVhaId } from 'platform/site-wide/drupal-static-data/source-files/vamc-ehr/utils';
import { selectEhrDataByVhaId } from 'platform/site-wide/drupal-static-data/source-files/vamc-ehr/selectors';
import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
File MOCK_VA_APPOINTMENTS_OVER_30_DAYS.js
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { addDays, formatISO } from 'date-fns';
export default {
data: [
{
Function getProfileInfoFieldAttributes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getProfileInfoFieldAttributes = fieldName => {
let apiRoute;
let convertCleanDataToPayload;
let title;
let uiSchema;
- 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 getInitialFormValues
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getInitialFormValues = options => {
const { fieldName, data, modalData } = options;
if (fieldName === FIELD_NAMES.EMAIL) {
return data ? { ...data } : { emailAddress: '' };
- 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 vapService
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export default function vapService(state = initialState, action) {
switch (action.type) {
case VAP_SERVICE_TRANSACTIONS_FETCH_SUCCESS: {
const transactions = action.data.map(transactionData =>
// Wrap in a "data" property to imitate the API response for a single transaction
- 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 formatOperatingHours
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const formatOperatingHours = operatingHours => {
if (!operatingHours) return operatingHours;
// Remove all whitespace and sanitize dashes.
const sanitizedOperatingHours = operatingHours
.replace(/ /g, '')
- 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"