Showing 13 of 13 total issues
File AppointmentDetail.tsx
has 597 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { CalendarIcon, CheckCircledIcon, ClockIcon, DownloadIcon,
- Create a ticketCreate a ticket
Function AppointmentDetail
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function AppointmentDetail(props: Props) { const { t } = useTranslation(); const queryClient = useQueryClient(); const { hasPermission } = usePermissions(); const { goBack } = useAppHistory();
- Create a ticketCreate a ticket
Function AppointmentActions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const AppointmentActions = ({ facilityId, appointment, onChange, onViewPatient,
- Read upRead up
- Create a ticketCreate a ticket
Function AppointmentDetail
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function AppointmentDetail(props: Props) { const { t } = useTranslation(); const queryClient = useQueryClient(); const { hasPermission } = usePermissions(); const { goBack } = useAppHistory();
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<AlertDialog> <AlertDialogTrigger asChild> <Button variant="outline" size="lg"> <BanIcon className="size-4 mr-2" /> {t("mark_as_entered_in_error")}
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<AlertDialog> <AlertDialogTrigger asChild> <Button variant="outline" size="lg"> <BanIcon className="size-4 mr-2" /> {t("cancel_appointment")}
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<Button disabled={!isToday} variant="outline_primary" onClick={() => onChange("checked_in")} size="lg"
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<Button disabled={!isToday} variant="outline_primary" onClick={() => onChange("fulfilled")} size="lg"
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 3 locations. Consider refactoring. Open
<div className="text-sm"> <p className="font-medium">{t("facility")}</p> <p className="text-gray-600">{facility.name}</p> </div>
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
const { data: facilityData, isLoading: isFacilityLoading } = useQuery({ queryKey: ["facility", props.facilityId], queryFn: query(routes.getPermittedFacility, { pathParams: { id: props.facilityId,
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<a href={`tel:${appointment.patient.phone_number}`} className="text-primary hover:underline" > {formatPhoneNumberIntl(appointment.patient.phone_number)}
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<a href={`tel:${appointment.patient.emergency_phone_number}`} className="text-primary hover:underline" > {formatPhoneNumberIntl(
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
onSuccess: () => { toast.success(t("appointment_cancelled")); queryClient.invalidateQueries({ queryKey: ["appointment", appointment.id], });
- Read upRead up
- Create a ticketCreate a ticket