synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Function constructJSON has a Cognitive Complexity of 47 (exceeds 5 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 7 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

Config has 51 methods (exceeds 20 allowed). Consider refactoring.
Open

func (c Config) getChainConfigValue(chainID int, fieldName string) (interface{}, error) {
    chainConfig, ok := c.Chains[chainID]
    if ok {
        value, err := getFieldValue(chainConfig, fieldName)
        if err != nil {
Severity: Major
Found in services/rfq/relayer/relconfig/getters.go - About 7 hrs to fix

    Function executeBridge has 175 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const executeBridge = async () => {
        let pendingPopup: any
    
        const currentTimestamp: number = getUnixTimeMinutesFromNow(0)
    
    
    Severity: Major
    Found in packages/synapse-interface/pages/state-managed-bridge/index.tsx - About 7 hrs to fix

      File client.go has 707 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      // Code generated by github.com/Yamashou/gqlgenc, DO NOT EDIT.
      
      package client
      
      import (
      Severity: Minor
      Found in services/explorer/graphql/client/client.go - About 7 hrs to fix

        Chain has 49 methods (exceeds 20 allowed). Consider refactoring.
        Open

        type Chain struct {
            mock.Mock
        }
        Severity: Minor
        Found in ethergo/chain/mocks/chain.go - About 6 hrs to fix

          File networks.ts has 451 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { CHAINS } from '@synapsecns/synapse-constants'
          
          const ChainId = CHAINS.ChainId
          
          const ETH_CURRENCY_TEXT_CLASSNAME = 'text-[#5170ad] dark:text-[#78a5ff]'
          Severity: Minor
          Found in packages/explorer-ui/utils/styles/networks.ts - About 6 hrs to fix

            Method ExecutorSuite.TestSendManagerMessage has 195 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (e *ExecutorSuite) TestSendManagerMessage() {
                // This test requires a call to anvil's evm.IncreaseTime() cheat code, so we should
                // set up the backends with anvil.
            
                testDone := false
            Severity: Major
            Found in agents/agents/executor/executor_test.go - About 6 hrs to fix

              File getters.go has 698 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              package relconfig
              
              import (
                  "fmt"
                  "math/big"
              Severity: Minor
              Found in services/rfq/relayer/relconfig/getters.go - About 6 hrs to fix

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

                import { StandardPageContainer } from '@components/layouts/StandardPageContainer'
                
                export const Terms = () => {
                  return (
                    <StandardPageContainer title="Terms of Service">
                Severity: Minor
                Found in packages/explorer-ui/pages/terms/index.tsx - About 6 hrs to fix

                  Method executionContext._Transaction has 190 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (ec *executionContext) _Transaction(ctx context.Context, sel ast.SelectionSet, obj *model.Transaction) graphql.Marshaler {
                      fields := graphql.CollectFields(ec.OperationContext, sel, transactionImplementors)
                  
                      out := graphql.NewFieldSet(fields)
                      deferred := make(map[string]*graphql.FieldSet)
                  Severity: Major
                  Found in services/explorer/consumer/client/resolver-client/server.go - About 6 hrs to fix

                    Method executionContext._Transaction has 190 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (ec *executionContext) _Transaction(ctx context.Context, sel ast.SelectionSet, obj *model.Transaction) graphql.Marshaler {
                        fields := graphql.CollectFields(ec.OperationContext, sel, transactionImplementors)
                    
                        out := graphql.NewFieldSet(fields)
                        deferred := make(map[string]*graphql.FieldSet)
                    Severity: Major
                    Found in services/scribe/graphql/server/graph/resolver/server.go - About 6 hrs to fix

                      File i_gas_oracle.go has 685 lines of code (exceeds 500 allowed). Consider refactoring.
                      Open

                      // Code generated by mockery v2.14.0. DO NOT EDIT.
                      
                      package mocks
                      
                      import (
                      Severity: Minor
                      Found in agents/contracts/gasoracle/mocks/i_gas_oracle.go - About 6 hrs to fix

                        Function Txs has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const Txs = () => {
                          const search = useSearchParams()
                          const p = Number(search.get('p'))
                          const hashSearch = String(search.get('hash'))
                        
                        
                        Severity: Minor
                        Found in packages/explorer-ui/pages/txs/index.tsx - About 6 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

                        IOrigin has 46 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        type IOrigin struct {
                            mock.Mock
                        }
                        Severity: Minor
                        Found in agents/contracts/origin/mocks/i_origin.go - About 6 hrs to fix

                          Function standardizeResponse has a Cognitive Complexity of 56 (exceeds 20 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: Minor
                          Found in services/omnirpc/proxy/standardize.go - About 6 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

                          File FastBridgeRouter.ts has 422 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* Autogenerated file. Do not edit manually. */
                          /* tslint:disable */
                          /* eslint-disable */
                          import type {
                            BaseContract,
                          Severity: Minor
                          Found in packages/sdk-router/src/typechain/FastBridgeRouter.ts - About 6 hrs to fix

                            Function Token has 151 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const Token = () => {
                              const router = useRouter()
                              const { tokenAddress } = router.query
                              const search = useSearchParams()
                              const chain_id = Number(search.get('chainId')) || 1
                            Severity: Major
                            Found in packages/explorer-ui/pages/token/[tokenAddress].tsx - About 6 hrs to fix

                              Method executionContext._Receipt has 175 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (ec *executionContext) _Receipt(ctx context.Context, sel ast.SelectionSet, obj *model.Receipt) graphql.Marshaler {
                                  fields := graphql.CollectFields(ec.OperationContext, sel, receiptImplementors)
                              
                                  out := graphql.NewFieldSet(fields)
                                  deferred := make(map[string]*graphql.FieldSet)
                              Severity: Major
                              Found in services/explorer/consumer/client/resolver-client/server.go - About 6 hrs to fix

                                Method executionContext._Receipt has 175 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func (ec *executionContext) _Receipt(ctx context.Context, sel ast.SelectionSet, obj *model.Receipt) graphql.Marshaler {
                                    fields := graphql.CollectFields(ec.OperationContext, sel, receiptImplementors)
                                
                                    out := graphql.NewFieldSet(fields)
                                    deferred := make(map[string]*graphql.FieldSet)
                                Severity: Major
                                Found in services/scribe/graphql/server/graph/resolver/server.go - About 6 hrs to fix

                                  File metered_evm_client.go has 664 lines of code (exceeds 500 allowed). Consider refactoring.
                                  Open

                                  // Code generated by mockery v2.14.0. DO NOT EDIT.
                                  
                                  package mocks
                                  
                                  import (
                                  Severity: Minor
                                  Found in ethergo/chain/client/mocks/metered_evm_client.go - About 5 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language