Showing 88 of 262 total issues
Function ProductsPage
has a Cognitive Complexity of 8 (exceeds 5 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);
- 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 ProfileDropdown
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ProfileDropdown = ({ image }: ProfileDropdownProps) => {
const [isOpen, setIsOpen] = useState(false);
const userData = fetchInfo();
- 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 AddToWish
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function AddToWish({ productId, btnCss }: AddToWishType) {
const { wished, setWished } = useCheckwished(productId);
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 SellerProductsPage
has a Cognitive Complexity of 6 (exceeds 5 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();
- 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 Contacts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Contacts = () => {
const { show } = useHandleResize();
const dispatch = useAppDispatch();
const { isLoading } = useAppSelector((state) => state.queries);
const { showSuccessMessage, showErrorMessage } = 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 ResetPasswordForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ResetPasswordForm = () => {
const [searchParams] = useSearchParams();
const token = searchParams.get('token');
const { isLoading } = useAppSelector((state) => state.resetPassword);
- 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 TwoFactorAuth
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const TwoFactorAuth = () => {
const navigate = useNavigate();
const [searchParams] = useSearchParams();
const token = searchParams.get('token');
- 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 SellerDashboard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const SellerDashboard = () => {
const dispatch = useAppDispatch();
const { show } = useHandleResize();
const [VALUES, setVALUES] = useState(initialValues);
const { isLoading, allSalesData } = useAppSelector((state) => state.sales);
- 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"