coronasafe/care_fe

View on GitHub
src/pages/UserDashboard.tsx

Summary

Maintainability
F
4 days
Test Coverage

Showing 5 of 5 total issues

Function UserDashboard has 223 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 279 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 2 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 233..267

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 197..231

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
Category
Status