synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Function applyBridgeSlippage has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  this: SynapseSDK,
  bridgeModuleName: string,
  originQueryInitial: Query,
  destQueryInitial: Query,
  slipNumerator: number = 10,
Severity: Minor
Found in packages/sdk-router/src/operations/bridge.ts - About 45 mins to fix

    Function Col has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export const Col = ({
      children,
      xs,
      sm,
      md,
    Severity: Minor
    Found in packages/explorer-ui/components/tailwind/Col.tsx - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function txErrorHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export const txErrorHandler = (err: any) => {
      if (err?.details && checkStringForRejection(err?.details)) {
        return toast.error('User denied transaction', {
          id: 'toast-error-user-reject',
          duration: 5000,
    Severity: Minor
    Found in packages/synapse-interface/utils/txErrorHandler.tsx - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function fetchTokenBalances has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export const fetchTokenBalances = async ({
      address,
      chainId,
      tokens,
      signerOrProvider,
    Severity: Minor
    Found in packages/widget/src/utils/actions/fetchTokenBalances.ts - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function setOriginToken has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        setOriginToken: (
          state: BridgeState,
          action: PayloadAction<BridgeableToken>
        ) => {
          const incomingFromToken = action.payload
    Severity: Minor
    Found in packages/widget/src/state/slices/bridge/reducer.ts - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function _Transaction has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export const _Transaction = ({
      connectedAddress,
      destinationAddress,
      originValue,
      originChain,
    Severity: Minor
    Found in packages/synapse-interface/components/_Transaction/_Transaction.tsx - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function LinearAnimatedProgressBar has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      ({
        id,
        startDate,
        endDate,
      }: {

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function TokenOption has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export const TokenOption = ({
      option,
      onSelect,
      selected,
      parsedBalance,
    Severity: Minor
    Found in packages/widget/src/components/ui/TokenOption.tsx - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function LinearAnimatedProgressBar has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      ({
        id,
        startDate,
        endDate,
      }: {
    Severity: Minor
    Found in packages/widget/src/components/Maintenance/LinearAnimatedProgressBar.tsx - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function getMaintenanceData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export const getMaintenanceData = () => {
      const { pausedChainsData, pausedModulesData } = getSynapsePauseData()
    
      const pausedChainsList: ChainPause[] = pausedChainsData
        ? pausedChainsData?.map((pause: ChainPause) => {
    Severity: Minor
    Found in packages/widget/src/components/Maintenance/Maintenance.tsx - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method ListenerTestSuite.TestListenForEvents has 6 return statements (exceeds 4 allowed).
    Open

    func (l *ListenerTestSuite) TestListenForEvents() {
        _, handle := l.manager.GetCounter(l.GetTestContext(), l.backend)
        var wg sync.WaitGroup
        const iterations = 10
        for i := 0; i < iterations; i++ {
    Severity: Major
    Found in ethergo/listener/listener_test.go - About 40 mins to fix

      Function extractBinary has 6 return statements (exceeds 4 allowed).
      Open

      func extractBinary(_ context.Context, tarPath, destPath string) error {
          // Validate paths before operations
          if err := validatePath(tarPath, os.TempDir()); err != nil {
              return fmt.Errorf("invalid tar file path: %w", err)
          }
      Severity: Major
      Found in contrib/golang-ci-lint/main.go - About 40 mins to fix

        Method Bot.makeFastBridge has 6 return statements (exceeds 4 allowed).
        Open

        func (b *Bot) makeFastBridge(ctx context.Context, chainID uint32) (*fastbridge.FastBridge, error) {
            client, err := rfqClient.NewUnauthenticatedClient(b.handler, b.cfg.RFQApiURL)
            if err != nil {
                return nil, fmt.Errorf("error creating rfq client: %w", err)
            }
        Severity: Major
        Found in contrib/opbot/botmd/commands.go - About 40 mins to fix

          Function getChangedFilesFromAPI has 6 return statements (exceeds 4 allowed).
          Open

          func getChangedFilesFromAPI(ctx context.Context, ghContext *actionscore.Context, client *github.Client) (ct tree.Tree, err error) {
              var gpe github.PullRequestEvent
              // TODO: should rap into context
              f, err := os.Open(os.Getenv("GITHUB_EVENT_PATH"))
              if err != nil {
          Severity: Major
          Found in contrib/git-changes-action/detector/git/ref.go - About 40 mins to fix

            Method fileRateLimiter.releaseLock has 6 return statements (exceeds 4 allowed).
            Open

            func (f *fileRateLimiter) releaseLock() (ok bool, err error) {
                f.mux.Unlock()
            
                err = f.openFile()
                if err != nil {
            Severity: Major
            Found in tools/abigen/internal/etherscan/ratelimiter.go - About 40 mins to fix

              Function CopyModule has 6 return statements (exceeds 4 allowed).
              Open

              func CopyModule(toCopy, dest, packageName string) error {
                  // walk through the dir, see: https://github.com/markbates/pkger/blob/09e9684b656b/examples/app/main.go#L29
                  info, err := pkger.Info(toCopy)
                  if err != nil {
                      return fmt.Errorf("could not resolve %s", toCopy)
              Severity: Major
              Found in tools/modulecopier/internal/copy.go - About 40 mins to fix

                Function InitNotaryDB has 6 return statements (exceeds 4 allowed).
                Open

                func InitNotaryDB(parentCtx context.Context, database string, path string, tablePrefix string, handler metrics.Handler) (_ db.NotaryDB, err error) {
                    ctx, span := handler.Tracer().Start(parentCtx, "InitNotaryDB", trace.WithAttributes(
                        attribute.String("database", database),
                        attribute.String("path", path),
                        attribute.String("tablePrefix", tablePrefix),
                Severity: Major
                Found in agents/agents/notary/cmd/commands.go - About 40 mins to fix

                  Function getSearchRange has 6 return statements (exceeds 4 allowed).
                  Open

                  func getSearchRange(ctx context.Context, client ethereum.ChainReader, startHeight *big.Int) (_ *blockRange, err error) {
                      var output blockRange
                      if startHeight == nil || startHeight.Cmp(big.NewInt(0)) == 0 {
                          startHeight = big.NewInt(1)
                      }
                  Severity: Major
                  Found in ethergo/chain/block.go - About 40 mins to fix

                    Function downloadFile has 6 return statements (exceeds 4 allowed).
                    Open

                    func downloadFile(ctx context.Context, url string, tmpFile *os.File) error {
                        client := setupHTTPClient()
                        req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
                        if err != nil {
                            return fmt.Errorf("failed to create request: %w", err)
                    Severity: Major
                    Found in contrib/golang-ci-lint/main.go - About 40 mins to fix

                      Method clientImpl.checkBlacklist has 6 return statements (exceeds 4 allowed).
                      Open

                      func (c *clientImpl) checkBlacklist(ctx context.Context, address string) (bool, error) {
                          var resp *resty.Response
                          // Retry until the user is registered.
                          err := retry.WithBackoff(ctx,
                              func(ctx context.Context) (err error) {
                      Severity: Major
                      Found in contrib/screener-api/chainalysis/chainalysisapi.go - About 40 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language