coronasafe/care_fe

View on GitHub

Showing 411 of 1,569 total issues

File QuestionnaireEditor.tsx has 1652 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { zodResolver } from "@hookform/resolvers/zod";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { t } from "i18next";
import {
ChevronDown,
Severity: Major
Found in src/components/Questionnaire/QuestionnaireEditor.tsx - About 4 days to fix

Function PatientRegistration has 753 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function PatientRegistration(
props: PatientRegistrationPageProps,
) {
const [{ phone_number }] = useQueryParams();
const { patientId, facilityId } = props;
Severity: Major
Found in src/components/Patient/PatientRegistration.tsx - About 3 days to fix

Function FilesTab has 633 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const FilesTab = (props: FilesTabProps) => {
const { patient, type, encounter } = props;
const { qParams, updateQuery, Pagination, resultsPerPage } = useFilters({
limit: 14,
});
Severity: Major
Found in src/components/Files/FilesTab.tsx - About 3 days to fix

File DiagnosisQuestion.tsx has 1044 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
DotsVerticalIcon,
MinusCircledIcon,
Pencil2Icon,
} from "@radix-ui/react-icons";
Severity: Major
Found in src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx - About 2 days to fix

Function Login has 523 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Login = (props: LoginProps) => {
const { signIn, patientLogin, isAuthenticating } = useAuthContext();
const {
reCaptchaSiteKey,
urls,
Severity: Major
Found in src/components/Auth/Login.tsx - About 2 days to fix

File MedicationRequestQuestion.tsx has 1032 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { MinusCircledIcon, Pencil2Icon } from "@radix-ui/react-icons";
import { useQuery } from "@tanstack/react-query";
import { t } from "i18next";
import React, { useEffect, useState } from "react";
 
 

File AppointmentsPage.tsx has 1015 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import careConfig from "@careConfig";
import { CaretDownIcon, CheckIcon } from "@radix-ui/react-icons";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import {
addDays,
Severity: Major
Found in src/pages/Appointments/AppointmentsPage.tsx - About 2 days to fix

Function useFileManager has 457 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function useFileManager(
options: FileManagerOptions,
): FileManagerResult {
const { type: fileType, onArchive, onEdit, uploadedFiles } = options;
 
 
Severity: Major
Found in src/hooks/useFileManager.tsx - About 2 days to fix

Function PatientInfoCard has 437 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function PatientInfoCard(props: PatientInfoCardProps) {
const { patient, encounter, canWrite, disableButtons = false } = props;
const { t } = useTranslation();
 
return (
Severity: Major
Found in src/components/Patient/PatientInfoCard.tsx - About 2 days to fix

File EditScheduleTemplateSheet.tsx has 887 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { zodResolver } from "@hookform/resolvers/zod";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { isBefore, parse } from "date-fns";
import { Loader2, SaveIcon, Trash2Icon } from "lucide-react";
import { useState } from "react";
Severity: Major
Found in src/pages/Scheduling/components/EditScheduleTemplateSheet.tsx - About 2 days to fix

Function FilePreviewDialog has 426 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FilePreviewDialog = (props: FilePreviewProps) => {
const {
show,
onClose,
file_state,
Severity: Major
Found in src/components/Common/FilePreviewDialog.tsx - About 2 days to fix

File QuestionnaireForm.tsx has 827 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { useMutation, useQuery } from "@tanstack/react-query";
import { t } from "i18next";
import { useNavigationPrompt } from "raviger";
import { useEffect, useState } from "react";
import { toast } from "sonner";
Severity: Major
Found in src/components/Questionnaire/QuestionnaireForm.tsx - About 1 day to fix

File PatientRegistration.tsx has 817 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { zodResolver } from "@hookform/resolvers/zod";
import { useMutation, useQuery } from "@tanstack/react-query";
import { InfoIcon } from "lucide-react";
import { navigate, useNavigationPrompt, useQueryParams } from "raviger";
import { useEffect, useMemo, useState } from "react";
Severity: Major
Found in src/components/Patient/PatientRegistration.tsx - About 1 day to fix

File AdministrationTab.tsx has 808 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use client";
 
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { format, formatDistanceToNow } from "date-fns";
import { t } from "i18next";

Function PatientRegistration has 383 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function PatientRegistration(props: PatientRegistrationProps) {
const { staffId } = props;
const selectedSlot = JSON.parse(
localStorage.getItem("selectedSlot") ?? "",
) as TokenSlot;
Severity: Major
Found in src/pages/PublicAppointments/PatientRegistration.tsx - About 1 day to fix

Function LocationSheet has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
Open

export function LocationSheet({
trigger,
history,
facilityId,
encounter,
Severity: Minor
Found in src/components/Location/LocationSheet.tsx - About 1 day to fix

File LocationSheet.tsx has 781 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { format } from "date-fns";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { toast } from "sonner";
Severity: Major
Found in src/components/Location/LocationSheet.tsx - About 1 day to fix

File UserForm.tsx has 770 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { zodResolver } from "@hookform/resolvers/zod";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { Lock, Mail } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
Severity: Major
Found in src/components/Users/UserForm.tsx - About 1 day to fix

File SymptomQuestion.tsx has 747 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use client";
 
import {
DotsVerticalIcon,
MinusCircledIcon,
Severity: Major
Found in src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx - About 1 day to fix

File sidebar.tsx has 729 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Slot } from "@radix-ui/react-slot";
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
import { VariantProps, cva } from "class-variance-authority";
import { PanelLeftClose, PanelRightClose } from "lucide-react";
import * as React from "react";
Severity: Major
Found in src/components/ui/sidebar.tsx - About 1 day to fix
Severity
Category
Status
Source
Language