kodadot/nft-gallery

View on GitHub

Showing 120 of 177 total issues

Function useMetaTransaction has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function useMetaTransaction() {
  const { $i18n } = useNuxtApp()
  const {
    isLoading,
    resolveStatus,
Severity: Minor
Found in composables/useMetaTransaction.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

File profile.ts has 258 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type { FetchError } from 'ofetch'
import { $fetch } from 'ofetch'
import { isEthereumAddress } from '@polkadot/util-crypto'
import { isProduction } from '@/utils/env'

Severity: Minor
Found in services/profile.ts - About 2 hrs to fix

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

    export default function () {
      const { urlPrefix } = usePrefix()
      const identityStore = useIdentityStore()
    
      const getBalance = (_token: string) => {
    Severity: Major
    Found in composables/useBalance.ts - About 2 hrs to fix

      Function kusamaMintAndList has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const kusamaMintAndList = (tokens) => {
        const status = ref(TransactionStatus.Unknown)
        const isLoading = ref(true)
        const collectionUpdated = ref(false)
        const blockNumber = ref<string>()
      Severity: Minor
      Found in composables/massmint/massMintHelpers.ts - About 2 hrs to fix

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

        export default function () {
          const route = useRoute()
        
          const fullPathShare = ref(`${window.location.origin}${route.fullPath}`)
        
        
        Severity: Minor
        Found in composables/useSocialShare.ts - About 1 hr to fix

          Function default has a Cognitive Complexity of 15 (exceeds 5 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: Minor
          Found in composables/useTeleport.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 getDropAttributes has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export async function getDropAttributes(alias: string): Promise<DropItem | undefined> {
            // get some offchain data
            // ----------------------
            const campaign = await getDropById(alias)
            const offChainData = {
          Severity: Minor
          Found in components/drops/utils.ts - About 1 hr to fix

            Function useWaitingItems has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const useWaitingItems = () => {
              const { urlPrefix } = usePrefix()
              const { accountId } = useAuth()
              const { client } = usePrefix()
            
            
            Severity: Minor
            Found in composables/useMigrate.ts - About 1 hr to fix

              Function checkZipFileValidity has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              async function checkZipFileValidity(entries: {
                [key: string]: ZipEntry
              }): Promise<ValidityResult> {
                const validFiles: FileObject[] = []
                const warnings: WarningObject[] = []
              Severity: Minor
              Found in composables/massmint/useZipValidator.ts - About 1 hr to fix

                Function bindGoToEvents has 43 lines of code (exceeds 25 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

                  Function open has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    open(params): InstanceType<typeof NotificationNotice> {
                      // vue context from nuxtApp()
                      const { vueApp } = useNuxtApp()
                  
                      let newParams
                  Severity: Minor
                  Found in libs/ui/src/components/NeoNotification/plugin.ts - About 1 hr to fix

                    Function useTransactionStatus has 41 lines of code (exceeds 25 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

                      Function getFlippers has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const getFlippers = (interactions: InteractionWithNFT[]): Flippers => {
                        const { NFTS, changeHandsInteractions }
                          = preProccessForFindingFlippers(interactions)
                      
                        // Create an object that will hold all the flipper data
                      Severity: Minor
                      Found in composables/collectionActivity/helpers.ts - About 1 hr to fix

                        Function constructMeta has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export async function constructMeta(
                          tokenToMint: TokenToMint,
                          options?: {
                            enableCarbonOffset?: boolean
                          },
                        Severity: Minor
                        Found in composables/transaction/mintToken/constructMeta.ts - About 1 hr to fix

                          Function checkZipFileValidity has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                          async function checkZipFileValidity(entries: {
                            [key: string]: ZipEntry
                          }): Promise<ValidityResult> {
                            const validFiles: FileObject[] = []
                            const warnings: WarningObject[] = []
                          Severity: Minor
                          Found in composables/massmint/useZipValidator.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 default has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function () {
                            const storage = useLocalStorage('urlPrefix', { selected: DEFAULT_PREFIX })
                            const walletStore = useWalletStore()
                          
                            const prefix = computed<Prefix>(
                          Severity: Minor
                          Found in composables/usePrefix.ts - About 1 hr to fix

                            Function getOwners has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const getOwners = (nfts) => {
                              const owners: Owners = {}
                            
                              nfts.forEach((nft) => {
                                const interactions = nft.events.map(e => e.interaction)
                            Severity: Minor
                            Found in composables/collectionActivity/helpers.ts - About 1 hr to fix

                              Function useRamp has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function useRamp() {
                                const config = useRuntimeConfig()
                                const { $consola } = useNuxtApp()
                                const { urlPrefix } = usePrefix()
                              
                              
                              Severity: Minor
                              Found in composables/useRamp.ts - About 1 hr to fix

                                Function open has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  open(params): InstanceType<typeof Modal> {
                                    // vue context from nuxtApp()
                                    const { vueApp } = useNuxtApp()
                                
                                    let newParams
                                Severity: Minor
                                Found in libs/ui/src/components/NeoModalExtend/plugin.ts - About 1 hr to fix

                                  Function parseJson has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function parseJson(jsonData: string): Record<string, Entry> {
                                    const { $consola } = useNuxtApp()
                                  
                                    try {
                                      const data = JSON.parse(jsonData)
                                  Severity: Minor
                                  Found in composables/massmint/parsers/parseJson.ts - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language