synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Method queryResolver.DailyStatisticsByChain has 11 return statements (exceeds 4 allowed).
Open

func (r *queryResolver) DailyStatisticsByChain(ctx context.Context, chainID *int, typeArg *model.DailyStatisticType, platform *model.Platform, duration *model.Duration, useCache *bool, useMv *bool) ([]*model.DateResultByChain, error) {
    cacheKey := fmt.Sprintf("dailyStatisticsByChain, %s, %s, %s, %s", keyGenHandleNilInt(chainID), typeArg.String(), duration.String(), platform.String())

    if useCache != nil && *useCache {
        locker := r.CacheMutex.Lock(cacheKey)
Severity: Major
Found in services/explorer/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

    Method executionContext.field_Query_receiptsRange_args has 11 return statements (exceeds 4 allowed).
    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: Major
    Found in services/explorer/consumer/client/resolver-client/server.go - About 1 hr to fix

      Method executionContext.field_Query_receiptsAtHeadRange_args has 11 return statements (exceeds 4 allowed).
      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: Major
      Found in services/explorer/consumer/client/resolver-client/server.go - About 1 hr to fix

        Method executionContext._Log has 11 return statements (exceeds 4 allowed).
        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 1 hr to fix

          Method executionContext._Transaction has 11 return statements (exceeds 4 allowed).
          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: Major
          Found in services/explorer/consumer/client/resolver-client/server.go - About 1 hr to fix

            Method executionContext._Receipt has 11 return statements (exceeds 4 allowed).
            Open

            func (ec *executionContext) _Receipt(ctx context.Context, sel ast.SelectionSet, obj *model.Receipt) graphql.Marshaler {
                fields := graphql.CollectFields(ec.OperationContext, sel, receiptImplementors)
            
                out := graphql.NewFieldSet(fields)
                deferred := make(map[string]*graphql.FieldSet)
            Severity: Major
            Found in services/explorer/consumer/client/resolver-client/server.go - About 1 hr to fix

              Function getChainBackfiller has 11 return statements (exceeds 4 allowed).
              Open

              func getChainBackfiller(consumerDB db.ConsumerDB, chainConfig indexerConfig.ChainConfig, fetcher fetcherpkg.ScribeFetcher, client bind.ContractBackend, tokenDataService tokendata.Service, priceDataService tokenprice.Service) (*backfill.ChainBackfiller, error) {
                  var err error
                  var bridgeParser *parser.BridgeParser
                  var messageBusParser *parser.MessageBusParser
                  var cctpParser *parser.CCTPParser
              Severity: Major
              Found in services/explorer/node/explorer.go - About 1 hr to fix

                Method BridgeParser.MatureLogs has 11 return statements (exceeds 4 allowed).
                Open

                func (p *BridgeParser) MatureLogs(ctx context.Context, bridgeEvent *model.BridgeEvent, iFace bridgeTypes.EventLog, chainID uint32) (interface{}, error) {
                    g, groupCtx := errgroup.WithContext(ctx)
                    var err error
                    var sender *string
                    var timeStamp *uint64
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go - About 1 hr to fix

                  Method BridgeParser.MatureLogs has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                  Open

                  func (p *BridgeParser) MatureLogs(ctx context.Context, bridgeEvent *model.BridgeEvent, iFace bridgeTypes.EventLog, chainID uint32) (interface{}, error) {
                      g, groupCtx := errgroup.WithContext(ctx)
                      var err error
                      var sender *string
                      var timeStamp *uint64
                  Severity: Minor
                  Found in services/explorer/consumer/parser/bridgeparser.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 11 return statements (exceeds 4 allowed).
                  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: Major
                  Found in services/scribe/graphql/server/graph/resolver/server.go - About 1 hr to fix

                    Function RegisterScribeServiceHandlerClient has 11 return statements (exceeds 4 allowed).
                    Open

                    func RegisterScribeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ScribeServiceClient) error {
                    
                        mux.Handle("POST", pattern_ScribeService_Check_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
                            ctx, cancel := context.WithCancel(req.Context())
                            defer cancel()
                    Severity: Major
                    Found in services/scribe/grpc/types/types/v1/service.pb.gw.go - About 1 hr to fix

                      Method executionContext._Log has 11 return statements (exceeds 4 allowed).
                      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 1 hr to fix

                        Method executionContext.field_Query_receiptsAtHeadRange_args has 11 return statements (exceeds 4 allowed).
                        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: Major
                        Found in services/scribe/graphql/server/graph/resolver/server.go - About 1 hr to fix

                          Method executionContext._Transaction has 11 return statements (exceeds 4 allowed).
                          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: Major
                          Found in services/scribe/graphql/server/graph/resolver/server.go - About 1 hr to fix

                            Method executionContext._Receipt has 11 return statements (exceeds 4 allowed).
                            Open

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

                              Function getTransactionById has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const getTransactionById = async (req: Request, res: Response) => {
                                const { transactionId } = req.params
                              
                                try {
                                  const query = db
                              Severity: Minor
                              Found in packages/rfq-indexer/api/src/controllers/transactionIdController.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 useBridgeValidations has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const useBridgeValidations = () => {
                                const { chainId } = useAccount()
                                const {
                                  fromChainId,
                                  toChainId,

                              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 destinationTxController has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const destinationTxController = async (req, res) => {
                                const errors = validationResult(req)
                                if (!errors.isEmpty()) {
                                  return res.status(400).json({ errors: errors.array() })
                                }
                              Severity: Minor
                              Found in packages/rest-api/src/controllers/destinationTxController.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 normalizeNativeTokenAddress has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const normalizeNativeTokenAddress = (addressFields: string[]) => {
                                return (req: Request, _res: Response, next: NextFunction) => {
                                  for (const field of addressFields) {
                                    const address = req.query[field]
                                    if (typeof address === 'string' && isAddress(address)) {
                              Severity: Minor
                              Found in packages/rest-api/src/middleware/normalizeNativeTokenAddress.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 HyperliquidTransactionButton has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const HyperliquidTransactionButton = ({
                                isTyping,
                                hasDepositedOnHyperliquid,
                                setHasDepositedOnHyperliquid,
                              }) => {

                              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