synapsecns/sanguine

View on GitHub
services/explorer/graphql/client/client.go

Summary

Maintainability
F
3 days
Test Coverage

File client.go has 707 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Code generated by github.com/Yamashou/gqlgenc, DO NOT EDIT.

package client

import (
Severity: Minor
Found in services/explorer/graphql/client/client.go - About 7 hrs to fix

    Method Client.GetBridgeTransactions has 19 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func (c *Client) GetBridgeTransactions(ctx context.Context, chainIDTo []*int, chainIDFrom []*int, addressTo *string, addressFrom *string, maxAmount *int, minAmount *int, maxAmountUsd *int, minAmountUsd *int, startTime *int, endTime *int, txHash *string, kappa *string, pending *bool, page *int, tokenAddressFrom []*string, tokenAddressTo []*string, useMv *bool, httpRequestOptions ...client.HTTPRequestOption) (*GetBridgeTransactions, error) {
    Severity: Major
    Found in services/explorer/graphql/client/client.go - About 2 hrs to fix

      Method Client.GetMessageBusTransactions has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func (c *Client) GetMessageBusTransactions(ctx context.Context, chainID []*int, contractAddress *string, startTime *int, endTime *int, txHash *string, messageID *string, pending *bool, reverted *bool, page *int, httpRequestOptions ...client.HTTPRequestOption) (*GetMessageBusTransactions, error) {
      Severity: Major
      Found in services/explorer/graphql/client/client.go - About 1 hr to fix

        Method Client.GetAmountStatistic has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func (c *Client) GetAmountStatistic(ctx context.Context, typeArg model.StatisticType, platform *model.Platform, duration *model.Duration, chainID *int, address *string, tokenAddress *string, useMv *bool, httpRequestOptions ...client.HTTPRequestOption) (*GetAmountStatistic, error) {
        Severity: Major
        Found in services/explorer/graphql/client/client.go - About 1 hr to fix

          Method Client.GetDestinationBridgeTx has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func (c *Client) GetDestinationBridgeTx(ctx context.Context, chainID int, kappa string, address string, timestamp int, bridgeType model.BridgeType, historical *bool, httpRequestOptions ...client.HTTPRequestOption) (*GetDestinationBridgeTx, error) {
          Severity: Major
          Found in services/explorer/graphql/client/client.go - About 1 hr to fix

            Method Client.GetDailyStatisticsByChain has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func (c *Client) GetDailyStatisticsByChain(ctx context.Context, chainID *int, typeArg *model.DailyStatisticType, duration *model.Duration, platform *model.Platform, useMv *bool, httpRequestOptions ...client.HTTPRequestOption) (*GetDailyStatisticsByChain, error) {
            Severity: Major
            Found in services/explorer/graphql/client/client.go - About 50 mins to fix

              Method Client.GetCountByTokenAddress has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func (c *Client) GetCountByTokenAddress(ctx context.Context, chainID *int, address *string, direction *model.Direction, hours *int, httpRequestOptions ...client.HTTPRequestOption) (*GetCountByTokenAddress, error) {
              Severity: Minor
              Found in services/explorer/graphql/client/client.go - About 45 mins to fix

                Method Client.GetCountByChainID has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func (c *Client) GetCountByChainID(ctx context.Context, chainID *int, address *string, direction *model.Direction, hours *int, httpRequestOptions ...client.HTTPRequestOption) (*GetCountByChainID, error) {
                Severity: Minor
                Found in services/explorer/graphql/client/client.go - About 45 mins to fix

                  Method Client.GetLeaderboard has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  func (c *Client) GetLeaderboard(ctx context.Context, duration *model.Duration, chainID *int, useMv *bool, page *int, httpRequestOptions ...client.HTTPRequestOption) (*GetLeaderboard, error) {
                  Severity: Minor
                  Found in services/explorer/graphql/client/client.go - About 45 mins to fix

                    Method Client.GetOriginBridgeTx has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    func (c *Client) GetOriginBridgeTx(ctx context.Context, chainID int, txnHash string, bridgeType model.BridgeType, httpRequestOptions ...client.HTTPRequestOption) (*GetOriginBridgeTx, error) {
                    Severity: Minor
                    Found in services/explorer/graphql/client/client.go - About 35 mins to fix

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          Response []*struct {
                              Date       *string  "json:\"date\" graphql:\"date\""
                              Ethereum   *float64 "json:\"ethereum\" graphql:\"ethereum\""
                              Optimism   *float64 "json:\"optimism\" graphql:\"optimism\""
                              Cronos     *float64 "json:\"cronos\" graphql:\"cronos\""
                      Severity: Major
                      Found in services/explorer/graphql/client/client.go and 1 other location - About 2 hrs to fix
                      services/explorer/api/server_test.go on lines 37..67

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 234.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      type GetDestinationBridgeTx struct {
                          Response *struct {
                              BridgeTx *struct {
                                  ChainID            *int     "json:\"chainID\" graphql:\"chainID\""
                                  DestinationChainID *int     "json:\"destinationChainID\" graphql:\"destinationChainID\""
                      Severity: Major
                      Found in services/explorer/graphql/client/client.go and 1 other location - About 2 hrs to fix
                      services/explorer/graphql/client/client.go on lines 233..255

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 195.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      type GetOriginBridgeTx struct {
                          Response *struct {
                              BridgeTx *struct {
                                  ChainID            *int     "json:\"chainID\" graphql:\"chainID\""
                                  DestinationChainID *int     "json:\"destinationChainID\" graphql:\"destinationChainID\""
                      Severity: Major
                      Found in services/explorer/graphql/client/client.go and 1 other location - About 2 hrs to fix
                      services/explorer/graphql/client/client.go on lines 256..278

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 195.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      func (c *Client) GetCountByTokenAddress(ctx context.Context, chainID *int, address *string, direction *model.Direction, hours *int, httpRequestOptions ...client.HTTPRequestOption) (*GetCountByTokenAddress, error) {
                          vars := map[string]interface{}{
                              "chainID":   chainID,
                              "address":   address,
                              "direction": direction,
                      Severity: Major
                      Found in services/explorer/graphql/client/client.go and 1 other location - About 1 hr to fix
                      services/explorer/graphql/client/client.go on lines 354..368

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 172.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      func (c *Client) GetCountByChainID(ctx context.Context, chainID *int, address *string, direction *model.Direction, hours *int, httpRequestOptions ...client.HTTPRequestOption) (*GetCountByChainID, error) {
                          vars := map[string]interface{}{
                              "chainID":   chainID,
                              "address":   address,
                              "direction": direction,
                      Severity: Major
                      Found in services/explorer/graphql/client/client.go and 1 other location - About 1 hr to fix
                      services/explorer/graphql/client/client.go on lines 379..393

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 172.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 11 locations. Consider refactoring.
                      Open

                      func (c *Client) GetAddressData(ctx context.Context, address string, httpRequestOptions ...client.HTTPRequestOption) (*GetAddressData, error) {
                          vars := map[string]interface{}{
                              "address": address,
                          }
                      
                      
                      Severity: Major
                      Found in services/explorer/graphql/client/client.go and 10 other locations - About 1 hr to fix
                      services/explorer/consumer/client/client.go on lines 193..204
                      services/explorer/consumer/client/client.go on lines 211..222
                      services/explorer/consumer/client/client.go on lines 267..278
                      services/explorer/consumer/client/client.go on lines 304..315
                      services/explorer/consumer/client/client.go on lines 322..333
                      services/scribe/graphql/client/client.go on lines 762..773
                      services/scribe/graphql/client/client.go on lines 780..791
                      services/scribe/graphql/client/client.go on lines 836..847
                      services/scribe/graphql/client/client.go on lines 873..884
                      services/scribe/graphql/client/client.go on lines 891..902

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 130.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                                  MessageType     *struct {
                                      TearType struct {
                                          Recipient string "json:\"recipient\" graphql:\"recipient\""
                                          Amount    string "json:\"amount\" graphql:\"amount\""
                                      } "graphql:\"... on TearType\""
                      Severity: Minor
                      Found in services/explorer/graphql/client/client.go and 1 other location - About 40 mins to fix
                      services/explorer/graphql/client/client.go on lines 147..164

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 108.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                                  MessageType          *struct {
                                      TearType struct {
                                          Recipient string "json:\"recipient\" graphql:\"recipient\""
                                          Amount    string "json:\"amount\" graphql:\"amount\""
                                      } "graphql:\"... on TearType\""
                      Severity: Minor
                      Found in services/explorer/graphql/client/client.go and 1 other location - About 40 mins to fix
                      services/explorer/graphql/client/client.go on lines 175..192

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 108.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      There are no issues that match your filters.

                      Category
                      Status