Showing 1,971 of 13,422 total issues
Function getNetworkBgClassName
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getNetworkBgClassName = (chainColor: string): string => {
switch (chainColor) {
case ColorOptions.YELLOW:
return 'bg-stone-800'
case ColorOptions.ETH:
Function getNetworkButtonBgClassName
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getNetworkButtonBgClassName = (chainColor: string): string => {
switch (chainColor) {
case ColorOptions.YELLOW:
return `bg-[#ecae0b] hover:bg-[#ecae0b] active:bg-[#ecae0b]`
case ColorOptions.ETH:
Function getNetworkButtonBgClassNameActive
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getNetworkButtonBgClassNameActive = (
chainColor: string
): string => {
switch (chainColor) {
case ColorOptions.YELLOW:
Function getNetworkButtonBorder
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getNetworkButtonBorder = (chainColor: string): string => {
switch (chainColor) {
case ColorOptions.YELLOW:
return `border-[#ecae0b] dark:border-[#ecae0b]`
case ColorOptions.ETH:
Function getNetworkShadow
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getNetworkShadow = (chainColor: string): string => {
switch (chainColor) {
case ColorOptions.ETH:
return `shadow-blue-xl hover:shadow-blue-2xl`
case ColorOptions.YELLOW:
Function constructJSON
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const constructJSON = (swappableMap, exclusionList) => {
const result = {}
for (const chainA in swappableMap) {
for (const tokenA in swappableMap[chainA]) {
Function destinationTokensController
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const destinationTokensController = async (req, res) => {
const errors = validationResult(req)
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() })
}
Function synapseTxIdController
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const synapseTxIdController = async (req, res) => {
const errors = validationResult(req)
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() })
}
Function indexController
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const indexController = async (req, res) => {
try {
const tokensWithChains = Object.values(tokensList).map((token: any) => ({
symbol: token.symbol,
chains: Object.entries(token.addresses).map(
Function uriToHttp
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function uriToHttp(uri: string) {
let protocol
if (uri[0] === '/') {
protocol = '/'
} else {
Function TimeEstimate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TimeEstimate = () => {
const { fromToken } = useBridgeState()
const { bridgeQuote } = useBridgeQuoteState()
const t = useTranslations()
Method baseChain.HeaderByTime
has 12 return statements (exceeds 4 allowed). Open
Open
func (b *baseChain) HeaderByTime(ctx context.Context, startHeight *big.Int, targetTime time.Time) (*types.Header, error) {
// grab the MeteredEVMClient explicitly to avoid ambiguous references
client, err := newHeaderCacheClient(b, 4)
if err != nil {
return nil, fmt.Errorf("could not create header cache client: %w", err)
Function NewExecutor
has 12 return statements (exceeds 4 allowed). Open
Open
func NewExecutor(ctx context.Context, config executor.Config, executorDB db.ExecutorDB, scribeClient client.ScribeClient, omniRPCClient omnirpcClient.RPCClient, handler metrics.Handler) (*Executor, error) {
chainExecutors := make(map[uint32]*chainExecutor)
conn, grpcClient, err := makeScribeClient(ctx, handler, fmt.Sprintf("%s:%d", scribeClient.URL, scribeClient.Port))
if err != nil {
Function NewGuard
has 12 return statements (exceeds 4 allowed). Open
Open
func NewGuard(ctx context.Context, cfg config.AgentConfig, omniRPCClient omnirpcClient.RPCClient, scribeClient client.ScribeClient, guardDB db.GuardDB, handler metrics.Handler) (guard *Guard, err error) {
guard = &Guard{
refreshInterval: time.Second * time.Duration(cfg.RefreshIntervalSeconds),
domains: make(map[uint32]domains.DomainClient),
logChans: make(map[uint32]chan *ethTypes.Log),
Method Relayer.runChainIndexer
has 12 return statements (exceeds 4 allowed). Open
Open
func (r *Relayer) runChainIndexer(ctx context.Context, chainID int) (err error) {
chainListener := r.chainListeners[chainID]
parser, err := fastbridge.NewParser(chainListener.Address())
if err != nil {
Method queryResolver.getAmountStatisticsAll
has 12 return statements (exceeds 4 allowed). Open
Open
func (r *queryResolver) getAmountStatisticsAll(ctx context.Context, typeArg model.StatisticType, chainID *int, address *string, tokenAddress *string, compositeFilters string) (*string, error) {
if typeArg == model.StatisticTypeMedianVolumeUsd || typeArg == model.StatisticTypeMeanVolumeUsd || typeArg == model.StatisticTypeMedianFeeUsd || typeArg == model.StatisticTypeMeanFeeUsd {
return nil, fmt.Errorf("cannot calculate averages or medians across all platforms")
}
var bridgeFinalSQL *string
Method queryResolver.AmountStatistic
has 12 return statements (exceeds 4 allowed). Open
Open
func (r *queryResolver) AmountStatistic(ctx context.Context, typeArg model.StatisticType, duration *model.Duration, platform *model.Platform, chainID *int, address *string, tokenAddress *string, useCache *bool, useMv *bool) (*model.ValueResult, error) {
if useCache != nil && *useCache {
res, err := r.getValueResultFromCache(fmt.Sprintf("amountStatistic, %s, %s, %s, %s, %s, %s", typeArg.String(), platform.String(), duration.String(), keyGenHandleNilInt(chainID), keyGenHandleNilString(address), keyGenHandleNilString(tokenAddress)))
if err == nil {
return res, nil
Function deployParseNet
has 12 return statements (exceeds 4 allowed). Open
Open
func deployParseNet() error {
globMux.Lock()
defer globMux.Unlock()
// 100 million ether
Method executionContext.field_Query_logsAtHeadRange_args
has 12 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) field_Query_logsAtHeadRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["contract_address"]; ok {
Method executionContext.field_Query_logsAtHeadRange_args
has 12 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) field_Query_logsAtHeadRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 *string
if tmp, ok := rawArgs["contract_address"]; ok {