Showing 88 of 262 total issues
Function LogoutCard
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LogoutCard = () => {
const dispatch = useAppDispatch();
const { isLoading } = useAppSelector((state) => state.logout);
const { showErrorMessage, showWorningMessage } = useToast();
Function LandingProduct
has a Cognitive Complexity of 12 (exceeds 5 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);
- 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 LoginForm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const LoginForm = () => {
const { isLoading } = useAppSelector((state) => state.login);
const { showErrorMessage, showSuccessMessage } = useToast();
const { saveAccessToken } = useToken();
const { show } = useHandleResize();
- 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 ReviewForm
has a Cognitive Complexity of 12 (exceeds 5 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();
- 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 AddEditProductForm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const AddEditProductForm = () => {
const location = useLocation();
const navigate = useNavigate();
const dispatch = useAppDispatch();
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 UserProfileSideBox
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function UserProfileSideBox() {
const location = useLocation();
const [active, setActive] = useState(location.pathname);
const handleClick = (path: string) => {
Function GetUser
has a Cognitive Complexity of 11 (exceeds 5 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]);
- 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 DeleteProduct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const DeleteProduct = ({ item }: DeleteModalProps) => {
const { isLoading: processing } = useAppSelector(
(state) => state.deleteProduct,
);
- 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 CategoriesForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const CategoriesForm: React.FC<CategoriesFormProps> = ({
categoryData,
onClose,
}) => {
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 PaymentSuccess
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PaymentSuccess() {
const [searchParams] = useSearchParams();
const sessionId = searchParams.get('sessionId')!;
const payerId = searchParams.get('payerId')!;
const dispatch = useAppDispatch();
Function onSubmit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit: SubmitHandler<UpdateOrderFormValues> = async (data) => {
try {
const resultAction = await dispatch(
updateOrder({
id: selectedSaleId ?? '',
Function HandleGoogleLogin
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const HandleGoogleLogin = () => {
const [searchParams] = useSearchParams();
const token = searchParams.get('token');
const message = searchParams.get('message');
const { saveAccessToken } = useToken();
Function ChatRedirections
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChatRedirections = () => {
return (
<AnimatePresence>
<motion.div
className="parent fixed inset-0 w-full h-full bg-neutr backdrop-blur-sm z-30
Function onSubmit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit: SubmitHandler<reviewFormSchemaType> = async (
data: reviewFormSchemaType,
) => {
try {
const { ratings, feedBack } = data;
Function onSubmit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit: SubmitHandler<queryTypes> = async (formData: queryTypes) => {
try {
const data = await dispatch(
sendQuery({
lastName: formData.lastName,
Function PreventSeller
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const PreventSeller = ({ roles }: { roles: Array<string> }) => {
const navigate = useNavigate();
const { showErrorMessage } = useToast();
const decoded = fetchInfo() as UserInfoTypes;
const [isAuthorized, setIsAuthorized] = useState(false);
- 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 CartQuantity
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const CartQuantity = ({ productId }: CartQuantityProps) => {
const { showErrorMessage } = useToast();
const dispatch = useAppDispatch();
const { carts } = useAppSelector((state) => state.cart);
const [quantity, setQuantity] = useState<number>(0);
- 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 NotificationItem
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const NotificationItem = ({
text,
date,
unread,
id,
- 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 Notification
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Notification = () => {
const dispatch = useAppDispatch();
const { accessToken } = useToken();
const notificationPlayer = useRef<HTMLAudioElement>(null);
const [notificationActive, setNotificationActive] = useState(false);
- 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 SellerSingleProduct
has a Cognitive Complexity of 8 (exceeds 5 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();
- 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"