Showing 6 of 6 total issues
Function ScheduleAppointment
has 286 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ScheduleAppointment(props: AppointmentsProps) { const { t } = useTranslation(); const { goBack } = useAppHistory(); const { facilityId, staffId, appointmentId } = props; const [selectedMonth, setSelectedMonth] = useState(new Date());
- Create a ticketCreate a ticket
File Schedule.tsx
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";import { isWithinInterval } from "date-fns";import { Loader2 } from "lucide-react";import { navigate } from "raviger";import { useEffect, useState } from "react";
- Create a ticketCreate a ticket
Function ScheduleAppointment
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function ScheduleAppointment(props: AppointmentsProps) { const { t } = useTranslation(); const { goBack } = useAppHistory(); const { facilityId, staffId, appointmentId } = props; const [selectedMonth, setSelectedMonth] = useState(new Date());
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
onSuccess: (data: Appointment) => { toast.success(t("appointment_created_success")); queryClient.invalidateQueries({ queryKey: [ ["patients", tokenData.phoneNumber],
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div> <Label className="mb-2">{t("reason_for_visit")}</Label> <Textarea placeholder={t("reason_for_visit_placeholder")} value={reason}
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!staffId) { toast.error(t("staff_username_not_found")); navigate(`/facility/${facilityId}/`); } else if (!tokenData) { toast.error(t("phone_number_not_found"));
- Read upRead up
- Create a ticketCreate a ticket