synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Function allBridgeQuotes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export async function allBridgeQuotes(
  this: SynapseSDK,
  originChainId: number,
  destChainId: number,
  tokenIn: string,
Severity: Minor
Found in packages/sdk-router/src/operations/bridge.ts - About 1 hr to fix

    Function formatBigIntToString has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const formatBigIntToString = (
      bi: bigint | undefined,
      nativePrecision: number | undefined,
      decimalPlaces?: number
    ) => {
    Severity: Minor
    Found in packages/widget/src/utils/formatBigIntToString.ts - About 1 hr to fix

      Method receiptsProxyImpl.processRequest has 55 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (r *receiptsProxyImpl) processRequest(ctx context.Context, rpcRequest rpc.Request, requestID []byte) (resp omniHTTP.Response, err error) {
          ctx, span := r.handler.Tracer().Start(ctx, "proxyrequest")
          defer func() {
              metrics.EndSpanWithErr(span, err)
          }()
      Severity: Minor
      Found in services/omnirpc/modules/receiptsbackup/receiptsbackup.go - About 1 hr to fix

        Method synapseCCTPHandler.SubmitReceiveMessage has 55 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (s *synapseCCTPHandler) SubmitReceiveMessage(parentCtx context.Context, msg *relayTypes.Message) (err error) {
            ctx, span := s.handler.Tracer().Start(parentCtx, "SubmitReceiveMessage", trace.WithAttributes(
                attribute.String(MessageHash, msg.MessageHash),
                attribute.Int(metrics.Origin, int(msg.OriginChainID)),
                attribute.Int(metrics.Destination, int(msg.DestChainID)),
        Severity: Minor
        Found in services/cctp-relayer/relayer/synapse.go - About 1 hr to fix

          Function NewTestEnvDB has 55 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func NewTestEnvDB(ctx context.Context, t *testing.T, handler metrics.Handler) (db db.ConsumerDB, eventDB scribedb.EventDB, gqlClient *client.Client, logIndex atomic.Int64, cleanup func(), testBackend backends.SimulatedTestBackend, deployManager *DeployManager) {
              t.Helper()
              dbPath := filet.TmpDir(t, "")
          
              sqliteStore, err := sqlite.NewSqliteStore(ctx, dbPath, handler, false)
          Severity: Minor
          Found in services/explorer/testutil/newtestenv.go - About 1 hr to fix

            Function rfqEventToBridgeEvent has 55 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func rfqEventToBridgeEvent(rfqEvent model.RFQEvent) model.BridgeEvent {
                // Only convert BridgeRequestedEvent and BridgeRelayedEvent to bridge events
                // Exclude BridgeDepositRefunded, BridgeProofProvided, and BridgeDepositClaimed
                eventType := rfqEvent.EventType
                if eventType != rfqTypes.BridgeRequestedEvent.Int() &&
            Severity: Minor
            Found in services/explorer/consumer/parser/rfqparser.go - About 1 hr to fix

              Method ChainIndexer.livefillAtHead has 55 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (c *ChainIndexer) livefillAtHead(parentContext context.Context) error {
                  timeout := time.Duration(0)
                  b := createBackoff()
                  addresses := getAddressesFromConfig(c.chainConfig.Contracts)
                  tipLivefillBlockMeter, err := c.handler.Metrics().NewHistogram(fmt.Sprintf("scribe_block_meter_%d_tip_livefill", c.chainConfig.ChainID), "block_histogram", "a block height meter", "blocks")
              Severity: Minor
              Found in services/scribe/service/chain.go - About 1 hr to fix

                Function TestBytesToJSONString has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func TestBytesToJSONString(t *testing.T) {
                    tests := []struct {
                        name      string
                        input     []byte
                        want      string
                Severity: Minor
                Found in core/bytes_test.go - About 1 hr to fix

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

                  const constructJSON = (swappableMap, exclusionList) => {
                    const result = {}
                  
                    // Iterate through the chains
                    for (const chainA in swappableMap) {
                  Severity: Minor
                  Found in packages/synapse-interface/constants/existingBridgeRoutes.ts - About 1 hr to fix

                    Function GenerateShellCommand has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func GenerateShellCommand(shellCommands []*cli.Command) *cli.Command {
                        // explicitly exclude shell if included
                        capturedCommands := pruneShellCommands(shellCommands)
                    
                        // make sure tty is open, this will not be the case in distroless containers
                    Severity: Minor
                    Found in core/commandline/shell.go - About 1 hr to fix

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

                      export const refundedAndRelayedTransactionsController = async (
                        req: Request,
                        res: Response
                      ) => {
                        try {

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

                            recentInvalidRelays: async () => {
                              const query = db
                                .selectFrom('BridgeRelayedEvents')
                                .leftJoin(
                                  'BridgeRequestEvents',
                        Severity: Minor
                        Found in packages/rfq-indexer/api/src/graphql/resolvers.ts - About 1 hr to fix

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

                          export const pendingTransactionsMissingProofController = async (
                            req: Request,
                            res: Response
                          ) => {
                            try {

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

                            export const getNetworkHover = (chainColor: string): string => {
                              switch (chainColor) {
                                case ColorOptions.YELLOW:
                                  return `hover:bg-[bg-yellow-500] hover:bg-opacity-30 dark:hover:bg-yellow-500 dark:hover:bg-opacity-30`
                                case ColorOptions.ETH:
                            Severity: Minor
                            Found in packages/synapse-interface/styles/chains.ts - About 1 hr to fix

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

                              export const getNetworkButtonBorderImportant = (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 getNetworkButtonBorderHover has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

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

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

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

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

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

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

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

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

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