coronasafe/care_fe

View on GitHub

Showing 1,644 of 1,645 total issues

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

<a
href={urls.ohcn}
target="_blank"
rel="noopener noreferrer"
className="text-secondary-500"
Severity: Minor
Found in src/components/Auth/AuthHero.tsx and 1 other location - About 35 mins to fix
src/components/Auth/AuthHero.tsx on lines 97..104

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

href={`/facility/${encounter.facility.id}/patient/${encounter.patient.id}/encounter/${encounter.id}/questionnaire/${option.slug}`}
Severity: Minor
Found in src/components/Facility/ConsultationDetails/QuickAccess.tsx and 1 other location - About 35 mins to fix
src/components/Facility/ConsultationDetails/QuickAccess.tsx on lines 58..58

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

const ScheduleTemplateItem = ({
template,
facilityId,
userId,
}: {
Severity: Minor
Found in src/pages/Scheduling/ScheduleTemplates.tsx and 1 other location - About 35 mins to fix
src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx on lines 142..345

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

{loading ? (
<TableRow>
<TableCell colSpan={6} className="text-center py-4">
{t("loading")}
</TableCell>
Severity: Minor
Found in src/components/Patient/PatientDetailsTab/ResourceRequests.tsx and 2 other locations - About 35 mins to fix
src/components/Patient/PatientDetailsTab/Appointments.tsx on lines 123..173
src/pages/Facility/settings/devices/components/DeviceServiceHistory.tsx on lines 95..125

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

z
.object({
name: z.string().nonempty(t("name_is_required")),
phone_number: validators().phoneNumber.required,
same_phone_number: z.boolean(),
Severity: Minor
Found in src/components/Patient/PatientRegistration.tsx and 2 other locations - About 35 mins to fix
src/components/Patient/PatientRegistration.tsx on lines 85..137
src/components/Patient/PatientRegistration.tsx on lines 85..145

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

<a
href={urls.github}
target="_blank"
rel="noopener noreferrer"
className="text-primary-400 hover:text-primary-500"
Severity: Minor
Found in src/components/Auth/AuthHero.tsx and 1 other location - About 35 mins to fix
src/components/Auth/AuthHero.tsx on lines 88..95

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

function SubjectTypeSelector({
value,
onChange,
}: {
value: SubjectType;
Severity: Minor
Found in src/components/Questionnaire/QuestionnaireProperties.tsx and 1 other location - About 35 mins to fix
src/components/Questionnaire/QuestionnaireProperties.tsx on lines 69..107

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

{isLoading ? (
<div>
<div className="grid gap-5">
<CardListSkeleton count={RESULTS_PER_PAGE_LIMIT} />
</div>
Severity: Minor
Found in src/components/Resource/ResourceCommentSection.tsx and 1 other location - About 35 mins to fix
src/pages/Facility/settings/devices/DeviceEncounterHistory.tsx on lines 58..101

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

<div className="py-6">
<DeviceSearch
facilityId={facilityId}
onSelect={setSelectedDevice}
value={selectedDevice}
Severity: Minor
Found in src/pages/Encounters/AssociateDeviceSheet.tsx and 1 other location - About 35 mins to fix
src/pages/Encounters/tabs/EncounterOverviewTab.tsx on lines 91..97

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

const ScheduleTemplateEditor = ({
template,
facilityId,
userId,
}: {
Severity: Minor
Found in src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx and 1 other location - About 35 mins to fix
src/pages/Scheduling/ScheduleTemplates.tsx on lines 61..165

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

const renderBasicInformation = () => {
return (
<div className="overflow-visible px-4 py-5 sm:px-6 rounded-lg shadow-sm sm:rounded-lg bg-white">
<BasicInfoDetails user={userData} />
</div>
Severity: Minor
Found in src/components/Users/UserSummary.tsx and 2 other locations - About 35 mins to fix
src/components/Users/UserSummary.tsx on lines 83..89
src/components/Users/UserSummary.tsx on lines 91..97

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

const renderContactInformation = () => {
return (
<div className="overflow-visible px-4 py-5 sm:px-6 rounded-lg shadow-sm sm:rounded-lg bg-white">
<ContactInfoDetails user={userData} />
</div>
Severity: Minor
Found in src/components/Users/UserSummary.tsx and 2 other locations - About 35 mins to fix
src/components/Users/UserSummary.tsx on lines 75..81
src/components/Users/UserSummary.tsx on lines 91..97

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

`/facility/${encounter.facility.id}/patient/${encounter.patient.id}/encounter/${encounter.id}/questionnaire/${selected.slug}`,
Severity: Minor
Found in src/components/Facility/ConsultationDetails/QuickAccess.tsx and 1 other location - About 35 mins to fix
src/components/Facility/ConsultationDetails/QuickAccess.tsx on lines 44..44

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

{serviceHistory?.results?.length === 0 ? (
<TableRow>
<TableCell colSpan={3} className="text-center">
{t("service_records_none")}
</TableCell>
src/components/Patient/PatientDetailsTab/Appointments.tsx on lines 123..173
src/components/Patient/PatientDetailsTab/ResourceRequests.tsx on lines 97..133

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

{isLoading ? (
<TableRow>
<TableCell colSpan={5} className="text-center py-4">
{t("loading")}
</TableCell>
Severity: Minor
Found in src/components/Patient/PatientDetailsTab/Appointments.tsx and 2 other locations - About 35 mins to fix
src/components/Patient/PatientDetailsTab/ResourceRequests.tsx on lines 97..133
src/pages/Facility/settings/devices/components/DeviceServiceHistory.tsx on lines 95..125

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

{files?.results && files?.results?.length > 0 ? (
files.results.map((file) => {
const filetype = getFileType(file);
const fileName = file.name ? file.name + file.extension : "";
 
 
Severity: Minor
Found in src/components/Files/FilesTab.tsx and 2 other locations - About 35 mins to fix
src/components/Patient/PatientDetailsTab/Appointments.tsx on lines 129..173
src/components/Patient/PatientDetailsTab/ResourceRequests.tsx on lines 103..133

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

queryFn: query.paginated(medicationAdministrationApi.list, {
pathParams: { patientId: patientId },
queryParams: {
encounter: encounterId,
},
src/components/Patient/TreatmentSummary.tsx on lines 110..114
src/components/Patient/TreatmentSummary.tsx on lines 133..137

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

const renderGeoOrgDetails = () => {
return (
<div className="overflow-visible px-4 py-5 sm:px-6 rounded-lg shadow-sm sm:rounded-lg bg-white">
<GeoOrgDetails user={userData} />
</div>
Severity: Minor
Found in src/components/Users/UserSummary.tsx and 2 other locations - About 35 mins to fix
src/components/Users/UserSummary.tsx on lines 75..81
src/components/Users/UserSummary.tsx on lines 83..89

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

) : appointments && appointments.length ? (
appointments.map((appointment) => (
<TableRow key={appointment.id}>
<TableCell className="font-medium">
{appointment.token_slot.availability.name}
Severity: Minor
Found in src/components/Patient/PatientDetailsTab/Appointments.tsx and 2 other locations - About 35 mins to fix
src/components/Files/FilesTab.tsx on lines 527..617
src/components/Patient/PatientDetailsTab/ResourceRequests.tsx on lines 103..133

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

queryFn: query.paginated(symptomApi.listSymptoms, {
pathParams: { patientId },
queryParams: { encounter: encounterId },
pageSize: 100,
}),
Severity: Minor
Found in src/components/Patient/TreatmentSummary.tsx and 2 other locations - About 35 mins to fix
src/components/Medicine/MedicationAdministration/PrintMedicationAdministration.tsx on lines 52..58
src/components/Patient/TreatmentSummary.tsx on lines 133..137
Severity
Category
Status
Source
Language