synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Function Txs has 198 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const Txs = () => {
  const search = useSearchParams()
  const p = Number(search.get('p'))
  const hashSearch = String(search.get('hash'))

Severity: Major
Found in packages/explorer-ui/pages/txs/index.tsx - About 7 hrs to fix

    ILightInbox has 55 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type ILightInbox struct {
        mock.Mock
    }
    Severity: Major
    Found in agents/contracts/lightinbox/mocks/i_light_inbox.go - About 7 hrs to fix

      File executor.go has 743 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      package executor
      
      import (
          "context"
          "encoding/json"
      Severity: Minor
      Found in agents/agents/executor/executor.go - About 7 hrs to fix

        File resolvers.ts has 492 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { sql } from 'kysely'
        
        import { db } from '../db'
        
        // typical fields to return for a BridgeRequest
        Severity: Minor
        Found in packages/rfq-indexer/api/src/graphql/resolvers.ts - About 7 hrs to fix

          File chains.ts has 491 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import _ from 'lodash'
          
          import { Chain } from '../types'
          import { getOmniRpcUrl } from '../utils/getOmniRpcUrl'
          
          
          Severity: Minor
          Found in packages/rest-api/src/constants/chains.ts - About 7 hrs to fix

            File chains.ts has 490 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import _ from 'lodash'
            import { Chain } from 'types'
            
            export const ETHEREUM: Chain = {
              id: 1,
            Severity: Minor
            Found in packages/widget/src/constants/chains.ts - About 7 hrs to fix

              Method Bot.rfqRefund has a Cognitive Complexity of 65 (exceeds 20 allowed). Consider refactoring.
              Open

              func (b *Bot) rfqRefund() *slacker.CommandDefinition {
                  return &slacker.CommandDefinition{
                      Command:     "refund <tx>",
                      Description: "refund a quote request",
                      Examples:    []string{"refund 0x1234"},
              Severity: Minor
              Found in contrib/opbot/botmd/commands.go - About 7 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 ChainSummary has a Cognitive Complexity of 50 (exceeds 5 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: Minor
              Found in packages/explorer-ui/pages/chain/[chainId].tsx - About 7 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 chains.ts has 485 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* eslint-disable */
              const CustomColors = {
                CUSTOM_YELLOW: '[#ecae0b]',
                CUSTOM_YELLOW_DARK: '[#3c3c44]',
                ETH_BASE: '[#5170ad]',
              Severity: Minor
              Found in packages/synapse-interface/styles/chains.ts - About 7 hrs to fix

                Method inventoryManagerImpl.ApproveAllTokens has a Cognitive Complexity of 64 (exceeds 20 allowed). Consider refactoring.
                Open

                func (i *inventoryManagerImpl) ApproveAllTokens(ctx context.Context) (err error) {
                    ctx, span := i.handler.Tracer().Start(ctx, "approveAllTokens")
                    defer func() {
                        metrics.EndSpanWithErr(span, err)
                    }()
                Severity: Minor
                Found in services/rfq/relayer/inventory/manager.go - About 7 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 CCTPFlow has 189 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  File generated.ts has 480 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { api } from '@/slices/api/slice'
                  export type Maybe<T> = T | null
                  export type InputMaybe<T> = Maybe<T>
                  export type Exact<T extends { [key: string]: unknown }> = {
                    [K in keyof T]: T[K]
                  Severity: Minor
                  Found in packages/synapse-interface/slices/api/generated.ts - About 7 hrs to fix

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

                    import { useState } from 'react'
                    import { CHAINS } from '@synapsecns/synapse-constants'
                    import TextField from '@mui/material/TextField'
                    import {
                      inputStyle,
                    Severity: Minor
                    Found in packages/explorer-ui/components/pages/Home/UniversalSearch/index.tsx - About 7 hrs to fix

                      Method executableSchema.Complexity has 87 return statements (exceeds 4 allowed).
                      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 7 hrs to fix

                        Method executableSchema.Complexity has 87 return statements (exceeds 4 allowed).
                        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 7 hrs to fix

                          Function RFQFlow has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Function RFQFlow has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              File quoter.go has 721 lines of code (exceeds 500 allowed). Consider refactoring.
                              Open

                              // Package quoter submits quotes to the RFQ API for which assets the relayer is willing to relay.
                              package quoter
                              
                              import (
                                  "context"
                              Severity: Minor
                              Found in services/rfq/relayer/quoter/quoter.go - About 7 hrs to fix

                                Function constructJSON has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const constructJSON = (swappableMap, exclusionList) => {
                                  const result = {}
                                
                                  // Iterate through the chains
                                  for (const chainA in swappableMap) {
                                Severity: Minor
                                Found in packages/synapse-interface/constants/existingBridgeRoutes.ts - About 7 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 constructJSON has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const constructJSON = (
                                  swappableMap,
                                  exclusionList
                                ): StringifiedBridgeRoutes => {
                                  const result = {}
                                Severity: Minor
                                Found in packages/rest-api/src/utils/bridgeRouteMapping.ts - About 7 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