synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Function getNetworkBgClassName has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getNetworkBgClassName = (chainColor: string): string => {
  switch (chainColor) {
    case ColorOptions.YELLOW:
      return 'bg-stone-800'
    case ColorOptions.ETH:
Severity: Minor
Found in packages/synapse-interface/styles/chains.ts - About 1 hr to fix

    Function getNetworkButtonBgClassName has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const getNetworkButtonBgClassName = (chainColor: string): string => {
      switch (chainColor) {
        case ColorOptions.YELLOW:
          return `bg-[#ecae0b] hover:bg-[#ecae0b] active:bg-[#ecae0b]`
        case ColorOptions.ETH:
    Severity: Minor
    Found in packages/synapse-interface/styles/chains.ts - About 1 hr to fix

      Function getNetworkButtonBgClassNameActive has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getNetworkButtonBgClassNameActive = (
        chainColor: string
      ): string => {
        switch (chainColor) {
          case ColorOptions.YELLOW:
      Severity: Minor
      Found in packages/synapse-interface/styles/chains.ts - About 1 hr to fix

        Function getNetworkButtonBorder has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const getNetworkButtonBorder = (chainColor: string): string => {
          switch (chainColor) {
            case ColorOptions.YELLOW:
              return `border-[#ecae0b] dark:border-[#ecae0b]`
            case ColorOptions.ETH:
        Severity: Minor
        Found in packages/synapse-interface/styles/chains.ts - About 1 hr to fix

          Function getNetworkShadow has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const getNetworkShadow = (chainColor: string): string => {
            switch (chainColor) {
              case ColorOptions.ETH:
                return `shadow-blue-xl hover:shadow-blue-2xl`
              case ColorOptions.YELLOW:
          Severity: Minor
          Found in packages/synapse-interface/styles/chains.ts - About 1 hr to fix

            Function constructJSON has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const constructJSON = (swappableMap, exclusionList) => {
              const result = {}
            
              for (const chainA in swappableMap) {
                for (const tokenA in swappableMap[chainA]) {
            Severity: Minor
            Found in packages/widget/src/constants/existingBridgeRoutes.ts - About 1 hr to fix

              Function destinationTokensController has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const destinationTokensController = async (req, res) => {
                const errors = validationResult(req)
                if (!errors.isEmpty()) {
                  return res.status(400).json({ errors: errors.array() })
                }
              Severity: Minor
              Found in packages/rest-api/src/controllers/destinationTokensController.ts - About 1 hr to fix

                Function synapseTxIdController has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const synapseTxIdController = async (req, res) => {
                  const errors = validationResult(req)
                  if (!errors.isEmpty()) {
                    return res.status(400).json({ errors: errors.array() })
                  }
                Severity: Minor
                Found in packages/rest-api/src/controllers/synapseTxIdController.ts - About 1 hr to fix

                  Function indexController has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  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(
                  Severity: Minor
                  Found in packages/rest-api/src/controllers/indexController.ts - About 1 hr to fix

                    Function uriToHttp has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function uriToHttp(uri: string) {
                      let protocol
                      if (uri[0] === '/') {
                        protocol = '/'
                      } else {
                    Severity: Minor
                    Found in packages/synapse-interface/constants/urls/uriToHttp.tsx - About 1 hr to fix

                      Function TimeEstimate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const TimeEstimate = () => {
                        const { fromToken } = useBridgeState()
                        const { bridgeQuote } = useBridgeQuoteState()
                        const t = useTranslations()
                      
                      

                        Method baseChain.HeaderByTime has 12 return statements (exceeds 4 allowed).
                        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)
                        Severity: Major
                        Found in ethergo/chain/block.go - About 1 hr to fix

                          Function NewExecutor has 12 return statements (exceeds 4 allowed).
                          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 {
                          Severity: Major
                          Found in agents/agents/executor/executor.go - About 1 hr to fix

                            Function NewGuard has 12 return statements (exceeds 4 allowed).
                            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),
                            Severity: Major
                            Found in agents/agents/guard/guard.go - About 1 hr to fix

                              Method Relayer.runChainIndexer has 12 return statements (exceeds 4 allowed).
                              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 {
                              Severity: Major
                              Found in services/rfq/relayer/service/chainindexer.go - About 1 hr to fix

                                Method queryResolver.getAmountStatisticsAll has 12 return statements (exceeds 4 allowed).
                                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
                                Severity: Major
                                Found in services/explorer/graphql/server/graph/queryutils.go - About 1 hr to fix

                                  Method queryResolver.AmountStatistic has 12 return statements (exceeds 4 allowed).
                                  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
                                  Severity: Major
                                  Found in services/explorer/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

                                    Function deployParseNet has 12 return statements (exceeds 4 allowed).
                                    Open

                                    func deployParseNet() error {
                                        globMux.Lock()
                                        defer globMux.Unlock()
                                    
                                        // 100 million ether
                                    Severity: Major
                                    Found in services/explorer/contracts/user/messages.go - About 1 hr to fix

                                      Method executionContext.field_Query_logsAtHeadRange_args has 12 return statements (exceeds 4 allowed).
                                      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 {
                                      Severity: Major
                                      Found in services/explorer/consumer/client/resolver-client/server.go - About 1 hr to fix

                                        Method executionContext.field_Query_logsAtHeadRange_args has 12 return statements (exceeds 4 allowed).
                                        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 {
                                        Severity: Major
                                        Found in services/scribe/graphql/server/graph/resolver/server.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language