Showing 1,971 of 13,422 total issues
Method ScribeSuite.TestChainIndexerLivefill
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (s *ScribeSuite) TestChainIndexerLivefill() {
if os.Getenv("CI") != "" || !s.runVolumeTest {
s.T().Skip("This is a long running test")
}
const numberOfContracts = 5
- 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 setSwapChainId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
setSwapChainId: (state, action: PayloadAction<number>) => {
const incomingFromChainId = action.payload
const validFromTokens = _(
getSwapFromTokens({
- 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 checksumAddress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const checksumAddress = (address, chainId = null) => {
if (typeof address !== 'string') {
return ''
}
- 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 isTransactionReceiptError
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const isTransactionReceiptError = (error: unknown): boolean => {
if (error instanceof WaitForTransactionReceiptTimeoutError) {
return true
}
- 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 saveNewDeployment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const saveNewDeployment = (chainName, contractAlias, potentialReceipts) => {
// No-op if artifact has already been saved
const deploymentFN = getDeploymentFN(chainName, contractAlias)
if (fs.existsSync(deploymentFN)) {
logInfo(`Deployment artifact already exists for ${contractAlias}`)
- 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 mode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const mode = (arr) => {
const mode = {}
let max = 0
let count = 0
- 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 __resolveType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
__resolveType(obj: any) {
// Implement logic to determine the event type based on the object properties
// For example:
if ('sender' in obj) {
return 'BridgeRequestEvent'
- 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 getTokenSymbol
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getTokenSymbol = async (chainId, token) => {
// Check if token is ETH
if (token === ETH) {
const swapQuoter = await getSwapQuoter(chainId)
if (!swapQuoter) {
- 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 getRequestStatus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getRequestStatus = (chainName, actionName, guid) => {
const verifier = readEnv(chainName, 'VERIFIER')
if (verifier !== VERIFIER_ETHERSCAN) {
logError(`Verifier ${verifier} is not supported by this command`)
return null
- 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 useConfirmNewBridgePrice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useConfirmNewBridgePrice = () => {
const triggerQuoteRef = useRef<BridgeQuote | null>(null)
const bpsThreshold = 0.0001 // 1bps
const [hasQuoteOutputChanged, setHasQuoteOutputChanged] =
- 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 useStaleQuoteUpdater
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const useStaleQuoteUpdater = (
quote: BridgeQuote,
refreshQuoteCallback: () => Promise<void>,
enabled: boolean,
staleTimeout: number = 15000, // in ms
- 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 tokenSymbolToToken
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const tokenSymbolToToken = (chainId: number, symbol: string) => {
if (chainId) {
if (symbol === 'ETH') {
return ETH
} else if (symbol === 'WETH') {
- 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 tokenAddressToToken
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const tokenAddressToToken = (
chainId: number,
tokenAddress: string
): Token | undefined => {
if (chainId) {
- 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 checkVersionAndResetCache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const checkVersionAndResetCache = (): boolean => {
if (typeof window !== 'undefined') {
const persistedStateRaw = localStorage.getItem(`persist:${storageKey}`)
if (persistedStateRaw) {
const persistedState = JSON.parse(persistedStateRaw)
- 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 Token
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const Token = () => {
const router = useRouter()
const { tokenAddress } = router.query
const search = useSearchParams()
const chain_id = Number(search.get('chainId')) || 1
- 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 fetchErc20TokenAllowance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const fetchErc20TokenAllowance = async ({
spenderAddress,
tokenAddress,
ownerAddress,
provider,
- 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 getSynapsePauseData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getSynapsePauseData = () => {
const fetchAndStoreData = async () => {
if (isFetching) {
return
}
- 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 getTokenDecimals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getTokenDecimals = (
chainId: number,
tokenAddress: string
): number => {
for (const [, token] of Object.entries(tokensList)) {
- 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 fetchBridgeQuote
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async ({
originChainId,
destinationChainId,
originToken,
destinationToken,
- 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 checksumAddresses
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const checksumAddresses = (addressFields: string[]) => {
return (req: Request, _res: Response, next: NextFunction) => {
for (const field of addressFields) {
const address = req.query[field]
if (typeof address === 'string' && isAddress(address)) {
- 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"