Showing 15 of 15 total issues
Function PatientRegistration
has 382 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function PatientRegistration(props: PatientRegistrationProps) { const { staffId } = props; const selectedSlot = JSON.parse( localStorage.getItem("selectedSlot") ?? "", ) as TokenSlot;
- Create a ticketCreate a ticket
File PatientRegistration.tsx
has 425 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { zodResolver } from "@hookform/resolvers/zod";import { useMutation, useQueryClient } from "@tanstack/react-query";import { navigate, useNavigationPrompt } from "raviger";import { useForm } from "react-hook-form";import { useTranslation } from "react-i18next";
- Create a ticketCreate a ticket
Function PatientRegistration
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function PatientRegistration(props: PatientRegistrationProps) { const { staffId } = props; const selectedSlot = JSON.parse( localStorage.getItem("selectedSlot") ?? "", ) as TokenSlot;
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<FormField control={form.control} name="gender" render={({ field }) => ( <FormItem className="space-y-3">
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
{form.getValues("age") && ( <div className="text-sm font-bold"> {Number(form.getValues("age")) <= 0 ? ( <span className="text-red-600"> {t("invalid_age")}
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<FormField control={form.control} name="pincode" render={({ field }) => ( <FormItem className="flex flex-col">
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<FormField control={form.control} name="address" render={({ field }) => ( <FormItem className="flex flex-col">
- Read upRead up
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
<FormControl> <DateField date={ field.value ? new Date(field.value) : undefined }
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
mutationFn: (body: AppointmentCreateRequest) => mutate(PublicAppointmentApi.createAppointment, { pathParams: { id: selectedSlot?.id }, body, headers: {
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 3 locations. Consider refactoring. Open
<div className="flex items-center gap-2 px-4 py-2"> <RadioGroupItem id="dob-option" value="date_of_birth" />
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 3 locations. Consider refactoring. Open
<div className="flex items-center gap-2 px-4 py-2"> <RadioGroupItem id="age-option" value="age" /> <Label htmlFor="age-option">{t("age")}</Label> </div>
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<Button variant="outline" className="border border-secondary-400" type="button" onClick={() =>
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<Button variant="white" className="sm:w-1/5" type="button" onClick={() =>
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 4 locations. Consider refactoring. Open
<Button variant="primary_gradient" className="sm:w-1/5" type="submit" >
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 3 locations. Consider refactoring. Open
if ( field === "age" && data.age && !isNaN(Number(data.age)) && Number(data.age) < 0
- Read upRead up
- Create a ticketCreate a ticket