Showing 1,971 of 13,422 total issues
Method DBSuite.TestStoreRetrieveReceipt
has 87 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (t *DBSuite) TestStoreRetrieveReceipt() {
t.RunOnAllDBs(func(testDB db.EventDB) {
txHashRandom := gofakeit.Int64()
chainID := gofakeit.Uint32()
txHashA := common.BigToHash(big.NewInt(txHashRandom))
Function useValidations
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useValidations = (): {
hasValidSelections: boolean
hasEnoughBalance: boolean
isInputValid: boolean
isApproved: boolean
Method txSubmitterImpl.processQueue
has 86 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (t *txSubmitterImpl) processQueue(parentCtx context.Context) (err error) {
// TODO: this might be too short of a deadline depending on the number of pendingTxes in the queue
deadlineCtx, cancel := context.WithTimeout(parentCtx, time.Second*60)
defer cancel()
Method APISuite.TestGetCountByChainID
has 86 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (g APISuite) TestGetCountByChainID() {
chainID := g.chainIDs[0]
chainID2 := g.chainIDs[1]
chainID3 := g.chainIDs[2]
address := common.BigToAddress(big.NewInt(gofakeit.Int64()))
Method IndexerSuite.TestGetLogsSimulated
has 86 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (x *IndexerSuite) TestGetLogsSimulated() {
// Get simulated blockchain, deploy the test contract, and set up test variables.
simulatedChain := geth.NewEmbeddedBackendForChainID(x.GetSuiteContext(), x.T(), big.NewInt(3))
simulatedClient, err := backend.DialBackend(x.GetTestContext(), simulatedChain.RPCAddress(), x.metrics)
Nil(x.T(), err)
File getFromChainIds.ts
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash'
import { EXISTING_BRIDGE_ROUTES } from '@/constants/existingBridgeRoutes'
import { RouteQueryFields } from './generateRoutePossibilities'
import { getTokenAndChainId } from './getTokenAndChainId'
File getFromChainIds.ts
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash'
import { EXISTING_BRIDGE_ROUTES } from '@/constants/existingBridgeRoutes'
import { RouteQueryFields } from './generateRoutePossibilities'
import { getTokenAndChainId } from './getTokenAndChainId'
File FauxBridge.tsx
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
// import PulseDot from '@/components/icons/PulseDot'
import { useTranslations } from 'next-intl'
import { CHAINS_ARR } from '@/constants/chains'
import * as BRIDGEABLE from '@constants/tokens/bridgeable'
Function GetDeployments
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
func GetDeployments(deploymentDir string) (contracts []Contract, err error) {
var files []os.DirEntry
files, err = os.ReadDir(deploymentDir)
if err != nil {
- 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
Method executionContext.field_Query_logsAtHeadRange_args
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_logsAtHeadRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["contract_address"]; ok {
- 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
Method executionContext.field_Query_logsAtHeadRange_args
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
func (ec *executionContext) field_Query_logsAtHeadRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["contract_address"]; ok {
- 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 getFromTokens
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getFromTokens = ({
fromChainId,
fromTokenRouteSymbol,
toChainId,
toTokenRouteSymbol,
- 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 getToTokens
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getToTokens = ({
fromChainId,
fromTokenRouteSymbol,
toChainId,
toTokenRouteSymbol,
- 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 getFromChainIds
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getFromChainIds = ({
fromChainId,
fromTokenRouteSymbol,
toChainId,
toTokenRouteSymbol,
- 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 getToChainIds
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getToChainIds = ({
fromChainId,
fromTokenRouteSymbol,
toChainId,
toTokenRouteSymbol,
- 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 getSwapToTokens
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getSwapToTokens = ({
fromChainId,
fromTokenRouteSymbol,
toChainId,
toTokenRouteSymbol,
- 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 getSwapFromChainIds
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getSwapFromChainIds = ({
fromChainId,
fromTokenRouteSymbol,
toChainId,
toTokenRouteSymbol,
- 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 getSwapFromTokens
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getSwapFromTokens = ({
fromChainId,
fromTokenRouteSymbol,
toChainId,
toTokenRouteSymbol,
- 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 getToTokens
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getToTokens = ({
fromChainId,
fromTokenRouteSymbol,
toChainId,
toTokenRouteSymbol,
- 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 getFromChainIds
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const getFromChainIds = ({
fromChainId,
fromTokenRouteSymbol,
toChainId,
toTokenRouteSymbol,
- 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"