Showing 177 of 177 total issues
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) => {
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')
- 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 useMigrateDeposit
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function useMigrateDeposit(
prefix: ComputedRef<Prefix>,
itemCount: number,
account = '',
) {
- 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 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 = (
- 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 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 }[]
}
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()
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const availablePrefixWithIcon = () => {
return availablePrefixes().map((chain) => {
return {
...chain,
icon: chainIcons[chain.value] || '',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function useMakingOfferStore
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useMakingOfferStore = defineStore('makingOffer', () => {
const {
items,
chain,
count,
Function massGenerate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const massGenerate = async () => {
try {
clearMassMint()
if (isSub.value) {
await populateTokenIds()
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const allPrefixWithIcon = () => {
return allPrefixes().map((chain) => {
return {
...chain,
icon: chainIcons[chain.value] || '',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
export async function execAcceptOfferTx(item: ActionAcceptOffer, api, executeTransaction) {
if (item.urlPrefix === 'ahk' || item.urlPrefix === 'ahp') {
await execAcceptOffer(item, api, executeTransaction)
}
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
export async function execMakingOfferTx(item: ActionOffer, api, executeTransaction) {
if (item.urlPrefix === 'ahk' || item.urlPrefix === 'ahp') {
await execMakingOffer(item, api, executeTransaction)
}
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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()
Function payRoyaltyAssetHub
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function payRoyaltyAssetHub(
legacy,
api,
price,
royalty,
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) {
Function execBuyStatemine
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function execBuyStatemine(item: ActionBuy, api, executeTransaction) {
const nfts = Array.isArray(item.nfts) ? item.nfts : [item.nfts]
const transactions = await Promise.all(
nfts.map(async ({ id: nftId, price, royalty }) => {
const legacy = isLegacy(nftId)
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,
Function resolveMedia
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const resolveMedia = (mimeType?: string): MediaType => {
if (!mimeType) {
return MediaType.UNKNOWN
}
Function formatNumber
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function formatNumber(amount?: string | number): string {
if (!amount) {
return '0'
}
const number
Similar blocks of code found in 3 locations. Consider refactoring. Open
executeTransaction({
cb: api.tx.utility.batchAll,
arg: [transactions.flat()],
successMessage: item.successMessage,
errorMessage: item.errorMessage,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 57.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76