coronasafe/care_fe

View on GitHub

Showing 1,644 of 1,645 total issues

Avoid too many return statements within this function.
Open

return <span>{t("questionnaire_appointment_no_encounter")}</span>;
Severity: Major
Found in src/components/Questionnaire/QuestionTypes/QuestionInput.tsx - About 30 mins to fix

Avoid too many return statements within this function.
Open

return;
Severity: Major
Found in src/Utils/request/errorHandler.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

return <span>{t("questionnaire_symptom_no_encounter")}</span>;
Severity: Major
Found in src/components/Questionnaire/QuestionTypes/QuestionInput.tsx - About 30 mins to fix

Avoid too many return statements within this function.
Open

return (
<>
<span className=" capitalize text-gray-500">{t("before")} </span>
<span className="pl-1 text-black">
{formatDate(dateTo, "dd MMM yyyy")}
Severity: Major
Found in src/pages/Appointments/AppointmentsPage.tsx - About 30 mins to fix

Avoid too many return statements within this function.
Open

return AppointmentStatuses;
Severity: Major
Found in src/pages/Appointments/AppointmentsPage.tsx - About 30 mins to fix

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

start_time: z
.string()
.min(1, t("field_required")) as unknown as z.ZodType<Time>,
Severity: Major
Found in src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx and 7 other locations - About 30 mins to fix
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 69..71
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 72..74
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 103..105
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 106..108
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 125..127
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 128..130
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 577..579

Avoid too many return statements within this function.
Open

return (
<>
<span className="capitalize text-gray-500">{t("after")} </span>
<span className="pl-1 text-black">
{formatDate(dateFrom, "dd MMM yyyy")}
Severity: Major
Found in src/pages/Appointments/AppointmentsPage.tsx - About 30 mins to fix

Avoid too many return statements within this function.
Open

return (
<span className="text-black">
{formatDate(dateFrom!, "dd MMM yyyy")} -{" "}
{formatDate(dateTo!, "dd MMM yyyy")}
</span>
Severity: Major
Found in src/pages/Appointments/AppointmentsPage.tsx - About 30 mins to fix

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

end_time: z
.string()
.min(1, t("field_required")) as unknown as z.ZodType<Time>,
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 69..71
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 72..74
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 103..105
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 125..127
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 128..130
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 574..576
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 577..579

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

end_time: z
.string()
.min(1, t("field_required")) as unknown as z.ZodType<Time>,
Severity: Major
Found in src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx and 7 other locations - About 30 mins to fix
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 69..71
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 72..74
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 103..105
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 106..108
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 125..127
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 128..130
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 574..576

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

start_time: z
.string()
.min(1, t("field_required")) as unknown as z.ZodType<Time>,
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 69..71
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 72..74
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 106..108
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 125..127
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 128..130
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 574..576
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 577..579

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

const currentValue = questionnaireResponse.values[0]?.value
? new Date(questionnaireResponse.values[0].value as string)
: undefined;
Severity: Minor
Found in src/components/Questionnaire/QuestionTypes/DateTimeQuestion.tsx and 1 other location - About 30 mins to fix
src/components/Questionnaire/QuestionTypes/DateQuestion.tsx on lines 29..31

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

const currentValue = questionnaireResponse.values[0]?.value
? new Date(questionnaireResponse.values[0].value as string)
: undefined;
Severity: Minor
Found in src/components/Questionnaire/QuestionTypes/DateQuestion.tsx and 1 other location - About 30 mins to fix
src/components/Questionnaire/QuestionTypes/DateTimeQuestion.tsx on lines 43..45

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

<div className="max-w-4xl" data-cy="add-medication-request">
<ValueSetSelect
system="system-medication"
placeholder={t("search_for_medications_to_add")}
onSelect={handleAddMedication}
src/components/Questionnaire/QuestionTypes/MedicationStatementQuestion.tsx on lines 399..407

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

end_time: z
.string()
.min(1, t("field_required")) as unknown as z.ZodType<Time>,
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 69..71
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 103..105
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 106..108
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 125..127
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 128..130
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 574..576
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 577..579

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

end_time: z
.string()
.min(1, t("field_required")) as unknown as z.ZodType<Time>,
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 69..71
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 72..74
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 103..105
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 106..108
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 125..127
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 574..576
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 577..579

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

start_time: z
.string()
.min(1, t("field_required")) as unknown as z.ZodType<Time>,
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 72..74
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 103..105
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 106..108
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 125..127
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 128..130
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 574..576
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 577..579

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

start_time: z
.string()
.min(1, t("field_required")) as unknown as z.ZodType<Time>,
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 69..71
src/pages/Scheduling/components/CreateScheduleExceptionSheet.tsx on lines 72..74
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 103..105
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 106..108
src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx on lines 128..130
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 574..576
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 577..579

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

<div className="max-w-4xl">
<ValueSetSelect
system="system-medication"
placeholder={t("search_for_medications_to_add")}
onSelect={handleAddMedication}
src/components/Questionnaire/QuestionTypes/MedicationRequestQuestion.tsx on lines 480..488

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

if (data.period.end && data.date > data.period.end) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: t("consent_after_end"),
path: ["date"],
Severity: Minor
Found in src/components/Consent/LinkConsentDialog.tsx and 2 other locations - About 30 mins to fix
src/components/Consent/LinkConsentDialog.tsx on lines 72..78
src/pages/PublicAppointments/PatientRegistration.tsx on lines 97..108
Severity
Category
Status
Source
Language