synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Method executionContext._Log has 173 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (ec *executionContext) _Log(ctx context.Context, sel ast.SelectionSet, obj *model.Log) graphql.Marshaler {
    fields := graphql.CollectFields(ec.OperationContext, sel, logImplementors)

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Major
Found in services/explorer/consumer/client/resolver-client/server.go - About 5 hrs to fix

    Method executionContext._Log has 173 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

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

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

      func (ec *executionContext) field_Query_bridgeTransactions_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["chainIDFrom"]; ok {
      Severity: Minor
      Found in services/explorer/graphql/server/graph/resolver/server.go - About 5 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 resolver_test.go has 659 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      package api_test
      
      import (
          gosql "database/sql"
          "fmt"
      Severity: Minor
      Found in services/explorer/api/resolver_test.go - About 5 hrs to fix

        File SynapseCCTPRouter.ts has 407 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/SynapseCCTPRouter.ts - About 5 hrs to fix

          File reducer.ts has 407 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { createSlice, PayloadAction } from '@reduxjs/toolkit'
          import { BridgeableToken } from 'types'
          
          import { getFromTokens } from '@/utils/routeMaker/getFromTokens'
          import { findTokenByRouteSymbol } from '@/utils/findTokenByRouteSymbol'
          Severity: Minor
          Found in packages/widget/src/state/slices/bridge/reducer.ts - About 5 hrs to fix

            Method ExecutorSuite.TestMerkleInsert has 168 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (e *ExecutorSuite) TestMerkleInsert() {
                // TODO (joe and lex): FIX ME
                // e.T().Skip()
                testDone := false
                defer func() {
            Severity: Major
            Found in agents/agents/executor/executor_test.go - About 5 hrs to fix

              Method executionContext.field_Query_bridgeTransactions_args has 165 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (ec *executionContext) field_Query_bridgeTransactions_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["chainIDFrom"]; ok {
              Severity: Major
              Found in services/explorer/graphql/server/graph/resolver/server.go - About 5 hrs to fix

                OptionBuilder has 41 methods (exceeds 20 allowed). Consider refactoring.
                Open

                type OptionBuilder struct {
                    generalOptions
                    evmOptions
                    executorOptions
                    serverOptions
                Severity: Minor
                Found in ethergo/backends/anvil/options.go - About 5 hrs to fix

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

                  import { useAccount } from 'wagmi'
                  import toast from 'react-hot-toast'
                  import { useRouter } from 'next/router'
                  import { useTranslations } from 'next-intl'
                  import deepmerge from 'deepmerge'
                  Severity: Minor
                  Found in packages/synapse-interface/pages/swap/index.tsx - About 5 hrs to fix

                    Function Privacy has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const Privacy = () => {
                      return (
                        <StandardPageContainer title="Privacy Policy">
                          <p className="text-lg font-medium text-white ">
                            Last updated: January, 2023
                    Severity: Major
                    Found in packages/explorer-ui/pages/privacy/index.tsx - About 5 hrs to fix

                      File usdtAbi.ts has 390 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      export const USDT_ABI = [
                        {
                          constant: true,
                          inputs: [],
                          name: 'name',
                      Severity: Minor
                      Found in packages/synapse-interface/constants/abis/usdtAbi.ts - About 5 hrs to fix

                        Method SubmitterSuite.TestSetGasPrice has 157 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (s *SubmitterSuite) TestSetGasPrice() {
                            wall, err := wallet.FromRandom()
                            s.Require().NoError(err)
                        
                            signer := localsigner.NewSigner(wall.PrivateKey())
                        Severity: Major
                        Found in ethergo/submitter/submitter_test.go - About 5 hrs to fix

                          Function BridgeTransactionButton has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const BridgeTransactionButton = ({
                            approveTxn,
                            executeBridge,
                            isApproved,
                            isBridgePaused,

                          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 ExecutorSuite.TestExecutor has 156 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (e *ExecutorSuite) TestExecutor() {
                              // e.T().Skip()
                              testDone := false
                              defer func() {
                                  testDone = true
                          Severity: Major
                          Found in agents/agents/executor/executor_test.go - About 5 hrs to fix

                            File DestinationAddressInput.tsx has 382 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React, { useState, useRef, useEffect } from 'react'
                            import { isNull, isString } from 'lodash'
                            import { useTranslations } from 'next-intl'
                            
                            import { useAppDispatch } from '@/store/hooks'

                              MeteredEVMClient has 39 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              type MeteredEVMClient struct {
                                  mock.Mock
                              }
                              Severity: Minor
                              Found in ethergo/chain/client/mocks/metered_evm_client.go - About 5 hrs to fix

                                File generateMaps.js has 379 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                const { ethers } = require('ethers')
                                
                                const { prettyPrintTS } = require('./utils/prettyPrintTs')
                                const { fetchRfqData } = require('./utils/fetchRfqData')
                                // Provider URLs
                                Severity: Minor
                                Found in packages/synapse-interface/scripts/generateMaps.js - About 5 hrs to fix

                                  Function TestNewContext has 151 lines of code (exceeds 50 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: Major
                                  Found in contrib/git-changes-action/detector/actionscore/context_test.go - About 5 hrs to fix

                                    Method executionContext._Query has 58 return statements (exceeds 4 allowed).
                                    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/consumer/client/resolver-client/server.go - About 5 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language