coronasafe/care_fe

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

Summary

Maintainability
B
5 hrs
Test Coverage

Showing 4 of 4 total issues

Function OrganizationUsers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

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

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

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

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("users")}
count={users?.count}
isFetching={isFetchingUsers}
Severity: Major
Found in src/pages/Organization/OrganizationUsers.tsx and 2 other locations - About 1 hr to fix
src/pages/Organization/OrganizationPatients.tsx on lines 105..112
src/pages/Organization/OrganizationView.tsx on lines 59..66

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

trigger={
<Button variant="outline" size="sm">
<span>{t("edit_role")}</span>
</Button>
}
Severity: Minor
Found in src/pages/Organization/OrganizationUsers.tsx and 1 other location - About 35 mins to fix
src/pages/Facility/settings/organizations/FacilityOrganizationUsers.tsx on lines 150..154
Category
Status