atlp-rwanda/hackers-ec-Fe

View on GitHub

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);
Severity: Minor
Found in src/pages/ProductsPage.tsx - About 45 mins to fix

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();

Severity: Minor
Found in src/components/ProfileDropdown.tsx - About 35 mins to fix

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();

Severity: Minor
Found in src/components/wishes/AddToWish.tsx - About 35 mins to fix

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();
Severity: Minor
Found in src/pages/dashboard/seller/SellerProductsPage.tsx - About 25 mins to fix

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();
Severity: Minor
Found in src/pages/Contacts.tsx - About 25 mins to fix

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);
Severity: Minor
Found in src/components/ResetPassword/ResetPasswordForm.tsx - About 25 mins to fix

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');
Severity: Minor
Found in src/pages/auth/TwoFactor.tsx - About 25 mins to fix

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);
Severity: Minor
Found in src/pages/dashboard/seller/SellerDashboard.tsx - About 25 mins to fix

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

Severity
Category
Status
Source
Language