synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Method DBSuite.TestStoreRetrieveReceipt has 87 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (t *DBSuite) TestStoreRetrieveReceipt() {
    t.RunOnAllDBs(func(testDB db.EventDB) {
        txHashRandom := gofakeit.Int64()
        chainID := gofakeit.Uint32()
        txHashA := common.BigToHash(big.NewInt(txHashRandom))
Severity: Major
Found in services/scribe/db/receipt_test.go - About 2 hrs to fix

    Function useValidations has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const useValidations = (): {
      hasValidSelections: boolean
      hasEnoughBalance: boolean
      isInputValid: boolean
      isApproved: boolean
    Severity: Major
    Found in packages/widget/src/hooks/useValidations.tsx - About 2 hrs to fix

      Method txSubmitterImpl.processQueue has 86 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (t *txSubmitterImpl) processQueue(parentCtx context.Context) (err error) {
          // TODO: this might be too short of a deadline depending on the number of pendingTxes in the queue
          deadlineCtx, cancel := context.WithTimeout(parentCtx, time.Second*60)
          defer cancel()
      
      
      Severity: Major
      Found in ethergo/submitter/queue.go - About 2 hrs to fix

        Method APISuite.TestGetCountByChainID has 86 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (g APISuite) TestGetCountByChainID() {
            chainID := g.chainIDs[0]
            chainID2 := g.chainIDs[1]
            chainID3 := g.chainIDs[2]
            address := common.BigToAddress(big.NewInt(gofakeit.Int64()))
        Severity: Major
        Found in services/explorer/api/resolver_test.go - About 2 hrs to fix

          Method IndexerSuite.TestGetLogsSimulated has 86 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (x *IndexerSuite) TestGetLogsSimulated() {
              // Get simulated blockchain, deploy the test contract, and set up test variables.
              simulatedChain := geth.NewEmbeddedBackendForChainID(x.GetSuiteContext(), x.T(), big.NewInt(3))
              simulatedClient, err := backend.DialBackend(x.GetTestContext(), simulatedChain.RPCAddress(), x.metrics)
              Nil(x.T(), err)
          Severity: Major
          Found in services/scribe/service/indexer/indexer_test.go - About 2 hrs to fix

            File getFromChainIds.ts has 268 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import _ from 'lodash'
            
            import { EXISTING_BRIDGE_ROUTES } from '@/constants/existingBridgeRoutes'
            import { RouteQueryFields } from './generateRoutePossibilities'
            import { getTokenAndChainId } from './getTokenAndChainId'
            Severity: Minor
            Found in packages/synapse-interface/utils/routeMaker/getFromChainIds.ts - About 2 hrs to fix

              File getFromChainIds.ts has 268 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import _ from 'lodash'
              
              import { EXISTING_BRIDGE_ROUTES } from '@/constants/existingBridgeRoutes'
              import { RouteQueryFields } from './generateRoutePossibilities'
              import { getTokenAndChainId } from './getTokenAndChainId'
              Severity: Minor
              Found in packages/widget/src/utils/routeMaker/getFromChainIds.ts - About 2 hrs to fix

                File FauxBridge.tsx has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // import PulseDot from '@/components/icons/PulseDot'
                import { useTranslations } from 'next-intl'
                
                import { CHAINS_ARR } from '@/constants/chains'
                import * as BRIDGEABLE from '@constants/tokens/bridgeable'

                  Function GetDeployments has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
                  Open

                  func GetDeployments(deploymentDir string) (contracts []Contract, err error) {
                      var files []os.DirEntry
                  
                      files, err = os.ReadDir(deploymentDir)
                      if err != nil {
                  Severity: Minor
                  Found in ethergo/parser/hardhat/parser.go - About 2 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 executionContext.field_Query_logsAtHeadRange_args has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
                  Open

                  func (ec *executionContext) field_Query_logsAtHeadRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
                      var err error
                      args := map[string]interface{}{}
                      var arg0 *string
                      if tmp, ok := rawArgs["contract_address"]; ok {
                  Severity: Minor
                  Found in services/explorer/consumer/client/resolver-client/server.go - About 2 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 executionContext.field_Query_logsAtHeadRange_args has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
                  Open

                  func (ec *executionContext) field_Query_logsAtHeadRange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
                      var err error
                      args := map[string]interface{}{}
                      var arg0 *string
                      if tmp, ok := rawArgs["contract_address"]; ok {
                  Severity: Minor
                  Found in services/scribe/graphql/server/graph/resolver/server.go - About 2 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 getFromTokens has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getFromTokens = ({
                    fromChainId,
                    fromTokenRouteSymbol,
                    toChainId,
                    toTokenRouteSymbol,
                  Severity: Minor
                  Found in packages/synapse-interface/utils/routeMaker/getFromTokens.ts - About 2 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 getToTokens has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getToTokens = ({
                    fromChainId,
                    fromTokenRouteSymbol,
                    toChainId,
                    toTokenRouteSymbol,
                  Severity: Minor
                  Found in packages/synapse-interface/utils/routeMaker/getToTokens.ts - About 2 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 getFromChainIds has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getFromChainIds = ({
                    fromChainId,
                    fromTokenRouteSymbol,
                    toChainId,
                    toTokenRouteSymbol,
                  Severity: Minor
                  Found in packages/synapse-interface/utils/routeMaker/getFromChainIds.ts - About 2 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 getToChainIds has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getToChainIds = ({
                    fromChainId,
                    fromTokenRouteSymbol,
                    toChainId,
                    toTokenRouteSymbol,
                  Severity: Minor
                  Found in packages/synapse-interface/utils/routeMaker/getToChainIds.ts - About 2 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 getSwapToTokens has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getSwapToTokens = ({
                    fromChainId,
                    fromTokenRouteSymbol,
                    toChainId,
                    toTokenRouteSymbol,
                  Severity: Minor
                  Found in packages/synapse-interface/utils/swapFinder/getSwapToTokens.ts - About 2 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 getSwapFromChainIds has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getSwapFromChainIds = ({
                    fromChainId,
                    fromTokenRouteSymbol,
                    toChainId,
                    toTokenRouteSymbol,
                  Severity: Minor
                  Found in packages/synapse-interface/utils/swapFinder/getSwapFromChainIds.ts - About 2 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 getSwapFromTokens has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getSwapFromTokens = ({
                    fromChainId,
                    fromTokenRouteSymbol,
                    toChainId,
                    toTokenRouteSymbol,
                  Severity: Minor
                  Found in packages/synapse-interface/utils/swapFinder/getSwapFromTokens.ts - About 2 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 getToTokens has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getToTokens = ({
                    fromChainId,
                    fromTokenRouteSymbol,
                    toChainId,
                    toTokenRouteSymbol,
                  Severity: Minor
                  Found in packages/widget/src/utils/routeMaker/getToTokens.ts - About 2 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 getFromChainIds has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const getFromChainIds = ({
                    fromChainId,
                    fromTokenRouteSymbol,
                    toChainId,
                    toTokenRouteSymbol,
                  Severity: Minor
                  Found in packages/widget/src/utils/routeMaker/getFromChainIds.ts - About 2 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