Showing 119 of 176 total issues
Function useFetchSearch
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
Open
export function useFetchSearch({
first,
total,
isFetchingData,
resetSearch,
- Read upRead up
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
Open
export default function (refetchPeriodically: boolean = false) {
const { accountId } = useAuth()
const { isTestnet, urlPrefix } = usePrefix()
const identityStore = useIdentityStore()
const fiatStore = useFiatStore()
Function default
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (fetchBalancePeriodically: boolean = false) {
const isError = ref<boolean>(false)
const txId = ref<string | null>(null)
const { isLoading, status, initTransactionLoader, stopLoader } =
Function default
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function ({
defaultFirst,
defaultScrollContainerId,
defaultScrollItemClassName,
gotoPage,
- Read upRead up
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 nuxt.config.ts
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { pwa } from './utils/config/pwa'
import { URLS, apolloClientConfig } from './utils/constants'
import * as fs from 'fs'
import svgLoader from 'vite-svg-loader'
Function useGalleryItem
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useGalleryItem = (nftId?: string): GalleryItem => {
const { $consola } = useNuxtApp()
const historyStore = useHistoryStore()
const nft = ref<NFT>()
const nftImage = ref('')
File useMigrate.ts
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import type { Prefix } from '@kodadot1/static'
import { availablePrefixWithIcon } 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'
Function useMetaTransaction
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function useMetaTransaction() {
const { $i18n } = useNuxtApp()
const {
isLoading,
resolveStatus,
usePreferencesStore
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
Open
actions: {
setSidebarFilterCollapse(payload) {
this.sidebarFilterCollapseOpen = payload
},
setMobileFilterCollapse(payload) {
File useDrops.ts
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { GetDropsQuery, getDropById, getDrops } from '@/services/fxart'
import unlockableCollectionById from '@/queries/subsquid/general/unlockableCollectionById.graphql'
import collectionByIdMinimal from '@/queries/subsquid/general/collectionByIdMinimal.graphql'
import { chainPropListOf } from '@/utils/config/chain.config'
import { DropItem } from '@/params/types'
usePreferencesStore
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
getters: {
getsidebarFilterCollapse: (state) => state.sidebarFilterCollapseOpen,
getMobileFilterCollapse: (state) => state.mobileFilterCollapseOpen,
getNotificationBoxCollapse: (state) => state.notificationBoxCollapseOpen,
getShoppingCartCollapse: (state) => state.shoppingCartCollapseOpen,
Function useMigrateDeposit
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useMigrateDeposit(
prefix: ComputedRef<Prefix>,
itemCount: number,
account = '',
) {
Function useTopCollections
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useTopCollections = (limit: number, immediate = true) => {
const { client, urlPrefix } = usePrefix()
const { isAssetHub, isBase } = useIsChain(urlPrefix)
const topCollectionWithVolumeList = useState<CollectionEntityWithVolumes[]>(
'topCollectionWithVolumeList',
Function useHolderOfCollection
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function useHolderOfCollection() {
const { drop, runtimeMintCount } = useDropStore()
const { accountId } = useAuth()
const { client } = usePrefix()
const { isNftClaimed } = useHolderOfCollectionDrop()
Function default
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (
actions: ComputedRef<AutoTeleportAction[]>,
neededAmount: ComputedRef<number>,
fees: AutoTeleportFeeParams,
) {
Function default
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function () {
const colorMode = useColorMode()
const { $i18n } = useNuxtApp()
const isDarkMode = computed<boolean>(() => colorMode.value === 'dark')
Function useEvents
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useEvents = (chain, type, limit = 10, collectionIds = []) => {
const collections = reactive({})
const items = ref<
(NFTWithMetadata & {
timestamp: string
File scheme.ts
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { CreatedNFT, toNFTId as toNFTIdV1 } from '@kodadot1/minimark/v1'
import {
CreatedNFT as CreatedNFTV2,
toNFTId as toNFTIdV2,
} from '@kodadot1/minimark/v2'
Function useExecuteTransaction
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useExecuteTransaction = (options: TransactionOptions) => {
const { accountId } = useAuth()
const error = ref(false)
const {
howAboutToExecute,
Function default
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function () {
const { urlPrefix } = usePrefix()
const name = computed(() => getChainName(urlPrefix.value))
const chainProperties = computed<ChainProperties>(() => {