Showing 88 of 262 total issues
Function ProfileUser
has 254 lines of code (exceeds 25 allowed). Consider refactoring. Open
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();
Function PaymentToggleModel
has 253 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PaymentToggleModel() {
const navigate = useNavigate();
const dispatch = useAppDispatch();
const [current, setCurrent] = useState(0);
const [previousStep, setPreviousStep] = useState(0);
Function AddEditProductForm
has 247 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AddEditProductForm = () => {
const location = useLocation();
const navigate = useNavigate();
const dispatch = useAppDispatch();
const { showErrorMessage, showSuccessMessage } = useToast();
Function SingleProduct
has 245 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SingleProduct = () => {
const { isLoading, singleProduct } = useAppSelector((state) => state.product);
const dispatch = useAppDispatch();
const review = useAppSelector(
Function EditUserForm
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EditUserForm = (props: userFormType) => {
const roles = useAppSelector(
(state) => state.allRoles.data[state.allRoles.data.length - 1],
);
const roleLoading = useAppSelector((state) => state.allRoles.isLoading);
Function GetUser
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const GetUser = (props: getUserType) => {
const [currentPage, setCurrentPage] = useState(0);
const [searchQuery, setSearchQuery] = useState('');
const [butOverlay, setButOverlay] = useState('');
const roles = useAppSelector((state) => state.allRoles?.data[0]);
Function ProductsPage
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ProductsPage = () => {
const [openFilter, setOpenFilter] = useState(false);
const { isLoading, products } = useAppSelector((state) => state.product);
const { data, searchInputs } = useAppSelector((state) => state.search);
const { carts } = useAppSelector((state) => state.cart);
Function SellerDashboard
has 186 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SellerDashboard = () => {
const dispatch = useAppDispatch();
const { show } = useHandleResize();
const [VALUES, setVALUES] = useState(initialValues);
const { isLoading, allSalesData } = useAppSelector((state) => state.sales);
Function AllReview
has 185 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function AllReview(props: reviewType) {
const [ratingTab, setRatingTab] = useState(false);
const data = useAppSelector(
(state) => state.fetchReview.data[state.fetchReview.data.length - 1]?.data,
);
Function LandingProduct
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LandingProduct = () => {
const { isLoading, products } = useAppSelector((state) => state.product);
const { data, searchInputs } = useAppSelector((state) => state.search);
const [openModel, setOpenModel] = useState(false);
const [openFilter, setOpenFilter] = useState(false);
Function Contacts
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Contacts = () => {
const { show } = useHandleResize();
const dispatch = useAppDispatch();
const { isLoading } = useAppSelector((state) => state.queries);
const { showSuccessMessage, showErrorMessage } = useToast();
Function ReviewForm
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ReviewForm(props: reviewFormType) {
const [isEditMode, setIsEditMode] = useState(false);
const [rated, setRated] = useState(0);
const [reviewId, setReviewId] = useState('');
const dispatch = useAppDispatch();
Function SingleOrders
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SingleOrders = () => {
const dispatch = useAppDispatch();
const { id } = useParams<{ id: string }>();
const { isLoading, singleOrder } = useAppSelector((state) => state.order);
Function SellerSingleProduct
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SellerSingleProduct = () => {
const { id } = useParams();
const { isLoading, singleProduct } = useAppSelector((state) => state.product);
const { availability } = useAppSelector((state) => state.productAvailability);
const dispatch = useAppDispatch();
Function AdminStat
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function AdminStat() {
const dispatch = useAppDispatch();
const data = useAppSelector((state) => state.adminStatsSlice);
useEffect(() => {
Function SellerProductsPage
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SellerProductsPage = () => {
const { isLoading } = useAppSelector((state) => state.product);
// eslint-disable-next-line react-hooks/exhaustive-deps
const data = useAppSelector((state) => state.product.products) || [];
const dispatch = useAppDispatch();
Function UpdateOrderModal
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UpdateOrderModal: React.FC = () => {
const dispatch = useAppDispatch();
const { selectedSaleId, deliveryDate, status, productName, productImage } =
useAppSelector((state) => state.sales);
const { isLoading } = useAppSelector((state) => state.updateOrder);
Function Nav
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Nav = () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const accessToken = localStorage.getItem('access_token') || '';
const dispatch = useAppDispatch();
const openModel = useAppSelector((state) => state.nav.openModel);
Function RegisterForm
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const RegisterForm = () => {
const { showErrorMessage, showSuccessMessage } = useToast();
const { show } = useHandleResize();
const dispatch = useAppDispatch();
const navigate = useNavigate();
Function Notification
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Notification = () => {
const dispatch = useAppDispatch();
const { accessToken } = useToken();
const notificationPlayer = useRef<HTMLAudioElement>(null);
const [notificationActive, setNotificationActive] = useState(false);