coronasafe/care_fe

View on GitHub
src/pages/Organization/OrganizationPatients.tsx

Summary

Maintainability
C
1 day
Test Coverage

Showing 6 of 6 total issues

Function OrganizationPatients has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export default function OrganizationPatients({ id, navOrganizationId }: Props) {
const { t } = useTranslation();
 
const { qParams, Pagination, advancedFilter, resultsPerPage, updateQuery } =
useFilters({ limit: 15, disableCache: true });
Severity: Minor
Found in src/pages/Organization/OrganizationPatients.tsx - About 1 hr to fix

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

const searchOptions = [
{
key: "name",
type: "text" as const,
placeholder: "Search by name",
Severity: Major
Found in src/pages/Organization/OrganizationPatients.tsx and 1 other location - About 2 hrs to fix
src/pages/Organization/OrganizationUsers.tsx on lines 40..53

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

{patient.geo_organization && (
<div className="col-span-2 text-sm">
<div className="text-gray-500">
{t("organization")}
</div>
Severity: Major
Found in src/pages/Organization/OrganizationPatients.tsx and 1 other location - About 1 hr to fix
src/components/Patient/PatientInfoCard.tsx on lines 172..181

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

<div className="mt-1 flex flex-col justify-start space-y-2 md:flex-row md:justify-between md:space-y-0">
<EntityBadge
title={t("patients")}
count={patients?.count}
isFetching={isFetching}
Severity: Major
Found in src/pages/Organization/OrganizationPatients.tsx and 2 other locations - About 1 hr to fix
src/pages/Organization/OrganizationUsers.tsx on lines 113..120
src/pages/Organization/OrganizationView.tsx on lines 59..66

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

<div className="text-sm">
<div className="text-gray-500">{t("gender")}</div>
<div className="font-medium">
{patient.gender}
</div>
Severity: Major
Found in src/pages/Organization/OrganizationPatients.tsx and 1 other location - About 1 hr to fix
src/components/Facility/FacilityHome.tsx on lines 294..299

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

const { qParams, Pagination, advancedFilter, resultsPerPage, updateQuery } =
useFilters({ limit: 15, disableCache: true });
Severity: Minor
Found in src/pages/Organization/OrganizationPatients.tsx and 1 other location - About 40 mins to fix
src/pages/Organization/OrganizationFacilities.tsx on lines 39..40

There are no issues that match your filters.

Category
Status