synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

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

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

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

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

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

  async (
    {
      synapseSDK,
      fromChainId,
      toChainId,
Severity: Minor
Found in packages/synapse-interface/slices/bridgeQuote/thunks.ts - About 1 hr 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 UniversalSearch has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export const UniversalSearch = ({
  setPending,
  pending,
  loading,
  setWallet,

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 DBSuite.TestGetTimestampForMessage has 72 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (t *DBSuite) TestGetTimestampForMessage() {
    t.RunOnAllDBs(func(testDB db.ExecutorDB) {
        origin := gofakeit.Uint32()
        nonceA := uint32(5)
        nonceB := uint32(10)
Severity: Minor
Found in agents/agents/executor/db/crosstable_test.go - About 1 hr to fix

    Function printMaps has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const printMaps = async () => {
      const bridgeMap = {}
      console.log('Starting on chains: ', Object.keys(providers))
    
      const rfqResponse = await fetchRfqData()
    Severity: Minor
    Found in packages/synapse-interface/scripts/generateMaps.js - About 1 hr to fix

      Function useToChainListArray has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const useToChainListArray = (searchStr: string = '') => {
        const { toChainIds } = useBridgeState()
        const t = useTranslations('Bridge')
      
        let possibleChains = _(ALL_CHAINS)

        Function createApplySlippageTests has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            const createApplySlippageTests = (moduleSet: SynapseModuleSet) => {
              describe(`${moduleSet.bridgeModuleName} module`, () => {
                beforeEach(() => {
                  jest.spyOn(moduleSet, 'applySlippage').mockImplementation(jest.fn())
                })
        Severity: Minor
        Found in packages/sdk-router/src/sdk.test.ts - About 1 hr to fix

          Function loadConfig has 71 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func loadConfig() *signoz.Client {
              cfg := config{}
          
              var configFormFields []huh.Field
          
          
          Severity: Minor
          Found in contrib/opbot/signoz/example/main.go - About 1 hr to fix

            Method ExecutorSuite.TestVerifyState has 71 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (e *ExecutorSuite) TestVerifyState() {
                chainID := uint32(e.TestBackendOrigin.GetChainID())
                destination := uint32(e.TestBackendDestination.GetChainID())
            
                excCfg := execConfig.Config{
            Severity: Minor
            Found in agents/agents/executor/executor_test.go - About 1 hr to fix

              Method APISuite.TestDailyStatisticsByChain has 71 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (g APISuite) TestDailyStatisticsByChain() {
                  chainID := g.chainIDs[0]
                  destinationChainIDA := g.chainIDs[1]
                  destinationChainIDB := g.chainIDs[2]
                  address := common.BigToAddress(big.NewInt(gofakeit.Int64()))
              Severity: Minor
              Found in services/explorer/api/resolver_test.go - About 1 hr to fix

                Function useFromChainListArray has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const useFromChainListArray = (searchStr: string = '') => {
                  const { fromChainIds } = useBridgeState()
                
                  const t = useTranslations('Bridge')
                
                

                  Method Guard.handleStatusUpdated has 20 return statements (exceeds 4 allowed).
                  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: Major
                  Found in agents/agents/guard/fraud.go - About 1 hr to fix

                    Method txSubmitterImpl.chainPendingQueue has 70 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (t *txSubmitterImpl) chainPendingQueue(parentCtx context.Context, chainID *big.Int, txes []db.TX) (err error) {
                        ctx, span := t.metrics.Tracer().Start(parentCtx, "submitter.ChainQueue", trace.WithAttributes(
                            attribute.String("chain_id", chainID.String()),
                        ))
                        defer func() {
                    Severity: Minor
                    Found in ethergo/submitter/chain_queue.go - About 1 hr to fix

                      Method QuoteRequestHandler.handleProofPosted has 70 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func (q *QuoteRequestHandler) handleProofPosted(ctx context.Context, span trace.Span, request reldb.QuoteRequest) (err error) {
                          // we shouldnt' check the claim yet
                          if !q.shouldCheckClaim(request) {
                              return nil
                          }
                      Severity: Minor
                      Found in services/rfq/relayer/service/handlers.go - About 1 hr to fix

                        Method BackfillSuite.withdrawAndRemoveParity has 70 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (b *BackfillSuite) withdrawAndRemoveParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
                            // parse the log
                            if useV1 {
                                parsedLog, err := parser.Filterer.ParseTokenWithdrawAndRemove(*log)
                                if err != nil {
                        Severity: Minor
                        Found in services/explorer/backfill/chain_test.go - About 1 hr to fix

                          Function TestNewBufferedPipe has 70 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func TestNewBufferedPipe(t *testing.T) {
                              t.Run("Write and read data", func(t *testing.T) {
                                  pipe := processlog.NewBufferedPipe()
                          
                                  testData := []byte("Hello, World!")
                          Severity: Minor
                          Found in core/processlog/stream_test.go - About 1 hr to fix

                            Function useSyncQueryParamsWithBridgeState has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const useSyncQueryParamsWithBridgeState = () => {
                              const dispatch = useDispatch()
                              const router = useRouter()
                              const { fromChainId, fromToken, toChainId, toToken } = useBridgeState()
                            
                            
                              Severity
                              Category
                              Status
                              Source
                              Language