Showing 1,971 of 13,422 total issues
Method Store.GetTimestampForMessage
has 6 return statements (exceeds 4 allowed). Open
Open
func (s Store) GetTimestampForMessage(ctx context.Context, chainID, destination, nonce uint32) (*uint64, error) {
statesTableName, err := dbcommon.GetModelName(s.DB(), &State{})
if err != nil {
return nil, fmt.Errorf("failed to get states table name: %w", err)
}
Function main
has 6 return statements (exceeds 4 allowed). Open
Open
func main() {
fmt.Println("Enter Sending Chain URL (eg https://polygon-rpc.com, https://api.avax.network/ext/bc/C/rpc, https://optimism-mainnet.public.blastapi.io): ")
var sendingChainURL string
fmt.Scanln(&sendingChainURL)
Function CopyFile
has 6 return statements (exceeds 4 allowed). Open
Open
func CopyFile(fileToCopy, dest, packageName string) error {
// first things first, pkger operates on go modules, so we need to trim
modulePath := path.Dir(fileToCopy)
fileName := path.Base(fileToCopy)
Method Guard.verifyState
has 6 return statements (exceeds 4 allowed). Open
Open
func (g Guard) verifyState(ctx context.Context, state types.State, stateIndex int, data types.StateValidationData) (err error) {
var submitFunc func(transactor *bind.TransactOpts) (tx *ethTypes.Transaction, err error)
if types.HasAttestation(data) {
submitFunc = func(transactor *bind.TransactOpts) (tx *ethTypes.Transaction, err error) {
tx, err = g.domains[state.Origin()].LightInbox().VerifyStateWithAttestation(
Method Guard.handleAttestationAccepted
has 6 return statements (exceeds 4 allowed). Open
Open
func (g Guard) handleAttestationAccepted(ctx context.Context, log ethTypes.Log) error {
attestationData, err := g.lightInboxParser.ParseAttestationAccepted(log)
if err != nil {
return fmt.Errorf("could not parse attestation accepted: %w", err)
}
Method Store.GetEarliestStateInRange
has 6 return statements (exceeds 4 allowed). Open
Open
func (s Store) GetEarliestStateInRange(ctx context.Context, chainID, destination, startNonce, endNonce uint32) (*agentsTypes.State, error) {
statesTableName, err := dbcommon.GetModelName(s.DB(), &State{})
if err != nil {
return nil, fmt.Errorf("failed to get states table name: %w", err)
}
Function InitExecutorDB
has 6 return statements (exceeds 4 allowed). Open
Open
func InitExecutorDB(parentCtx context.Context, database string, path string, tablePrefix string, handler metrics.Handler) (_ db.ExecutorDB, err error) {
ctx, span := handler.Tracer().Start(parentCtx, "InitExecutorDB", trace.WithAttributes(
attribute.String("database", database),
attribute.String("path", path),
attribute.String("tablePrefix", tablePrefix),
Method Store.GetRelayableAgentStatuses
has 6 return statements (exceeds 4 allowed). Open
Open
func (s Store) GetRelayableAgentStatuses(ctx context.Context, chainID uint32) ([]agentTypes.AgentTree, error) {
agentTreesTableName, err := dbcommon.GetModelName(s.DB(), &AgentTree{})
if err != nil {
return nil, fmt.Errorf("failed to get agent trees table name: %w", err)
}
Function InitGuardDB
has 6 return statements (exceeds 4 allowed). Open
Open
func InitGuardDB(parentCtx context.Context, database string, path string, tablePrefix string, handler metrics.Handler) (_ db.GuardDB, err error) {
ctx, span := handler.Tracer().Start(parentCtx, "InitGuardDB", trace.WithAttributes(
attribute.String("database", database),
attribute.String("path", path),
attribute.String("tablePrefix", tablePrefix),
Method Guard.streamLogs
has 6 return statements (exceeds 4 allowed). Open
Open
func (g Guard) streamLogs(ctx context.Context, chainID uint32, address string) error {
// TODO: Get last block number to define starting point for streamLogs.
fromBlock := strconv.FormatUint(0, 16)
toBlock := "latest"
stream, err := g.grpcClient.StreamLogs(ctx, &pbscribe.StreamLogsRequest{
Method Guard.ensureAgentActive
has 6 return statements (exceeds 4 allowed). Open
Open
func (g Guard) ensureAgentActive(ctx context.Context, agent common.Address, chainID uint32) (ok bool, err error) {
agentStatus, err := g.getAgentStatus(ctx, chainID, agent)
if err != nil {
return false, fmt.Errorf("could not get agent status: %w", err)
}
Method Guard.handleValidAttestation
has 6 return statements (exceeds 4 allowed). Open
Open
func (g Guard) handleValidAttestation(ctx context.Context, attestationData *types.AttestationWithMetadata) error {
// Fetch the attested snapshot.
var snapshot types.Snapshot
var err error
contractCall := func(ctx context.Context) error {
Method Relayer.getDecimalsFromBridgeTx
has 6 return statements (exceeds 4 allowed). Open
Open
func (r *Relayer) getDecimalsFromBridgeTx(parentCtx context.Context, bridgeTx fastbridge.IFastBridgeBridgeTransaction) (originDecimals *uint8, destDecimals *uint8, err error) {
ctx, span := r.metrics.Tracer().Start(parentCtx, "getDecimals", trace.WithAttributes(
attribute.String("sender", bridgeTx.OriginSender.String()),
))
Method Relayer.getDecimals
has 6 return statements (exceeds 4 allowed). Open
Open
func (r *Relayer) getDecimals(ctx context.Context, addr common.Address, chainID uint32) (decimals *uint8, err error) {
// attempt to load decimal from cache
key := getDecimalsKey(addr, chainID)
decimals, ok := r.decimalsCache.Load(key)
if ok {
Method finalizedProxyImpl.checkShouldRequest
has 6 return statements (exceeds 4 allowed). Open
Open
func (r *finalizedProxyImpl) checkShouldRequest(parentCtx context.Context, req rpc.Request) bool {
// only apply to sendRawTransaction
// ignore if maxSubmitAhead is 0
if client.RPCMethod(req.Method) != client.SendRawTransactionMethod && r.maxSubmitAhead > 0 {
return true
Method Forwarder.forwardRequest
has 6 return statements (exceeds 4 allowed). Open
Open
func (f *Forwarder) forwardRequest(parentCtx context.Context, endpoint string) (_ *rawResponse, err error) {
ctx, span := f.tracer.Start(parentCtx, "forwardRequest",
trace.WithAttributes(attribute.String("endpoint", endpoint)),
)
Method Manager.prepareAndSubmitQuotes
has 6 return statements (exceeds 4 allowed). Open
Open
func (m *Manager) prepareAndSubmitQuotes(ctx context.Context, inv map[int]map[common.Address]*big.Int) (err error) {
ctx, span := m.metricsHandler.Tracer().Start(ctx, "prepareAndSubmitQuotes")
defer func() {
span.SetAttributes(attribute.Bool("relay_paused", m.relayPaused.Load()))
metrics.EndSpanWithErr(span, err)
Method Manager.getOriginAmount
has 6 return statements (exceeds 4 allowed). Open
Open
func (m *Manager) getOriginAmount(parentCtx context.Context, input QuoteInput) (quoteAmount *big.Int, err error) {
ctx, span := m.metricsHandler.Tracer().Start(parentCtx, "getOriginAmount", trace.WithAttributes(
attribute.Int(metrics.Origin, input.OriginChainID),
attribute.Int(metrics.Destination, input.DestChainID),
attribute.String("dest_address", input.DestTokenAddr.String()),
Method rebalanceManagerCircleCCTP.listenMessageReceived
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *rebalanceManagerCircleCCTP) listenMessageReceived(parentCtx context.Context, chainID int, ethClient client.EVM) (err error) {
listener, ok := c.transmitterListeners[chainID]
if !ok {
return fmt.Errorf("could not find listener for chain %d", chainID)
}
Method rebalanceManagerCircleCCTP.listenDepositForBurn
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *rebalanceManagerCircleCCTP) listenDepositForBurn(parentCtx context.Context, chainID int, ethClient client.EVM) (err error) {
listener, ok := c.messengerListeners[chainID]
if !ok {
return fmt.Errorf("could not find listener for chain %d", chainID)
}