Showing 3,724 of 12,675 total issues
Function getKeyIndex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getKeyIndex(key, objectName, formData) {
if (
!formData ||
!formData?.toxicExposure ||
!formData?.toxicExposure[objectName]
- 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 ConfirmationPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const ConfirmationPage = props => {
useLayoutEffect(() => {
focusElement('h2', null, 'va-alert');
scrollToTop('topScrollElement');
}, []);
- 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 FacilityConfirmation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const FacilityConfirmation = props => {
const { data, goBack, goForward, goToPath } = props;
const selectedFacility = data['view:plannedClinic'].veteranSelected;
const selectedCaregiverSupportFacility =
data['view:plannedClinic'].caregiverSupport;
- 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 App
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function App({ params }) {
let selectedLanguage = 'en';
let alternateLangauge = 'es';
let alternateRefBase = '/covid19screen/';
- 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 IntroductionPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const IntroductionPage = props => {
const { route, toggleLoginModal, loggedIn } = props;
const { formConfig, pageList, pathname, formData } = route;
const [inquiryData, setInquiryData] = useState(false);
const [searchReferenceNumber, setSearchReferenceNumber] = useState('');
- 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 CategorySelectPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const CategorySelectPage = props => {
const { onChange, loggedIn, goBack, goToPath, formData } = props;
const dispatch = useDispatch();
const [apiData, setApiData] = useState([]);
- 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 VaMedicalCenter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const VaMedicalCenter = props => {
const { formContext, id, onChange, value, veteranFacilityState } = props;
const { reviewMode, submitted } = formContext;
const [facilities, setFacilities] = useState([]);
- 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 FileUpload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const FileUpload = props => {
const {
acceptFileTypes = '.pdf,.jpeg,.png',
buttonText = 'Upload file',
error,
- 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 OtherExpensesSummary
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const OtherExpensesSummary = ({
data,
goToPath,
goForward,
setFormData,
- 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 SpouseOtherIncomeSummary
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const SpouseOtherIncomeSummary = ({
data,
goToPath,
goForward,
setFormData,
- 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 getError
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getError = (debt, resolutionAmount, submitted) => {
// Copays and debts have current balances in different locations
// check type of debt and cooresponding current balance
const overCurrent =
(debt.debtType === 'DEBT' && debt?.currentAr <= debt.resolutionComment) ||
- 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 ResolutionComments
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const ResolutionComments = ({
goBack,
goForward,
goToPath,
contentBeforeButtons,
- 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 DependentAgesReview
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const DependentAgesReview = () => {
const hasDependents = useSelector(
state => state.form.data.questions?.hasDependents,
);
const dependents = useSelector(
- 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 DashboardUnreadMessages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const DashboardUnreadMessages = props => {
const { inbox } = props;
const { noAssociations, allTriageGroupsBlocked } = useSelector(
state => state.sm.recipients,
- 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 getBenefitOptionText
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getBenefitOptionText(
option,
value,
isVeteran,
awardEffectiveDate,
- 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 CancelPageLayoutRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function CancelPageLayoutRequest() {
const { id } = useParams();
const {
bookingNotes,
email,
- 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 VideoLocation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function VideoLocation({ appointment, facility }) {
const isPast = appointment.vaos.isPastAppointment;
const genericPastContent = <span>Video conference</span>;
if (isClinicVideoAppointment(appointment)) {
- 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 ConfirmedAppointmentDetailsPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function ConfirmedAppointmentDetailsPage() {
const dispatch = useDispatch();
const { id } = useParams();
const {
appointment,
- 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 CernerTransitioningFacilityAlert
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const CernerTransitioningFacilityAlert = ({ t5, t30, facilityId }) => {
const user = useSelector(selectUser);
const transitioningFacilityId = facilityId;
const userFacilities = user.profile.facilities;
const ehrFacilities = useSelector(selectEhrDataByVhaId);
- 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 ReviewPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function ReviewPage() {
const pageTitle = useSelector(state => getPageTitle(state, pageKey));
const dispatch = useDispatch();
const {
- 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"