kodadot/nft-gallery

View on GitHub
composables/useChainRedirect.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 4 of 4 total issues

Function getRedirectPathForPrefix has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function getRedirectPathForPrefix({
routeName,
chain,
route,
}: {
Severity: Minor
Found in composables/useChainRedirect.ts - About 1 hr to fix

Function default has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export default function () {
const route = useRoute()
const router = useRouter()
 
const redirectAfterChainChange = (newChain: Prefix): void => {
Severity: Minor
Found in composables/useChainRedirect.ts - About 35 mins to fix

Avoid too many return statements within this function.
Open

return {
params: {
prefix: chain,
},
query: finalQuery,
Severity: Major
Found in composables/useChainRedirect.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

    return {
    params: {
    prefix: chain,
    },
    query: route.query,
    Severity: Major
    Found in composables/useChainRedirect.ts - About 30 mins to fix

      There are no issues that match your filters.

      Category
      Status