synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Method BackfillSuite.depositAndSwapParity has 6 return statements (exceeds 4 allowed).
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 {
Severity: Major
Found in services/explorer/backfill/chain_test.go - About 40 mins to fix

    Method BackfillSuite.mintAndSwapParity has 6 return statements (exceeds 4 allowed).
    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 {
    Severity: Major
    Found in services/explorer/backfill/chain_test.go - About 40 mins to fix

      Method BackfillSuite.withdrawParity has 6 return statements (exceeds 4 allowed).
      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 {
      Severity: Major
      Found in services/explorer/backfill/chain_test.go - About 40 mins to fix

        Method BackfillSuite.mintParity has 6 return statements (exceeds 4 allowed).
        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 {
        Severity: Major
        Found in services/explorer/backfill/chain_test.go - About 40 mins to fix

          Method BackfillSuite.redeemParity has 6 return statements (exceeds 4 allowed).
          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 {
          Severity: Major
          Found in services/explorer/backfill/chain_test.go - About 40 mins to fix

            Method circleCCTPHandler.SubmitReceiveMessage has 6 return statements (exceeds 4 allowed).
            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)),
                ))
            Severity: Major
            Found in services/cctp-relayer/relayer/circle.go - About 40 mins to fix

              Method SwapParser.GetCorrectSwapFee has 6 return statements (exceeds 4 allowed).
              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)
              Severity: Major
              Found in services/explorer/consumer/parser/swapparser.go - About 40 mins to fix

                Method RelayerAPIServer.Start has 6 return statements (exceeds 4 allowed).
                Open

                func (r RelayerAPIServer) Start(ctx context.Context) error {
                    engine := gin.Default()
                    engine.GET("/tx", func(ctx *gin.Context) {
                        r.GetTx(ctx)
                    })
                Severity: Major
                Found in services/cctp-relayer/api/server.go - About 40 mins to fix

                  Method CCTPRelayer.processQueue has 6 return statements (exceeds 4 allowed).
                  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()
                  
                  
                  Severity: Major
                  Found in services/cctp-relayer/relayer/relayer.go - About 40 mins to fix

                    Method Store.StoreEvents has 6 return statements (exceeds 4 allowed).
                    Open

                    func (s *Store) StoreEvents(ctx context.Context, events []interface{}) error {
                        var bridgeEvents []*BridgeEvent
                        var swapEvents []SwapEvent
                        var messageBusEvents []MessageBusEvent
                        var cctpEvents []*CCTPEvent
                    Severity: Major
                    Found in services/explorer/db/sql/writer.go - About 40 mins to fix

                      Method Config.IsValid has 6 return statements (exceeds 4 allowed).
                      Open

                      func (c *Config) IsValid(ctx context.Context) (ok bool, err error) {
                          if ok, err = c.Chains.IsValid(ctx); !ok {
                              return false, err
                          }
                      
                      
                      Severity: Major
                      Found in services/cctp-relayer/config/config.go - About 40 mins to fix

                        Method Store.StoreEvent has 6 return statements (exceeds 4 allowed).
                        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 {
                        Severity: Major
                        Found in services/explorer/db/sql/writer.go - About 40 mins to fix

                          Method Indexer.fetchEventData has 6 return statements (exceeds 4 allowed).
                          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)),
                              ))
                          Severity: Major
                          Found in services/scribe/service/indexer/indexer.go - About 40 mins to fix

                            Function PopulateChainsWithLogs has 6 return statements (exceeds 4 allowed).
                            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)
                            Severity: Major
                            Found in services/scribe/testutil/utils.go - About 40 mins to fix

                              Function InitDB has 6 return statements (exceeds 4 allowed).
                              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":
                              Severity: Major
                              Found in services/scribe/api/server.go - About 40 mins to fix

                                Method Store.RetrieveLogsFromHeadRangeQuery has 6 return statements (exceeds 4 allowed).
                                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 {
                                Severity: Major
                                Found in services/scribe/db/datastore/sql/base/athead.go - About 40 mins to fix

                                  Method APISuite.SetupTest has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (g *APISuite) SetupTest() {
                                      g.TestSuite.SetupTest()
                                      g.dbPath = filet.TmpDir(g.T(), "")
                                      g.SetTestTimeout(time.Minute * 3)
                                  
                                  
                                  Severity: Major
                                  Found in services/scribe/api/suite_test.go - About 40 mins to fix

                                    Function GenerateConfig has 6 return statements (exceeds 4 allowed).
                                    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)
                                        }
                                    Severity: Major
                                    Found in services/scribe/config/generate.go - About 40 mins to fix

                                      Method Store.RetrieveUnconfirmedEthTxsFromHeadRangeQuery has 6 return statements (exceeds 4 allowed).
                                      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 {
                                      Severity: Major
                                      Found in services/scribe/db/datastore/sql/base/athead.go - About 40 mins to fix

                                        Function EmitEvents has 6 return statements (exceeds 4 allowed).
                                        Open

                                        func EmitEvents(ctx context.Context, t *testing.T, backend backends.SimulatedTestBackend, desiredBlockHeight uint64, testChainHandler *TestChainHandler) error {
                                            t.Helper()
                                            i := 0
                                            for {
                                                select {
                                        Severity: Major
                                        Found in services/scribe/testutil/utils.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language