synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Function StateManagedBridge has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

const StateManagedBridge = () => {
  const dispatch = useAppDispatch()
  const { address, isConnected, chain: connectedChain } = useAccount()
  const { balances } = usePortfolioState()
  const { synapseSDK } = useSynapseContext()
Severity: Minor
Found in packages/synapse-interface/pages/state-managed-bridge/index.tsx - About 1 day 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 ProxySuite.TestParseRPCPayload has 260 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (p *ProxySuite) TestParseRPCPayload() {
    /*
      CHECK BLOCKS
    */

Severity: Major
Found in services/omnirpc/proxy/confirmable_test.go - About 1 day to fix

    Function DestinationAddressInput has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
    Open

    export const DestinationAddressInput = ({
      connectedAddress,
    }: {
      connectedAddress: string
    }) => {

    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 BridgeFlow has 226 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const BridgeFlow = () => {
      return (
        <svg
          width="100%"
          viewBox="-240 0 480 164"
    Severity: Major
    Found in docs/bridge/src/components/BridgeFlow.tsx - About 1 day to fix

      Method executionContext._Query has 248 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
          fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
          ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
              Object: "Query",
          })
      Severity: Major
      Found in services/explorer/graphql/server/graph/resolver/server.go - About 1 day to fix

        Function Home has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
        Open

        export const Home = () => {
          const [platform, setPlatform] = useState('ALL')
          const [transactionsArr, setTransactionsArr] = useState([])
          const [dailyDataArr, setDailyDataArr] = useState([])
          const [kappa, setKappa] = useState('')
        Severity: Minor
        Found in packages/explorer-ui/components/pages/Home/index.tsx - About 1 day 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 chain.go has 779 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        // Code generated by mockery v2.14.0. DO NOT EDIT.
        
        package mocks
        
        import (
        Severity: Major
        Found in ethergo/chain/mocks/chain.go - About 1 day to fix

          Method executionContext._Query has a Cognitive Complexity of 70 (exceeds 20 allowed). Consider refactoring.
          Open

          func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
              fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
              ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
                  Object: "Query",
              })
          Severity: Minor
          Found in services/explorer/graphql/server/graph/resolver/server.go - About 1 day 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 tokens.ts has 523 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          const ColorOptions = {
            GRAY: 'gray',
            YELLOW: 'yellow',
            GREEN: 'green',
            LIME: 'lime',
          Severity: Major
          Found in packages/synapse-interface/styles/tokens.ts - About 1 day to fix

            Method SwapParser.Parse has 238 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (p *SwapParser) Parse(ctx context.Context, log ethTypes.Log, chainID uint32) (interface{}, error) {
                logTopic := log.Topics[0]
            
                iFace, err := func(log ethTypes.Log) (swapTypes.EventLog, error) {
                    // nolint:nestif
            Severity: Major
            Found in services/explorer/consumer/parser/swapparser.go - About 1 day to fix

              File getFromTokens.test.ts has 521 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { expect } from '@jest/globals'
              
              import { getFromTokens } from '@/utils/routeMaker/getFromTokens'
              import { mockRoutes } from './__fixtures__/mockRoutes'
              
              
              Severity: Major
              Found in packages/synapse-interface/__tests__/getFromTokens.test.ts - About 1 day to fix

                ILightManager has 59 methods (exceeds 20 allowed). Consider refactoring.
                Open

                type ILightManager struct {
                    mock.Mock
                }
                Severity: Major
                Found in agents/contracts/lightmanager/mocks/i_light_manager.go - About 1 day to fix

                  File coins.ts has 520 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {
                    BUSD,
                    USDT,
                    USDC,
                    DAI,
                  Severity: Major
                  Found in packages/explorer-ui/utils/styles/coins.ts - About 1 day to fix

                    Method BridgeParser.ParseLog has a Cognitive Complexity of 69 (exceeds 20 allowed). Consider refactoring.
                    Open

                    func (p *BridgeParser) ParseLog(log ethTypes.Log, chainID uint32) (*model.BridgeEvent, bridgeTypes.EventLog, error) {
                        logTopic := log.Topics[0]
                    
                        iFace, err := func(log ethTypes.Log) (bridgeTypes.EventLog, error) {
                            switch logTopic {
                    Severity: Minor
                    Found in services/explorer/consumer/parser/bridgeparser.go - About 1 day 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 master.ts has 509 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { Chain } from '../../types'
                    
                    export const ETH: Chain = {
                      priorityRank: 100,
                      id: 1,
                    Severity: Major
                    Found in packages/synapse-constants/src/constants/chains/master.ts - About 1 day to fix

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

                      import toast from 'react-hot-toast'
                      import { useEffect, useRef, useState } from 'react'
                      import { Address, zeroAddress, isAddress } from 'viem'
                      import { polygon } from 'viem/chains'
                      import { useAccount } from 'wagmi'
                      Severity: Major
                      Found in packages/synapse-interface/pages/state-managed-bridge/index.tsx - About 1 day to fix

                        Function TestToChainConfig has 226 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func TestToChainConfig(t *testing.T) {
                            chainID := big.NewInt(1)
                        
                            tests := []struct {
                                name      string
                        Severity: Major
                        Found in ethergo/backends/anvil/hardfork_test.go - About 1 day to fix

                          Function TestChainGetters has 226 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func TestChainGetters(t *testing.T) {
                              chainID := 1
                              badChainID := 2
                              usdcAddr := "0x123"
                              cfgWithBase := relconfig.Config{
                          Severity: Major
                          Found in services/rfq/relayer/relconfig/config_test.go - About 1 day to fix

                            Function APIFlow has 199 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const APIFlow = () => {
                              return (
                                <svg
                                  width="100%"
                                  viewBox="-240 0 480 120"
                            Severity: Major
                            Found in docs/bridge/src/components/APIFlow.tsx - About 7 hrs to fix

                              Method ScribeSuite.TestLivefillParity has 223 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (s *ScribeSuite) TestLivefillParity() {
                                  if os.Getenv("CI") != "" {
                                      s.T().Skip("Network test flake")
                                  }
                                  const blockRange = uint64(100)
                              Severity: Major
                              Found in services/scribe/service/scribe_test.go - About 7 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language