Showing 7 of 7 total issues
Function VerifyPatient
has 247 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function VerifyPatient(props: { facilityId: string }) { const { t } = useTranslation(); const [qParams] = useQueryParams(); const { phone_number, year_of_birth, partial_id } = qParams; const { goBack } = useAppHistory();
- Create a ticketCreate a ticket
Function VerifyPatient
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export default function VerifyPatient(props: { facilityId: string }) { const { t } = useTranslation(); const [qParams] = useQueryParams(); const { phone_number, year_of_birth, partial_id } = qParams; const { goBack } = useAppHistory();
- Read upRead up
- Create a ticketCreate a ticket
File VerifyPatient.tsx
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useMutation, useQuery } from "@tanstack/react-query";import { AlertCircle, CalendarIcon } from "lucide-react";import { Link, useQueryParams } from "raviger";import { useEffect } from "react";import { useTranslation } from "react-i18next";
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div className="relative flex w-full items-center gap-3 md:gap-4"> <div className="flex size-10 md:size-12 items-center justify-center rounded-xl bg-primary/10 group-hover:bg-primary/20 transition-colors"> <CareIcon icon="l-stethoscope" className="size-5 md:size-6 text-primary"
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div className="flex flex-col items-center justify-center p-6 md:p-8 text-center border rounded-lg border-dashed"> <div className="rounded-full bg-primary/10 p-2 md:p-3 mb-3 md:mb-4"> <CareIcon icon="l-folder-open" className="size-5 md:size-6 text-primary"
- Read upRead up
- Create a ticketCreate a ticket
Identical blocks of code found in 5 locations. Consider refactoring. Open
onError: (error) => { const errorData = error.cause as { errors: { msg: string[] } }; errorData.errors.msg.forEach((er) => { toast.error(er); });
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
const { data: facilityData, isLoading: facilityLoading } = useQuery({ queryKey: ["facility", props.facilityId], queryFn: query(routes.getPermittedFacility, { pathParams: { id: props.facilityId }, }),
- Read upRead up
- Create a ticketCreate a ticket