synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Function ConnectWalletButton has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function ConnectWalletButton() {
  const [clientReady, setClientReady] = useState<boolean>(false)
  const { address } = useAccount()

  const t = useTranslations('Wallet')
Severity: Minor
Found in packages/synapse-interface/components/ConnectionIndicators.tsx - About 1 hr to fix

    Method Guard.handleReceiptAccepted has 18 return statements (exceeds 4 allowed).
    Open

    func (g Guard) handleReceiptAccepted(ctx context.Context, log ethTypes.Log) error {
        fraudReceipt, err := g.inboxParser.ParseReceiptAccepted(log)
        if err != nil {
            return fmt.Errorf("could not parse receipt accepted: %w", err)
        }
    Severity: Major
    Found in agents/agents/guard/fraud.go - About 1 hr to fix

      Method Executor.Execute has 18 return statements (exceeds 4 allowed).
      Open

      func (e Executor) Execute(parentCtx context.Context, message types.Message) (_ bool, err error) {
          originDomain := message.OriginDomain()
          destinationDomain := message.DestinationDomain()
      
          ctx, span := e.handler.Tracer().Start(parentCtx, "Execute", trace.WithAttributes(
      Severity: Major
      Found in agents/agents/executor/executor.go - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

            if coinGeckoID != "" && !(coinGeckoID == "xjewel" && *timeStamp < 1649030400) && !(coinGeckoID == "synapse-2" && *timeStamp < 1630281600) && !(coinGeckoID == "governance-ohm" && *timeStamp < 1638316800) && !(coinGeckoID == "highstreet" && *timeStamp < 1634263200) {
        Severity: Critical
        Found in services/explorer/consumer/parser/bridgeparser.go - About 1 hr to fix

          Function TestValidatePath has 66 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func TestValidatePath(t *testing.T) {
              // Create a temporary directory for testing
              tmpDir := os.TempDir()
              cacheDir := filepath.Join(tmpDir, "cache")
          
          
          Severity: Minor
          Found in contrib/golang-ci-lint/main_test.go - About 1 hr to fix

            Method Relayer.runChainIndexer has 66 lines of code (exceeds 50 allowed). Consider refactoring.
            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: Minor
            Found in services/rfq/relayer/service/chainindexer.go - About 1 hr to fix

              Method BridgeParser.MatureLogs has 66 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (p *BridgeParser) MatureLogs(ctx context.Context, bridgeEvent *model.BridgeEvent, iFace bridgeTypes.EventLog, chainID uint32) (interface{}, error) {
                  g, groupCtx := errgroup.WithContext(ctx)
                  var err error
                  var sender *string
                  var timeStamp *uint64
              Severity: Minor
              Found in services/explorer/consumer/parser/bridgeparser.go - About 1 hr to fix

                Method MessageBusParser.Parse has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (m *MessageBusParser) Parse(ctx context.Context, log ethTypes.Log, chainID uint32) (interface{}, error) {
                    logTopic := log.Topics[0]
                    iFace, err := func(log ethTypes.Log) (messageBusTypes.EventLog, error) {
                        switch logTopic {
                        case messagebus.Topic(messageBusTypes.ExecutedEvent):
                Severity: Minor
                Found in services/explorer/consumer/parser/messagebusparser.go - About 1 hr to fix

                  Method ScribeSuite.TestSimulatedScribe has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (s *ScribeSuite) TestSimulatedScribe() {
                      if os.Getenv("CI") != "" {
                          s.T().Skip("Test flake: 20 sec of livefilling may fail on CI")
                      }
                      const numberOfContracts = 3
                  Severity: Minor
                  Found in services/scribe/service/scribe_test.go - About 1 hr to fix

                    Function commify has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const commify = (value: string | number): string => {
                      const comps = String(value).split('.')
                    
                      if (
                        comps.length > 2 ||
                    Severity: Minor
                    Found in packages/synapse-interface/utils/bigint/format.ts - About 1 hr to fix

                      Function formatAmount has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const formatAmount = (
                        amount: string,
                        options?: FormatOptions
                      ): string => {
                        if (amount === '') return ''
                      Severity: Minor
                      Found in packages/synapse-interface/utils/formatAmount.ts - About 1 hr to fix

                        Function constructor has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          constructor({
                            addresses,
                            wrapperAddresses,
                            decimals,
                            symbol,
                        Severity: Minor
                        Found in packages/synapse-constants/src/types/index.ts - About 1 hr to fix

                          Function getSynapsePauseData has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const getSynapsePauseData = () => {
                            const fetchAndStoreData = async () => {
                              if (isFetching) {
                                return
                              }
                          Severity: Minor
                          Found in packages/widget/src/utils/getSynapsePauseData.ts - About 1 hr to fix

                            Function ConnectWalletButton has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function ConnectWalletButton() {
                              const [clientReady, setClientReady] = useState<boolean>(false)
                              const { address } = useAccount()
                            
                              const t = useTranslations('Wallet')

                              Method queryResolver.LogsRange has 13 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              func (r *queryResolver) LogsRange(ctx context.Context, contractAddress *string, chainID int, blockNumber *int, txHash *string, txIndex *int, blockHash *string, index *int, confirmed *bool, startBlock int, endBlock int, page int, asc *bool) ([]*model.Log, error) {
                              Severity: Major
                              Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

                                Method Guard.updateAgentStatus has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func (g Guard) updateAgentStatus(ctx context.Context, chainID uint32) error {
                                    eligibleAgentTrees, err := g.guardDB.GetRelayableAgentStatuses(ctx, chainID)
                                    if err != nil {
                                        return fmt.Errorf("could not get update agent status parameters: %w", err)
                                    }
                                Severity: Minor
                                Found in agents/agents/guard/fraud.go - About 1 hr to fix

                                  Function getChainBackfiller has 65 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func getChainBackfiller(consumerDB db.ConsumerDB, chainConfig indexerConfig.ChainConfig, fetcher fetcherpkg.ScribeFetcher, client bind.ContractBackend, tokenDataService tokendata.Service, priceDataService tokenprice.Service) (*backfill.ChainBackfiller, error) {
                                      var err error
                                      var bridgeParser *parser.BridgeParser
                                      var messageBusParser *parser.MessageBusParser
                                      var cctpParser *parser.CCTPParser
                                  Severity: Minor
                                  Found in services/explorer/node/explorer.go - About 1 hr to fix

                                    Function use_TransactionsListener has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const use_TransactionsListener = () => {
                                      const dispatch = useAppDispatch()
                                      const { pendingBridgeTransactions } = useTransactionsState()
                                      const { transactions } = use_TransactionsState()
                                      const { address } = useAccount()
                                    Severity: Minor
                                    Found in packages/synapse-interface/utils/hooks/use_TransactionsListener.ts - About 1 hr to fix

                                      Function recentInvalidRelaysController has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const recentInvalidRelaysController = async (
                                        req: Request,
                                        res: Response
                                      ) => {
                                        try {
                                      Severity: Minor
                                      Found in packages/rfq-indexer/api/src/controllers/invalidRelaysController.ts - About 1 hr to fix

                                        Function Instructions has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function Instructions() {
                                          return (
                                            <article>
                                              <h2>
                                                <Install />
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language