kodadot/nft-gallery

View on GitHub

Showing 166 of 166 total issues

Function useFetchSearch has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

export function useFetchSearch({
first,
total,
isFetchingData,
resetSearch,
Severity: Minor
Found in components/items/ItemsGrid/useItemsGrid.ts - About 7 hrs to fix

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

export const useGalleryItem = (nftId?: string): GalleryItem => {
const { $consola } = useNuxtApp()
const historyStore = useHistoryStore()
const nft = ref<NftEntity>()
const nftImage = ref('')
Severity: Major
Found in components/gallery/useGalleryItem.ts - About 5 hrs to fix

    Function default has 124 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function (fetchBalancePeriodically: boolean = false) {
    const isError = ref<boolean>(false)
    const txId = ref<string | null>(null)
     
    const { isLoading, status, initTransactionLoader, stopLoader }
    Severity: Major
    Found in composables/useTeleport.ts - About 4 hrs to fix

      File nuxt.config.ts has 368 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import * as fs from 'fs'
      import svgLoader from 'vite-svg-loader'
      import { pwa } from './utils/config/pwa'
      import { URLS, apolloClientConfig } from './utils/constants'
       
       
      Severity: Minor
      Found in nuxt.config.ts - About 4 hrs to fix

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

        export default function ({
        defaultFirst,
        defaultScrollContainerId,
        defaultScrollItemClassName,
        gotoPage,
        Severity: Minor
        Found in composables/useListInfiniteScroll.ts - About 4 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export const uniqueParamResolver = (
        id: string,
        selectedAction: string,
        meta: string | number,
        ): any[] => {
        Severity: Major
        Found in utils/gallery/abstractCalls.ts and 1 other location - About 3 hrs to fix
        utils/gallery/abstractCalls.ts on lines 50..64

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export const nftParamResolver = (
        id: string,
        selectedAction: string,
        meta: string | number,
        ): any[] => {
        Severity: Major
        Found in utils/gallery/abstractCalls.ts and 1 other location - About 3 hrs to fix
        utils/gallery/abstractCalls.ts on lines 34..48

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export const follow = async (followRequest: FollowRequest) => {
        try {
        const response = await api<ProfileResponse>('/follow', {
        method: 'POST',
        body: convertToSubstrateAddress(followRequest),
        Severity: Major
        Found in services/profile.ts and 1 other location - About 3 hrs to fix
        services/profile.ts on lines 221..234

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export const unfollow = async (unFollowRequest: FollowRequest) => {
        try {
        const response = await api<ProfileResponse>('/follow', {
        method: 'DELETE',
        body: convertToSubstrateAddress(unFollowRequest),
        Severity: Major
        Found in services/profile.ts and 1 other location - About 3 hrs to fix
        services/profile.ts on lines 206..219

        Function useMetaTransaction has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function useMetaTransaction() {
        const { $i18n } = useNuxtApp()
        const {
        isLoading,
        resolveStatus,
        Severity: Major
        Found in composables/useMetaTransaction.ts - About 3 hrs to fix

          usePreferencesStore has 29 functions (exceeds 20 allowed). Consider refactoring.
          Open

          actions: {
          setSidebarFilterCollapse(payload) {
          this.sidebarFilterCollapseOpen = payload
          },
          setMobileFilterCollapse(payload) {
          Severity: Minor
          Found in stores/preferences.ts - About 3 hrs to fix

            Function useListingCartStore has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const useListingCartStore = defineStore('listingCart', () => {
            const {
            items,
            chain,
            decimals,
            Severity: Major
            Found in stores/listingCart.ts - About 3 hrs to fix

              File types.ts has 303 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import type { OpenSeaAttribute as Attribute } from '@kodadot1/hyperdata'
              import type { ApiPromise } from '@polkadot/api'
              import type { Prefix } from '@kodadot1/static'
              import type { Ref } from 'vue'
              import type { Abi as ViemAbi } from 'viem'
              Severity: Minor
              Found in composables/transaction/types.ts - About 3 hrs to fix

                Function useTopCollections has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const useTopCollections = (limit: number, immediate = true) => {
                const { client, urlPrefix } = usePrefix()
                const { isAssetHub, isBase } = useIsChain(urlPrefix)
                const topCollectionWithVolumeList = useState<CollectionEntityWithVolumes[]>(
                'topCollectionWithVolumeList',
                Severity: Major
                Found in components/landing/topCollections/utils/useTopCollections.ts - About 2 hrs to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  koda: {
                  pinata: 'https://kodadot.mypinata.cloud/ipfs/',
                  directUpload: 'https://direct-upload.kodadot.workers.dev/',
                  estuary: 'https://pinning.kodadot.workers.dev/',
                  nftStorage: 'https://ipos.kodadot.workers.dev/',
                  Severity: Major
                  Found in utils/constants.ts and 1 other location - About 2 hrs to fix
                  libs/static/src/mimeTypes.ts on lines 1..20

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  export const mimeTypes: { [key: string]: string } = {
                  bmp: 'image/bmp',
                  gif: 'image/gif',
                  jpg: 'image/jpeg',
                  jpeg: 'image/jpeg',
                  Severity: Major
                  Found in libs/static/src/mimeTypes.ts and 1 other location - About 2 hrs to fix
                  utils/constants.ts on lines 34..53

                  usePreferencesStore has 25 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  getters: {
                  getsidebarFilterCollapse: state => state.sidebarFilterCollapseOpen,
                  getMobileFilterCollapse: state => state.mobileFilterCollapseOpen,
                  getShoppingCartCollapse: state => state.shoppingCartCollapseOpen,
                  getCompletePurchaseModal: state => state.completePurchaseModal,
                  Severity: Minor
                  Found in stores/preferences.ts - About 2 hrs to fix

                    Function useHolderOfCollection has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function useHolderOfCollection() {
                    const { drop, runtimeMintCount } = useDropStore()
                    const { accountId } = useAuth()
                    const { client } = usePrefix()
                    const { isNftClaimed } = useHolderOfCollectionDrop()
                    Severity: Major
                    Found in composables/drop/useHolderOfCollection.ts - About 2 hrs to fix

                      Function default has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function () {
                      const colorMode = useColorMode()
                      const { $i18n } = useNuxtApp()
                       
                      const isDarkMode = computed<boolean>(() => colorMode.value === 'dark')
                      Severity: Major
                      Found in composables/useTheme.ts - About 2 hrs to fix

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        async function execCancelOfferAssetHub(item: ActionCancelOffer, api: ApiPromise, executeTransaction) {
                        executeTransaction({
                        cb: api.tx.nfts.cancelSwap,
                        arg: [getOfferCollectionId(item.urlPrefix), Number(item.offeredId)],
                        successMessage: item.successMessage,
                        Severity: Major
                        Found in composables/transaction/transactionOfferCancel.ts and 1 other location - About 2 hrs to fix
                        composables/transaction/transactionSwapCancel.ts on lines 4..11
                        Severity
                        Category
                        Status
                        Source
                        Language