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,
- 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 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'
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) => {
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>()
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}`)
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 }
- 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 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 = {
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()
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[] = []
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 = ''
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
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 = (
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
Function constructMeta
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function constructMeta(
tokenToMint: TokenToMint,
options?: {
enableCarbonOffset?: boolean
},
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[] = []
- 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 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>(
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)
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()
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
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)