kodadot/nft-gallery

View on GitHub

Showing 120 of 177 total issues

Function useGalleryItem has 137 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

    File nuxt.config.ts has 379 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 5 hrs to fix

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

      export function useFetchSearch({
        first,
        total,
        isFetchingData,
        resetSearch,
      Severity: Minor
      Found in components/items/ItemsGrid/useItemsGrid.ts - About 5 hrs 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 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

        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

        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

        File useMigrate.ts has 331 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import type { Prefix } from '@kodadot1/static'
        import { allPrefixWithIcon } from '@/utils/chain'
        import format from '@/utils/format/balance'
        import collectionMigrateReady from '@/queries/subsquid/general/collectionMigrateReady.graphql'
        import collectionMigrateWaiting from '@/queries/subsquid/general/collectionMigrateWaiting.graphql'
        Severity: Minor
        Found in composables/useMigrate.ts - About 3 hrs to fix

          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 298 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

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

                  export function useMigrateDeposit(
                    prefix: ComputedRef<Prefix>,
                    itemCount: number,
                    account = '',
                  ) {
                  Severity: Major
                  Found in composables/useMigrate.ts - About 2 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

                      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

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

                            export default function (
                              actions: ComputedRef<AutoTeleportAction[]>,
                              neededAmount: ComputedRef<number>,
                              fees: AutoTeleportFeeParams,
                            ) {
                            Severity: Major
                            Found in composables/autoTeleport/useAutoTeleport.ts - About 2 hrs to fix

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

                              export default function ({
                                clientName = '',
                                query,
                                onChange,
                                onError,
                              Severity: Minor
                              Found in composables/useSubscriptionGraphql.ts - About 2 hrs 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 useEvents has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const useEvents = (chain, type, limit = 10, collectionIds = []) => {
                                const collections = reactive({})
                                const items = ref<
                                  (NFTWithMetadata & {
                                    timestamp: string
                              Severity: Major
                              Found in components/carousel/utils/useCarouselEvents.ts - About 2 hrs to fix

                                Function useGalleryItem has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export const useGalleryItem = (nftId?: string): GalleryItem => {
                                  const { $consola } = useNuxtApp()
                                  const historyStore = useHistoryStore()
                                  const nft = ref<NftEntity>()
                                  const nftImage = ref('')
                                Severity: Minor
                                Found in components/gallery/useGalleryItem.ts - About 2 hrs 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 useIcon has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export const useIcon = () => {
                                  const { isDarkMode } = useTheme()
                                
                                  const signUpVoucherIcon = computed(() =>
                                    isDarkMode.value ? '/signup-voucher-dark.svg' : '/signup-voucher.svg',
                                Severity: Minor
                                Found in composables/useIcon.ts - About 2 hrs 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