Showing 88 of 262 total issues
Function Home
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Home = () => {
return (
<>
<div className="parent_container min-h-screen pt-[8rem]">
<div className="wrapper flex flex-col ipad:flex-row">
Function SellerRedirection
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SellerRedirection = () => {
const navigate = useNavigate();
const { requires2FA } = useAppSelector((state) => state.login);
useEffect(() => {
Function Footer
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Footer = () => {
return (
<>
<footer className="flex flex-col items-center text-dark pb-8 px-[3%]">
<div className="bg-custom-gradient rounded-md text-neutral-white mx-auto p-10 flex w-full gap-5 rounded-br-[3rem] rounded-bl-[3rem] flex-wrap ipad:flex-nowrap">
Function EditUserForm
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const EditUserForm = (props: userFormType) => {
const roles = useAppSelector(
(state) => state.allRoles.data[state.allRoles.data.length - 1],
);
const roleLoading = useAppSelector((state) => state.allRoles.isLoading);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function VerifiedCard
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VerifiedCard = () => {
const { isLoading, isVerified, message } = useAppSelector(
(state) => state.verifyAccount,
);
return (
Function UserRedirection
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UserRedirection = () => {
const navigate = useNavigate();
const { isResetPassword } = useAppSelector((state) => state.forgotPassword);
useEffect(() => {
if (!isResetPassword) {
File SingleProduct.tsx
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
//import { FaCartPlus, FaPlus, FaMinus } from 'react-icons/fa';
import { useAppDispatch, useAppSelector } from '../redux/hooks/hooks';
import { useEffect, useState } from 'react';
import { IoMdArrowDropdown } from 'react-icons/io';
import { IoChevronBackSharp } from 'react-icons/io5';
Function SingleQuerries
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SingleQuerries = () => {
const dispatch = useAppDispatch();
const { isLoading, singleQuery } = useAppSelector((state) => state.queries);
const { id } = useParams<{ id: string }>();
const singleQueryNumber = singleQuery.length;
File AddProductForm.tsx
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { zodResolver } from '@hookform/resolvers/zod';
import { X } from 'lucide-react';
import { useEffect, useState } from 'react';
import { SubmitHandler, useForm } from 'react-hook-form';
import { useLocation, useNavigate } from 'react-router-dom';
Function ForgotPasswordForm
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ForgotPasswordForm = () => {
const { isLoading } = useAppSelector((state) => state.forgotPassword);
const dispatch = useAppDispatch();
const { showSuccessMessage, showErrorMessage } = useToast();
const navigate = useNavigate();
File editUserForm.tsx
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable react-hooks/exhaustive-deps */
import { useEffect } from 'react';
import { FaLessThan } from 'react-icons/fa';
import { useNavigate } from 'react-router-dom';
import { useAppDispatch, useAppSelector } from '../../redux/hooks/hooks';
Function DashboardLayout
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DashboardLayout = () => {
const [activeItem, setActiveItem] = useState<string>('Dashboard');
const [showMenu, setShowMenu] = useState(false);
const { show } = useHandleResize();
const [currentUser, setCurrentUser] = useState<currentUserType>({
Function Orders
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Orders = () => {
const dispatch = useAppDispatch();
const { isLoading, numberOfOrder } = useAppSelector((state) => state.order);
const data = useAppSelector((state) => state.order.orders);
Function ProfileUser
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const ProfileUser = () => {
const dispatch = useAppDispatch();
const { data, isLoading, error } = useAppSelector((state) => state.profile);
const [selectedImage, setSelectedImage] = useState<File | null>(null);
const { showErrorMessage, showSuccessMessage } = useToast();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function handleMomoPay
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleMomoPay: SubmitHandler<momoValidationType> = async (
data: momoValidationType,
) => {
try {
const res = await dispatch(momoPay(data)).unwrap();
Function DashboardTopNav
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DashboardTopNav = () => {
const { show } = useHandleResize();
const { setShowMenu, showMenu } = useContext(toggleMenuContext);
const { data } = useAppSelector((state) => state.profile);
Function VerifiedCard
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const VerifiedCard = () => {
const { isLoading, isVerified, message } = useAppSelector(
(state) => state.verifyAccount,
);
return (
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function UpdateOrderModal
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const UpdateOrderModal: React.FC = () => {
const dispatch = useAppDispatch();
const { selectedSaleId, deliveryDate, status, productName, productImage } =
useAppSelector((state) => state.sales);
const { isLoading } = useAppSelector((state) => state.updateOrder);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function WishlistPage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const WishlistPage = () => {
const dispatch = useAppDispatch();
const { isLoading, wishlist } = useAppSelector((state) => state.sellerWishes);
useEffect(() => {
Function ChatComponent
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChatComponent = () => {
const [chatModal, setChatModal] = useState(false);
const toggleChatModal = () => {
setChatModal(!chatModal);
};