services/rfq/relayer/inventory/rebalance.go
Function getRebalanceAmount
has 73 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func getRebalanceAmount(ctx context.Context, cfg relconfig.Config, tokens map[int]map[common.Address]*TokenMetadata, rebalance *RebalanceData) (amount *big.Int, err error) {
span := trace.SpanFromContext(ctx)
// get the maintenance and initial values for the destination chain
maintenancePctDest, err := cfg.GetMaintenanceBalancePct(rebalance.DestMetadata.ChainID, rebalance.DestMetadata.Addr.Hex())
Function getRebalanceAmount
has 9 return statements (exceeds 4 allowed). Open
Open
func getRebalanceAmount(ctx context.Context, cfg relconfig.Config, tokens map[int]map[common.Address]*TokenMetadata, rebalance *RebalanceData) (amount *big.Int, err error) {
span := trace.SpanFromContext(ctx)
// get the maintenance and initial values for the destination chain
maintenancePctDest, err := cfg.GetMaintenanceBalancePct(rebalance.DestMetadata.ChainID, rebalance.DestMetadata.Addr.Hex())
Function getRebalanceForMethod
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func getRebalanceForMethod(ctx context.Context, cfg relconfig.Config, inv map[int]map[common.Address]*TokenMetadata, method relconfig.RebalanceMethod, tokenName string) (rebalance *RebalanceData, err error) {