synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

File poolMaster.ts has 860 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Token } from '../../types'
import * as CHAINS from '../chains/master'
import {
  BUSD,
  USDC,
Severity: Major
Found in packages/synapse-constants/src/constants/tokens/poolMaster.ts - About 2 days to fix

    Method executableSchema.Complexity has 417 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
        ec := executionContext{nil, e, 0, 0, nil}
        _ = ec
        switch typeName + "." + field {
    
    
    Severity: Major
    Found in services/explorer/consumer/client/resolver-client/server.go - About 1 day to fix

      Method executableSchema.Complexity has 417 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
          ec := executionContext{nil, e, 0, 0, nil}
          _ = ec
          switch typeName + "." + field {
      
      
      Severity: Major
      Found in services/scribe/graphql/server/graph/resolver/server.go - About 1 day to fix

        File miniChef.ts has 779 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        export const MINICHEF_ABI = [
          {
            inputs: [
              {
                internalType: 'contract IERC20',
        Severity: Major
        Found in packages/synapse-interface/constants/abis/miniChef.ts - About 1 day to fix

          Method BackfillSuite.TestBackfill has 391 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (b *BackfillSuite) TestBackfill() {
              testChainID := b.testBackend.GetBigChainID()
          
              bridgeContract, bridgeRef := b.testDeployManager.GetTestSynapseBridge(b.GetTestContext(), b.testBackend)
              bridgeV1Contract, bridgeV1Ref := b.testDeployManager.GetTestSynapseBridgeV1(b.GetTestContext(), b.testBackend)
          Severity: Major
          Found in services/explorer/backfill/chain_test.go - About 1 day to fix

            File FastBridgeV2.ts has 774 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            export const FastBridgeV2Abi = [
              {
                inputs: [{ internalType: 'address', name: '_owner', type: 'address' }],
                stateMutability: 'nonpayable',
                type: 'constructor',
            Severity: Major
            Found in packages/rfq-indexer/api/src/constants/abis/FastBridgeV2.ts - About 1 day to fix

              File FastBridgeV2.ts has 774 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              export const FastBridgeV2Abi = [
                {
                  inputs: [{ internalType: 'address', name: '_owner', type: 'address' }],
                  stateMutability: 'nonpayable',
                  type: 'constructor',
              Severity: Major
              Found in packages/rfq-indexer/indexer/abis/FastBridgeV2.ts - About 1 day to fix

                File i_light_inbox.go has 1011 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 agents/contracts/lightinbox/mocks/i_light_inbox.go - About 1 day to fix

                  Function StateManagedSwap has 335 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const StateManagedSwap = () => {
                    const { address } = useAccount()
                    const { synapseSDK } = useSynapseContext()
                    const swapDisplayRef = useRef(null)
                    const quoteToastRef = useRef({ id: '' })
                  Severity: Major
                  Found in packages/synapse-interface/pages/swap/index.tsx - About 1 day to fix

                    File simulated_test_backend.go has 973 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/backends/mocks/simulated_test_backend.go - About 1 day to fix

                      Function Home has 333 lines of code (exceeds 25 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: Major
                      Found in packages/explorer-ui/components/pages/Home/index.tsx - About 1 day to fix

                        Method GuardSuite.TestUpdateAgentStatusOnRemote has 356 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (g *GuardSuite) TestUpdateAgentStatusOnRemote() {
                            // 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/guard/fraud_test.go - About 1 day to fix

                          Method executionContext._Transaction has a Cognitive Complexity of 97 (exceeds 20 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: Minor
                          Found in services/explorer/consumer/client/resolver-client/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

                          Method executionContext._Transaction has a Cognitive Complexity of 97 (exceeds 20 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: Minor
                          Found in services/scribe/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

                          Method executionContext._Query has a Cognitive Complexity of 95 (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/consumer/client/resolver-client/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

                          Method executionContext._Query has a Cognitive Complexity of 95 (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/scribe/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 fraud_test.go has 939 lines of code (exceeds 500 allowed). Consider refactoring.
                          Open

                          package guard_test
                          
                          import (
                              "context"
                              "fmt"
                          Severity: Major
                          Found in agents/agents/guard/fraud_test.go - About 1 day to fix

                            Function ChainSummary has 312 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const ChainSummary = () => {
                              const router = useRouter()
                              const { chainId: chainIdRouter } = router.query
                              const [platform, setPlatform] = useState('ALL')
                              const [transactionsArr, setTransactionsArr] = useState([])
                            Severity: Major
                            Found in packages/explorer-ui/pages/chain/[chainId].tsx - About 1 day to fix

                              Method executionContext._Query has 328 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/consumer/client/resolver-client/server.go - About 1 day to fix

                                Method executionContext._Query has 328 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/scribe/graphql/server/graph/resolver/server.go - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language