Showing 1,971 of 13,422 total issues
Method Config.validateTokenDecimals
has 6 return statements (exceeds 4 allowed). Open
Open
func (c Config) validateTokenDecimals(ctx context.Context, omniClient omniClient.RPCClient) (err error) {
for chainID, chainCfg := range c.Chains {
for tokenName, tokenCFG := range chainCfg.Tokens {
chainClient, err := omniClient.GetChainClient(ctx, chainID)
if err != nil {
Method DeployManager.InitializeRemoteDeployedContracts
has 6 return statements (exceeds 4 allowed). Open
Open
func (d *DeployManager) InitializeRemoteDeployedContracts(
ctx context.Context,
backend backends.SimulatedTestBackend,
bondingManagerAgentRoot [32]byte) error {
d.T().Helper()
Method chainManager.setupMetrics
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *chainManager) setupMetrics() error {
meterMaid := c.handler.Meter(meter)
blockGauge, err := meterMaid.Int64ObservableGauge(blockNumberMetric)
if err != nil {
return fmt.Errorf("could not create histogram: %w", err)
Function NewQuoterManager
has 6 return statements (exceeds 4 allowed). Open
Open
func NewQuoterManager(config relconfig.Config, metricsHandler metrics.Handler, inventoryManager inventory.Manager, relayerSigner signer.Signer, feePricer pricer.FeePricer, apiClient rfqAPIClient.AuthenticatedClient) (Quoter, error) {
qt := make(map[string][]string)
// fix any casing issues.
var err error
Method QuoteRequestHandler.getRelayBlockNumber
has 6 return statements (exceeds 4 allowed). Open
Open
func (q *QuoteRequestHandler) getRelayBlockNumber(ctx context.Context, request reldb.QuoteRequest) (blockNumber uint64, err error) {
// fetch the transaction receipt for corresponding tx hash
var receipt *types.Receipt
err = retry.WithBackoff(ctx, func(context.Context) error {
receipt, err = q.Dest.Client.TransactionReceipt(ctx, request.DestTxHash)
Method Forwarder.standardizeBatch
has 6 return statements (exceeds 4 allowed). Open
Open
func (f *Forwarder) standardizeBatch(ctx context.Context, body []byte) (res []byte, anyErr bool, err error) {
dec := json.NewDecoder(bytes.NewReader(body))
_, err = dec.Token() // skip '['
if err != nil {
Method Manager.generateQuote
has 6 return statements (exceeds 4 allowed). Open
Open
func (m *Manager) generateQuote(ctx context.Context, input QuoteInput) (quote *model.PutRelayerQuoteRequest, err error) {
// Calculate the quote amount for this route
originAmount, err := m.getOriginAmount(ctx, input)
// don't quote if gas exceeds quote
if errors.Is(err, errMinGasExceedsQuoteAmount) {
Method Store.UpdateRebalance
has 6 return statements (exceeds 4 allowed). Open
Open
func (s Store) UpdateRebalance(ctx context.Context, rebalance reldb.Rebalance, updateID bool) error {
tx := s.DB().WithContext(ctx).Begin()
if tx.Error != nil {
return fmt.Errorf("could not start transaction: %w", tx.Error)
}
Method rebalanceManagerCircleCCTP.initContracts
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *rebalanceManagerCircleCCTP) initContracts(parentCtx context.Context) (err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "initContracts")
defer func(err error) {
metrics.EndSpanWithErr(span, err)
}(err)
Method BridgeRequestModel.ToBridgeRequest
has 6 return statements (exceeds 4 allowed). Open
Open
func (b BridgeRequestModel) ToBridgeRequest() (*guarddb.BridgeRequest, error) {
txID, err := hexutil.Decode(b.TransactionID)
if err != nil {
return nil, fmt.Errorf("could not get transaction id: %w", err)
}
Method Config.getChainConfigValue
has 6 return statements (exceeds 4 allowed). Open
Open
func (c Config) getChainConfigValue(chainID int, fieldName string) (interface{}, error) {
chainConfig, ok := c.Chains[chainID]
if ok {
value, err := getFieldValue(chainConfig, fieldName)
if err != nil {
Method rebalanceManagerSynapseCCTP.Execute
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *rebalanceManagerSynapseCCTP) Execute(parentCtx context.Context, rebalance *RebalanceData) (err error) {
contract, ok := c.cctpContracts[rebalance.OriginMetadata.ChainID]
if !ok {
return fmt.Errorf("could not find cctp contract for chain %d", rebalance.OriginMetadata.ChainID)
}
Method inventoryManagerImpl.initializeTokens
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *inventoryManagerImpl) initializeTokens(parentCtx context.Context, cfg relconfig.Config) (err error) {
i.mux.Lock()
defer i.mux.Unlock()
ctx, span := i.handler.Tracer().Start(parentCtx, "initializeTokens", trace.WithAttributes(
Method BackfillSuite.withdrawAndRemoveParity
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *BackfillSuite) withdrawAndRemoveParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.Filterer.ParseTokenWithdrawAndRemove(*log)
if err != nil {
Method Resolver.bwDestinationFallback
has 6 return statements (exceeds 4 allowed). Open
Open
func (r Resolver) bwDestinationFallback(ctx context.Context, chainID uint32, address string, identifier string, timestamp int, historical bool, bridgeType model.BridgeType) (*model.BridgeWatcherTx, error) {
txFetchContext, cancelTxFetch := context.WithTimeout(ctx, maxTimeToWaitForTx)
defer cancelTxFetch()
b := &backoff.Backoff{
Method queryResolver.GetMessageBusTxs
has 6 return statements (exceeds 4 allowed). Open
Open
func (r *queryResolver) GetMessageBusTxs(ctx context.Context, chainID []*int, address *string, startTime *int, endTime *int, txHash *string, messageID *string, pending bool, reverted bool, page *int) ([]*model.MessageBusTransaction, error) {
var err error
allMessageBusEvents, err := r.DB.GetAllMessageBusEvents(ctx, generateMessageBusQuery(chainID, address, startTime, endTime, messageID, pending, reverted, txHash, *page))
if err != nil {
return nil, fmt.Errorf("failed to get destinationbridge events from identifiers: %w", err)
Method BackfillSuite.depositParity
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *BackfillSuite) depositParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.FiltererV1.ParseTokenDeposit(*log)
_ = parsedLog
Method clientImpl.SubscribeActiveQuotes
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *clientImpl) SubscribeActiveQuotes(ctx context.Context, req *model.SubscribeActiveRFQRequest, reqChan chan *model.ActiveRFQMessage) (respChan chan *model.ActiveRFQMessage, err error) {
conn, err := c.connectWebsocket(ctx, req)
if err != nil {
return nil, fmt.Errorf("failed to connect to websocket: %w", err)
}
Method BackfillSuite.redeemAndRemoveParity
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *BackfillSuite) redeemAndRemoveParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.Filterer.ParseTokenRedeemAndRemove(*log)
if err != nil {
Method BackfillSuite.redeemAndSwapParity
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *BackfillSuite) redeemAndSwapParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
// parse the log
if useV1 {
parsedLog, err := parser.Filterer.ParseTokenRedeemAndSwap(*log)
if err != nil {