coronasafe/care_fe

View on GitHub
src/pages/UserDashboard.tsx

Summary

Maintainability
F
4 days
Test Coverage

Showing 6 of 6 total issues

Function UserDashboard has 245 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function UserDashboard() {
const user = useAuthUser();
const { signOut } = useAuthContext();
const facilities = user.facilities || [];
const { t } = useTranslation();
Severity: Major
Found in src/pages/UserDashboard.tsx - About 1 day to fix

File UserDashboard.tsx has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { ChevronRight, LogOut, SquarePen, User2Icon } from "lucide-react";
import { Link } from "raviger";
import { useState } from "react";
import { useTranslation } from "react-i18next";
 
 
Severity: Minor
Found in src/pages/UserDashboard.tsx - About 3 hrs to fix

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

{activeTab === DashboardTabs.TAB_ASSOCIATIONS && (
<TabContent
tabId="associations-panel"
tabItems={associations}
description={t("dashboard_tab_associations")}
Severity: Major
Found in src/pages/UserDashboard.tsx and 1 other location - About 1 day to fix
src/pages/UserDashboard.tsx on lines 258..292

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

{activeTab === DashboardTabs.TAB_GOVERNANCE && (
<TabContent
tabId="governance-panel"
tabItems={governance}
description={t("dashboard_tab_governance")}
Severity: Major
Found in src/pages/UserDashboard.tsx and 1 other location - About 1 day to fix
src/pages/UserDashboard.tsx on lines 222..256

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

<h1 className="text-xl md:text-2xl font-bold">
{t("hey_user", {
user: [user.prefix, user.first_name].filter(Boolean).join(" "),
})}
</h1>
Severity: Major
Found in src/pages/UserDashboard.tsx and 1 other location - About 1 hr to fix
src/pages/Facility/overview.tsx on lines 68..74

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

<DropdownMenuItem
data-cy="sign-out-button"
className="cursor-pointer flex items-center gap-2 text-xs w-full"
onClick={signOut}
>
Severity: Minor
Found in src/pages/UserDashboard.tsx and 1 other location - About 45 mins to fix
src/components/Common/Drawings/ExcalidrawEditor.tsx on lines 158..161

There are no issues that match your filters.

Category
Status