atlp-rwanda/hackers-ec-Fe

View on GitHub

Showing 88 of 262 total issues

Function ProfileUser has 254 lines of code (exceeds 25 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();
Severity: Major
Found in src/components/auth/ProfileUser.tsx - About 1 day to fix

    Function PaymentToggleModel has 253 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function PaymentToggleModel() {
        const navigate = useNavigate();
        const dispatch = useAppDispatch();
        const [current, setCurrent] = useState(0);
        const [previousStep, setPreviousStep] = useState(0);
    Severity: Major
    Found in src/components/payment/PaymentToggleModel.tsx - About 1 day to fix

      Function AddEditProductForm has 247 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const AddEditProductForm = () => {
          const location = useLocation();
          const navigate = useNavigate();
          const dispatch = useAppDispatch();
          const { showErrorMessage, showSuccessMessage } = useToast();
      Severity: Major
      Found in src/components/Forms/AddProductForm.tsx - About 1 day to fix

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

        const SingleProduct = () => {
            const { isLoading, singleProduct } = useAppSelector((state) => state.product);
        
            const dispatch = useAppDispatch();
            const review = useAppSelector(
        Severity: Major
        Found in src/pages/SingleProduct.tsx - About 1 day to fix

          Function EditUserForm has 217 lines of code (exceeds 25 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);
          Severity: Major
          Found in src/components/Forms/editUserForm.tsx - About 1 day to fix

            Function GetUser has 210 lines of code (exceeds 25 allowed). Consider refactoring.
            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]);
            Severity: Major
            Found in src/components/adminDashboard/getUser.tsx - About 1 day to fix

              Function ProductsPage has 199 lines of code (exceeds 25 allowed). Consider refactoring.
              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);
              Severity: Major
              Found in src/pages/ProductsPage.tsx - About 7 hrs to fix

                Function SellerDashboard has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const SellerDashboard = () => {
                    const dispatch = useAppDispatch();
                    const { show } = useHandleResize();
                    const [VALUES, setVALUES] = useState(initialValues);
                    const { isLoading, allSalesData } = useAppSelector((state) => state.sales);
                Severity: Major
                Found in src/pages/dashboard/seller/SellerDashboard.tsx - About 7 hrs to fix

                  Function AllReview has 185 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function AllReview(props: reviewType) {
                      const [ratingTab, setRatingTab] = useState(false);
                      const data = useAppSelector(
                          (state) => state.fetchReview.data[state.fetchReview.data.length - 1]?.data,
                      );
                  Severity: Major
                  Found in src/components/product/review/AllReview.tsx - About 7 hrs to fix

                    Function LandingProduct has 181 lines of code (exceeds 25 allowed). Consider refactoring.
                    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);
                    Severity: Major
                    Found in src/pages/LandingProduct.tsx - About 7 hrs to fix

                      Function Contacts has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const Contacts = () => {
                          const { show } = useHandleResize();
                          const dispatch = useAppDispatch();
                          const { isLoading } = useAppSelector((state) => state.queries);
                          const { showSuccessMessage, showErrorMessage } = useToast();
                      Severity: Major
                      Found in src/pages/Contacts.tsx - About 6 hrs to fix

                        Function ReviewForm has 157 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function ReviewForm(props: reviewFormType) {
                            const [isEditMode, setIsEditMode] = useState(false);
                            const [rated, setRated] = useState(0);
                            const [reviewId, setReviewId] = useState('');
                            const dispatch = useAppDispatch();
                        Severity: Major
                        Found in src/components/Forms/ReviewForm.tsx - About 6 hrs to fix

                          Function SingleOrders has 148 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const SingleOrders = () => {
                              const dispatch = useAppDispatch();
                              const { id } = useParams<{ id: string }>();
                              const { isLoading, singleOrder } = useAppSelector((state) => state.order);
                          
                          
                          Severity: Major
                          Found in src/pages/dashboard/buyer/order/SingleOrders.tsx - About 5 hrs to fix

                            Function SellerSingleProduct has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const SellerSingleProduct = () => {
                                const { id } = useParams();
                                const { isLoading, singleProduct } = useAppSelector((state) => state.product);
                                const { availability } = useAppSelector((state) => state.productAvailability);
                                const dispatch = useAppDispatch();
                            Severity: Major
                            Found in src/pages/dashboard/seller/SellerSingleProduct.tsx - About 5 hrs to fix

                              Function AdminStat has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function AdminStat() {
                                  const dispatch = useAppDispatch();
                                  const data = useAppSelector((state) => state.adminStatsSlice);
                              
                                  useEffect(() => {
                              Severity: Major
                              Found in src/components/adminDashboard/AdminStat.tsx - About 5 hrs to fix

                                Function SellerProductsPage has 133 lines of code (exceeds 25 allowed). Consider refactoring.
                                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();
                                Severity: Major
                                Found in src/pages/dashboard/seller/SellerProductsPage.tsx - About 5 hrs to fix

                                  Function UpdateOrderModal has 118 lines of code (exceeds 25 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);
                                  Severity: Major
                                  Found in src/pages/dashboard/seller/Sales/UpdateOrderModal.tsx - About 4 hrs to fix

                                    Function Nav has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                                    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);
                                    Severity: Major
                                    Found in src/components/Nav.tsx - About 4 hrs to fix

                                      Function RegisterForm has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const RegisterForm = () => {
                                          const { showErrorMessage, showSuccessMessage } = useToast();
                                          const { show } = useHandleResize();
                                          const dispatch = useAppDispatch();
                                          const navigate = useNavigate();
                                      Severity: Major
                                      Found in src/components/auth/RegisterForm.tsx - About 4 hrs to fix

                                        Function Notification has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const Notification = () => {
                                            const dispatch = useAppDispatch();
                                            const { accessToken } = useToken();
                                            const notificationPlayer = useRef<HTMLAudioElement>(null);
                                            const [notificationActive, setNotificationActive] = useState(false);
                                        Severity: Major
                                        Found in src/components/notification/Notification.tsx - About 4 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language