synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Function ImageUploader has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function ImageUploader() {
  const [uploadedImage, setUploadedImage] = useState(null)
  const [processedImage, setProcessedImage] = useState(null)

  const t = useTranslations('ReturnToMonke')
Severity: Major
Found in packages/synapse-interface/pages/returntomonke/ImageUploader.tsx - About 4 hrs to fix

    EVM has 35 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type EVM struct {
        mock.Mock
    }
    Severity: Minor
    Found in ethergo/client/mocks/evm.go - About 4 hrs to fix

      EVMClient has 35 methods (exceeds 20 allowed). Consider refactoring.
      Open

      type EVMClient struct {
          mock.Mock
      }
      Severity: Minor
      Found in ethergo/chain/client/mocks/evm_client.go - About 4 hrs to fix

        DeployManager has 35 methods (exceeds 20 allowed). Consider refactoring.
        Open

        func (d *DeployManager) GetOrigin(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *origin.OriginRef) {
            d.T().Helper()
        
            return manager.GetContract[*origin.OriginRef](ctx, d.T(), d, backend, OriginType)
        }
        Severity: Minor
        Found in agents/testutil/typecast.go - About 4 hrs to fix

          File index.tsx has 353 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { TRANSACTIONS_PATH } from '@urls'
          import { useState, useEffect } from 'react'
          import { OverviewChart } from '@components/ChainChart'
          import TextField from '@mui/material/TextField'
          import { inputStyle } from '@utils/styles/muiStyles'
          Severity: Minor
          Found in packages/explorer-ui/components/pages/Home/index.tsx - About 4 hrs to fix

            Method Executor.executeExecutable has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
            Open

            func (e Executor) executeExecutable(parentCtx context.Context, chainID uint32) (err error) {
                backoffInterval := time.Duration(0)
                for {
                    select {
                    case <-parentCtx.Done():
            Severity: Minor
            Found in agents/agents/executor/executor.go - About 4 hrs 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 Guard.handleStatusUpdated has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
            Open

            func (g Guard) handleStatusUpdated(ctx context.Context, log ethTypes.Log, chainID uint32) error {
                statusUpdated, err := g.bondingManagerParser.ParseStatusUpdated(log)
                if err != nil {
                    return fmt.Errorf("could not parse status updated: %w", err)
                }
            Severity: Minor
            Found in agents/agents/guard/fraud.go - About 4 hrs 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 Grid has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function Grid({
              children,
              cols,
              gap,
              gapX,
            Severity: Minor
            Found in packages/synapse-interface/components/ui/tailwind/Grid.tsx - About 4 hrs 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 SynapseLogoWithTitleSvg has 109 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function SynapseLogoWithTitleSvg() {
              return (
                <svg
                  width="169"
                  height="36"

              File swapEthWrapper.ts has 345 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              export const SWAP_ETH_WRAPPER_ABI = [
                {
                  inputs: [
                    {
                      internalType: 'address payable',
              Severity: Minor
              Found in packages/synapse-interface/constants/abis/swapEthWrapper.ts - About 4 hrs to fix

                File index.tsx has 345 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { BigNumber } from '@ethersproject/bignumber'
                import * as CHAINS from '@constants/chains/master'
                import { getAddress } from 'viem'
                
                export type Chain = {
                Severity: Minor
                Found in packages/synapse-interface/utils/types/index.tsx - About 4 hrs to fix

                  Function TestNewContext has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring.
                  Open

                  func TestNewContext(t *testing.T) {
                      unsetGithubRepo(t)
                      t.Run("with GITHUB_EVENT_PATH set", func(t *testing.T) {
                          res := mock.MustMarshal(github.PushEvent{
                              Repo: &github.PushEventRepository{
                  Severity: Minor
                  Found in contrib/git-changes-action/detector/actionscore/context_test.go - About 4 hrs 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 Grid has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const Grid = ({
                    children,
                    cols,
                    gap,
                    gapX,
                  Severity: Minor
                  Found in packages/explorer-ui/components/tailwind/Grid.tsx - About 4 hrs 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 standardizeResponse has 131 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func standardizeResponse(ctx context.Context, req *rpc.Request, rpcMessage JSONRPCMessage) (out []byte, err error) {
                      // TODO: use a sync.pool for acquiring/releasing these structs
                      method := req.Method
                  
                  OUTER:
                  Severity: Major
                  Found in services/omnirpc/proxy/standardize.go - About 4 hrs to fix

                    Function SynapseLogoSvg has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const SynapseLogoSvg = () => {
                      return (
                        <svg
                          width="39"
                          height="36"
                    Severity: Major
                    Found in packages/explorer-ui/components/layouts/MainLayout/SynapseLogoSvg.tsx - About 4 hrs to fix

                      Function SynapseLogoSvg has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function SynapseLogoSvg() {
                        return (
                          <svg
                            width="39"
                            height="36"

                        Function UniversalMoneyMarketsIcon has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function UniversalMoneyMarketsIcon() {
                          return (
                            <svg
                              width="335"
                              height="196"

                          File [chainId].tsx has 341 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import _ from 'lodash'
                          import { useState, useEffect } from 'react'
                          import { useRouter } from 'next/router'
                          import { CHAINS } from '@synapsecns/synapse-constants'
                          import { useLazyQuery, useQuery } from '@apollo/client'
                          Severity: Minor
                          Found in packages/explorer-ui/pages/chain/[chainId].tsx - About 4 hrs to fix

                            Client has 33 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            type Client struct {
                                *rpc.Client
                            }
                            Severity: Minor
                            Found in ethergo/backends/anvil/client.go - About 4 hrs to fix

                              Function GetDefiLlamaData has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
                              Open

                              func GetDefiLlamaData(ctx context.Context, timestamp int, coinGeckoID string) *float64 {
                                  zero := float64(0)
                              
                                  if coinGeckoID == "NO_TOKEN" || coinGeckoID == "NO_PRICE" {
                                      // if there is no data on the token, the amount returned will be 1:1 (price will be same as the amount of token
                              Severity: Minor
                              Found in services/explorer/consumer/fetcher/pricefetcher.go - About 4 hrs 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

                              Severity
                              Category
                              Status
                              Source
                              Language