Showing 1,971 of 13,422 total issues
Method BackfillSuite.depositAndSwapParity
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *BackfillSuite) depositAndSwapParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.Filterer.ParseTokenDepositAndSwap(*log)
if err != nil {
Method BackfillSuite.mintAndSwapParity
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *BackfillSuite) mintAndSwapParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.Filterer.ParseTokenMintAndSwap(*log)
if err != nil {
Method BackfillSuite.withdrawParity
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *BackfillSuite) withdrawParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.FiltererV1.ParseTokenWithdraw(*log)
if err != nil {
Method BackfillSuite.mintParity
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *BackfillSuite) mintParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.Filterer.ParseTokenMint(*log)
if err != nil {
Method BackfillSuite.redeemParity
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *BackfillSuite) redeemParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.FiltererV1.ParseTokenRedeem(*log)
if err != nil {
Method circleCCTPHandler.SubmitReceiveMessage
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *circleCCTPHandler) SubmitReceiveMessage(parentCtx context.Context, msg *relayTypes.Message) (err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "SubmitReceiveMessage", trace.WithAttributes(
attribute.String("message_hash", msg.MessageHash),
attribute.Int(metrics.ChainID, int(msg.DestChainID)),
))
Method SwapParser.GetCorrectSwapFee
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *SwapParser) GetCorrectSwapFee(ctx context.Context, swapEvent model.SwapEvent) (uint64, uint64, error) {
var dbAdminFee uint64
var dbSwapFee uint64
var err error
g, groupCtx := errgroup.WithContext(ctx)
Method RelayerAPIServer.Start
has 6 return statements (exceeds 4 allowed). Open
Open
func (r RelayerAPIServer) Start(ctx context.Context) error {
engine := gin.Default()
engine.GET("/tx", func(ctx *gin.Context) {
r.GetTx(ctx)
})
Method CCTPRelayer.processQueue
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *CCTPRelayer) 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*90)
defer cancel()
Method Store.StoreEvents
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Store) StoreEvents(ctx context.Context, events []interface{}) error {
var bridgeEvents []*BridgeEvent
var swapEvents []SwapEvent
var messageBusEvents []MessageBusEvent
var cctpEvents []*CCTPEvent
Method Config.IsValid
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *Config) IsValid(ctx context.Context) (ok bool, err error) {
if ok, err = c.Chains.IsValid(ctx); !ok {
return false, err
}
Method Store.StoreEvent
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Store) StoreEvent(ctx context.Context, event interface{}) error {
switch conv := event.(type) {
case *BridgeEvent:
dbTx := s.db.WithContext(ctx).Create(conv)
if dbTx.Error != nil {
Method Indexer.fetchEventData
has 6 return statements (exceeds 4 allowed). Open
Open
func (x *Indexer) fetchEventData(parentCtx context.Context, txhash common.Hash, blockNumber uint64) (tx *txData, err error) {
ctx, span := x.handler.Tracer().Start(parentCtx, "fetchEventData", trace.WithAttributes(
attribute.String("tx", txhash.Hex()),
attribute.String("block", fmt.Sprintf("%d", blockNumber)),
))
Function PopulateChainsWithLogs
has 6 return statements (exceeds 4 allowed). Open
Open
func PopulateChainsWithLogs(ctx context.Context, t *testing.T, chainBackends map[uint32]geth.Backend, desiredBlockHeight uint64, managers []*DeployManager, handler metrics.Handler) (map[uint32]*TestChainHandler, map[uint32][]backend.ScribeBackend, error) {
t.Helper()
addressChan := make(chan chainContractPair, len(chainBackends))
scribeBackendChan := make(chan chainBackendPair, len(chainBackends))
g, groupCtx := errgroup.WithContext(ctx)
Function InitDB
has 6 return statements (exceeds 4 allowed). Open
Open
func InitDB(ctx context.Context, databaseType string, path string, metrics metrics.Handler, skipMigrations bool) (db.EventDB, error) {
logger.Warnf("Starting database connection from api")
switch {
case databaseType == "sqlite":
Method Store.RetrieveLogsFromHeadRangeQuery
has 6 return statements (exceeds 4 allowed). Open
Open
func (s Store) RetrieveLogsFromHeadRangeQuery(ctx context.Context, logFilter db.LogFilter, startBlock uint64, endBlock uint64, page int) ([]*types.Log, error) {
if logFilter.ContractAddress == "" || logFilter.ChainID == 0 {
return nil, fmt.Errorf("contract address and chain ID must be passed")
}
if page < 1 {
Method APISuite.SetupTest
has 6 return statements (exceeds 4 allowed). Open
Open
func (g *APISuite) SetupTest() {
g.TestSuite.SetupTest()
g.dbPath = filet.TmpDir(g.T(), "")
g.SetTestTimeout(time.Minute * 3)
Function GenerateConfig
has 6 return statements (exceeds 4 allowed). Open
Open
func GenerateConfig(ctx context.Context, omniRPCUrl, deployPath string, outputPath string, skippedChainIDS []int, cg ClientGenerator) error {
contracts, err := hardhat.GetDeployments(deployPath)
if err != nil {
return fmt.Errorf("could not get deployments: %w", err)
}
Method Store.RetrieveUnconfirmedEthTxsFromHeadRangeQuery
has 6 return statements (exceeds 4 allowed). Open
Open
func (s Store) RetrieveUnconfirmedEthTxsFromHeadRangeQuery(ctx context.Context, ethTxFilter db.EthTxFilter, startBlock uint64, endBlock uint64, lastIndexed uint64, page int) ([]db.TxWithBlockNumber, error) {
if ethTxFilter.ChainID == 0 {
return nil, fmt.Errorf("chain ID must be passed")
}
if page < 1 {
Function EmitEvents
has 6 return statements (exceeds 4 allowed). Open
Open
func EmitEvents(ctx context.Context, t *testing.T, backend backends.SimulatedTestBackend, desiredBlockHeight uint64, testChainHandler *TestChainHandler) error {
t.Helper()
i := 0
for {
select {