kodadot/nft-gallery

View on GitHub

Showing 120 of 177 total issues

Function bindGoToEvents has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

const bindGoToEvents = (event, app) => {
  const { accountId } = useAuth()
  const { urlPrefix } = usePrefix()

  let path = ''
Severity: Minor
Found in plugins/keyboardEvents.client.ts - About 1 hr 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 useDropMinimumFunds has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useDropMinimumFunds = (amount = ref(1)) => {
  const { drop } = useDrop()
  const { urlPrefix } = usePrefix()
  const { itemDeposit } = useDeposit(urlPrefix)

Severity: Minor
Found in components/drops/useDrops.ts - About 1 hr to fix

    Function resolveMedia has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function resolveMedia(mimeType?: string): MediaType {
      if (!mimeType) {
        return MediaType.UNKNOWN
      }
    
    
    Severity: Minor
    Found in utils/gallery/media.ts - About 1 hr to fix

      Function proccessData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const proccessData = (
        collectionsList: CollectionEntity[],
        collectionsSales: CollectionSales[],
      ) => {
        return Promise.all(
      Severity: Minor
      Found in components/landing/topCollections/utils/useTopCollections.ts - About 1 hr to fix

        Function useReadyItems has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const useReadyItems = () => {
          const { urlPrefix } = usePrefix()
        
          const collections = ref<CollectionsReady['collectionEntities']>([])
          const entities = reactive({})
        Severity: Minor
        Found in composables/useMigrate.ts - About 1 hr to fix

          Function execMakingOffer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          async function execMakingOffer(item: ActionOffer, api, executeTransaction) {
            const { accountId } = useAuth()
            const nfts = Array.isArray(item.token) ? item.token : [item.token]
            const transactions = await Promise.all(
              nfts.map(async ({ price, nftSn, collectionId, duration }) => {
          Severity: Minor
          Found in composables/transaction/transactionOffer.ts - About 1 hr to fix

            Function useCarouselGenerativeNftEvents has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const useCarouselGenerativeNftEvents = () => {
              const nfts = ref<CarouselNFT[]>([])
              const eventType = ['newestList', 'latestSales']
              const dropsAhp = computedAsync(async () => {
                return await getDrops({
            Severity: Minor
            Found in components/carousel/utils/useCarouselEvents.ts - About 1 hr to fix

              Function getListForSellItems has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const getListForSellItems = (
                createdNFTs: CreatedNFT[],
                tokens: TokenToMint[],
                blockNumber: string,
              ) => {
              Severity: Minor
              Found in composables/massmint/massMintHelpers.ts - About 1 hr to fix

                Function useTransak has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function useTransak() {
                  const config = useRuntimeConfig()
                  const { urlPrefix } = usePrefix()
                
                  const getChainConfig = (prefix: Prefix) => {
                Severity: Minor
                Found in composables/useTransak.ts - About 1 hr to fix

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

                  export default function () {
                    const colorMode = useColorMode()
                    const { $i18n } = useNuxtApp()
                  
                    const isDarkMode = computed<boolean>(() => colorMode.value === 'dark')
                  Severity: Minor
                  Found in composables/useTheme.ts - About 1 hr 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 useMigrateDeposit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function useMigrateDeposit(
                    prefix: ComputedRef<Prefix>,
                    itemCount: number,
                    account = '',
                  ) {
                  Severity: Minor
                  Found in composables/useMigrate.ts - About 1 hr 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 useTransactionStatus has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function useTransactionStatus() {
                    const status = ref<TransactionStatus>(TransactionStatus.Unknown)
                    const isLoading = ref(false)
                  
                    const resolveStatus = (
                  Severity: Minor
                  Found in composables/useTransactionStatus.ts - About 1 hr 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 useCollectionForMint has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const useCollectionForMint = () => {
                    const collections = ref<MintedCollection[]>()
                    const { accountId } = useAuth()
                    const { urlPrefix } = usePrefix()
                  
                  
                  Severity: Minor
                  Found in composables/massmint/useMassMint.ts - About 1 hr to fix

                    Function constructNfts has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const constructNfts = async () => {
                        const events = (
                          data.value as {
                            events: { meta: string, nft: NFTWithMetadata, timestamp: string }[]
                          }
                    Severity: Minor
                    Found in components/carousel/utils/useCarouselEvents.ts - About 1 hr to fix

                      Function massGenerate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const massGenerate = async () => {
                          try {
                            clearMassMint()
                            if (isSub.value) {
                              await populateTokenIds()
                      Severity: Minor
                      Found in composables/drop/massmint/useDropMassMint.ts - About 1 hr to fix

                        Function useMakingOfferStore has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const useMakingOfferStore = defineStore('makingOffer', () => {
                          const {
                            items,
                            chain,
                            count,
                        Severity: Minor
                        Found in stores/makeOffer.ts - About 1 hr to fix

                          Function listForSell has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const listForSell = (mintedNFts: TokenToList[]) => {
                            const isLoading = ref(true)
                            const {
                              blockNumber,
                              transaction,
                          Severity: Minor
                          Found in composables/massmint/massMintHelpers.ts - About 1 hr to fix

                            Function formatNFT has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const formatNFT = (nfts, chain?: string): CarouselNFT[] => {
                              if (!nfts) {
                                return []
                              }
                              const { urlPrefix } = usePrefix()
                            Severity: Minor
                            Found in utils/carousel.ts - About 1 hr to fix

                              Function payRoyaltyAssetHub has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              async function payRoyaltyAssetHub(
                                legacy,
                                api,
                                price,
                                royalty,
                              Severity: Minor
                              Found in composables/transaction/transactionBuy.ts - About 1 hr to fix

                                Function getOdaToken has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  const getOdaToken = async () => {
                                    const getMetadata = await fetchOdaToken(urlPrefix.value, collectionId, tokenId)
                                    const metadata = getMetadata.metadata
                                
                                    if (!metadata) {
                                Severity: Minor
                                Found in components/gallery/useGalleryItem.ts - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language