coronasafe/care_fe

View on GitHub
src/pages/Patient/index.tsx

Summary

Maintainability
D
1 day
Test Coverage

Showing 6 of 6 total issues

Function PatientIndex has 177 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function PatientIndex() {
const { t } = useTranslation();
 
const [selectedAppointment, setSelectedAppointment] = useState<
Appointment | undefined
Severity: Major
Found in src/pages/Patient/index.tsx - About 7 hrs to fix

Function getAppointmentCard has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getAppointmentCard = (appointment: Appointment) => {
const appointmentTime = dayjs(appointment.token_slot.start_datetime);
const appointmentDate = appointmentTime.format("DD MMMM YYYY");
const appointmentTimeSlot = appointmentTime.format("hh:mm a");
return (
Severity: Major
Found in src/pages/Patient/index.tsx - About 2 hrs to fix

Function PatientIndex has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function PatientIndex() {
const { t } = useTranslation();
 
const [selectedAppointment, setSelectedAppointment] = useState<
Appointment | undefined
Severity: Minor
Found in src/pages/Patient/index.tsx - About 2 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<div className="flex flex-col gap-0 items-start">
<span className="text-xs font-medium">{t("time_slot")}: </span>
<span className="text-sm">{appointmentTimeSlot}</span>
</div>
Severity: Major
Found in src/pages/Patient/index.tsx and 1 other location - About 1 hr to fix
src/pages/Patient/index.tsx on lines 147..150

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<div className="flex flex-col gap-0 items-start">
<span className="text-xs font-medium">{t("date")}: </span>
<span className="text-sm">{appointmentDate}</span>
</div>
Severity: Major
Found in src/pages/Patient/index.tsx and 1 other location - About 1 hr to fix
src/pages/Patient/index.tsx on lines 151..154

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<TabsList>
<TabsTrigger value="scheduled">{t("scheduled")}</TabsTrigger>
<TabsTrigger value="history">{t("history")}</TabsTrigger>
</TabsList>
Severity: Major
Found in src/pages/Patient/index.tsx and 2 other locations - About 1 hr to fix
src/components/Questionnaire/QuestionnaireEditor.tsx on lines 1827..1830
src/pages/Licenses/Licenses.tsx on lines 48..51

There are no issues that match your filters.

Category
Status