Showing 1,971 of 13,422 total issues
Function events
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
events: async (
_: any,
{ first = 10, after, filter }: { first?: any; after?: any; filter?: any }
) => {
let query = db
- 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 formatSlippageToString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const formatSlippageToString = (slippageSelected, slippageCustom) => {
if (slippageSelected === Slippages.Custom && !!slippageCustom) {
return formatUnits(slippageCustom.valueSafe, slippageCustom?.precision)
} else if (slippageSelected === Slippages.OneTenth) {
return formatUnits(BigNumber.from(100), 3)
- 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 setDestinationToken
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
setDestinationToken: (
state: BridgeState,
action: PayloadAction<BridgeableToken>
) => {
const incomingToToken = action.payload
- 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 setDestinationChainId
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
setDestinationChainId: (
state: BridgeState,
action: PayloadAction<number>
) => {
const incomingToChainId = action.payload
- 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 useExchangeRateInfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const useExchangeRateInfo = (value, exchangeRate) => {
const safeExchangeRate = typeof exchangeRate === 'bigint' ? exchangeRate : 0n
const safeFromAmount = value ?? '0'
const formattedExchangeRate = formatBigIntToString(safeExchangeRate, 18, 4)
- 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 useEventCountdownProgressBar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useEventCountdownProgressBar = (
eventLabel: string,
startDate: Date,
endDate: Date | null,
hideProgress?: boolean
- 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 ImageUploader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function ImageUploader() {
const [uploadedImage, setUploadedImage] = useState(null)
const [processedImage, setProcessedImage] = useState(null)
const t = useTranslations('ReturnToMonke')
- 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 ApyDisplay
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ApyDisplay = ({ pool, poolApyData }) => {
const apy =
poolApyData.fullCompoundedAPY > 10000
? 10000
: poolApyData.fullCompoundedAPY
- 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 AvailableBalance
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const AvailableBalance = ({
connectedAddress,
setInputAmount,
}: {
connectedAddress: string
- 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 PoolHeader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
({ pool, address }: { pool: Token; address: Address }) => {
const [mounted, setMounted] = useState(false)
const { chain: connectedChain } = useAccount()
const chain = CHAINS_BY_ID[pool.chainId]
const { balances } = usePortfolioState()
- 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 PoolInfoSection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const PoolInfoSection = () => {
const { pool, poolData, isLoading } = usePoolDataState()
const t = useTranslations('Pools.Other')
- 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 Col
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function Col({
children,
xs,
sm,
md,
- 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 SwapExchangeRateInfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const SwapExchangeRateInfo = ({
fromAmount,
toToken,
exchangeRate,
toChainId,
- 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 useMaintenance
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useMaintenance = () => {
const { pausedChainsList, pausedModulesList } = useMaintenanceData()
const { fromChainId: bridgeFromChainId, toChainId: bridgeToChainId } =
useBridgeState()
const { swapChainId } = useSwapState()
- 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 TimeRemaining
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const TimeRemaining = ({
isComplete,
remainingTime,
isDelayed,
delayedTime,
- 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
Avoid too many return
statements within this function. Open
return Intl.NumberFormat(locales, {
minimumFractionDigits: standardDigits,
}).format(floatAmount)
Avoid too many return
statements within this function. Open
return Intl.NumberFormat(locales, {
minimumSignificantDigits: standardDigits,
maximumSignificantDigits: standardDigits,
}).format(floatAmount)
Avoid too many return
statements within this function. Open
return EXISTING_BRIDGE_ROUTES[`${fromTokenRouteSymbol}-${fromChainId}`]
Avoid too many return
statements within this function. Open
return _(EXISTING_BRIDGE_ROUTES)
.pickBy((values, _key) => {
return _.includes(values, `${toTokenRouteSymbol}-${toChainId}`)
})
.keys()
Avoid too many return
statements within this function. Open
return _(EXISTING_BRIDGE_ROUTES)
.entries()
.filter(([key, _values]) => key.startsWith(`${fromTokenRouteSymbol}-`))
.filter(([_key, values]) =>
values.some((v) => getTokenAndChainId(v).chainId === toChainId)