Showing 1,971 of 13,422 total issues
Method executionContext._Query
has 58 return statements (exceeds 4 allowed). Open
func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
Object: "Query",
})
Function Wallet
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Wallet = () => {
const { connector: activeConnector, address: connectedAddress } = useAccount()
const { chain: currentChain } = useAccount()
const walletId = activeConnector?.id
File evm.go
has 624 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Code generated by mockery v2.14.0. DO NOT EDIT.
package mocks
import (
File evm_client.go
has 624 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Code generated by mockery v2.14.0. DO NOT EDIT.
package mocks
import (
File index.tsx
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Fragment } from 'react'
import { Popover, Transition } from '@headlessui/react'
import { DocumentTextIcon, MenuIcon, XIcon } from '@heroicons/react/outline'
// import { useActiveWeb3React } from '@hooks/wallet/useActiveWeb3React'
import {
Function Portfolio
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Portfolio = () => {
const dispatch = useAppDispatch()
const { fromChainId }: BridgeState = useBridgeState()
const {
activeTab,
Function createParsers
has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring. Open
func createParsers(ctx context.Context, db db.ConsumerDB, fetcher fetcherpkg.ScribeFetcher, clients map[uint32]etherClient.EVM, config serverConfig.Config) (*types.ServerParsers, *types.ServerRefs, map[string]*swap.SwapFlashLoanFilterer, error) {
ethClient, err := ethclient.DialContext(ctx, config.RPCURL+fmt.Sprintf("%d", 1))
if err != nil {
return nil, nil, nil, fmt.Errorf("could not create client: %w", err)
}
- 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 getChainBackfiller
has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring. Open
func getChainBackfiller(consumerDB db.ConsumerDB, chainConfig indexerConfig.ChainConfig, fetcher fetcherpkg.ScribeFetcher, client bind.ContractBackend, tokenDataService tokendata.Service, priceDataService tokenprice.Service) (*backfill.ChainBackfiller, error) {
var err error
var bridgeParser *parser.BridgeParser
var messageBusParser *parser.MessageBusParser
var cctpParser *parser.CCTPParser
- 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 Indexer.Index
has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring. Open
func (x *Indexer) Index(parentCtx context.Context, startHeight uint64, endHeight uint64) (err error) {
ctx, span := x.handler.Tracer().Start(parentCtx, "contract.Backfill", trace.WithAttributes(
attribute.Int("chain", int(x.indexerConfig.ChainID)),
attribute.String("address", x.addressesToString(x.indexerConfig.Addresses)),
attribute.Int("start", int(startHeight)),
- 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 StateManagedSwap
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
const StateManagedSwap = () => {
const { address } = useAccount()
const { synapseSDK } = useSynapseContext()
const swapDisplayRef = useRef(null)
const quoteToastRef = useRef({ id: '' })
- 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 NotarySuite.TestNotaryE2E
has 142 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (u *NotarySuite) TestNotaryE2E() {
guardTestConfig := config.AgentConfig{
Domains: map[string]config.DomainConfig{
"origin_client": u.OriginDomainClient.Config(),
"destination_client": u.DestinationDomainClient.Config(),
Function AddressPage
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const AddressPage = () => {
const router = useRouter()
const { address } = router.query
const [platform, setPlatform] = useState('ALL')
LifecycleClient
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
type LifecycleClient struct {
underlyingClient EVMClient
Permitter
// chainID is the chain id used for the client
chainID *big.Int
IGasOracle
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
type IGasOracle struct {
mock.Mock
}
EventDB
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
type EventDB struct {
mock.Mock
}
Function getCmpTestCases
has 140 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getCmpTestCases() []*cmpTestCase {
// this will serve as a fuzz test for legacy txes
gofakeit.Seed(time.Now().UnixNano())
// gasPriceTests test gas price v gas price
Method GuardSuite.TestInvalidReceipt
has 140 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (g *GuardSuite) TestInvalidReceipt() {
testDone := false
defer func() {
testDone = true
}()
Method Resolver.getAndParseLogs
has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring. Open
func (r Resolver) getAndParseLogs(ctx context.Context, logFetcher *indexer.LogFetcher, chainID uint32, kappa string, bridgeType model.BridgeType) (interface{}, error) {
streamLogsCtx, cancelStreamLogs := context.WithCancel(ctx)
logsChan := *logFetcher.GetFetchedLogsChan()
destinationData := make(chan *ifaceBridgeEvent, 1)
destinationDataCCTP := make(chan *ifaceCCTPEvent, 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
Method ChainBackfiller.backfillContractLogs
has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring. Open
func (c *ChainBackfiller) backfillContractLogs(parentCtx context.Context, contract indexerconfig.ContractConfig) (err error) {
// make the event parser
eventParser, err := c.makeEventParser(contract)
if err != nil {
return err
- 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 render
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
const render = useMemo(() => {
return (
<ConnectButton.Custom>
{({
account,