synapsecns/sanguine

View on GitHub
services/scribe/graphql/server/graph/queries.resolvers.go

Summary

Maintainability
D
2 days
Test Coverage

Method queryResolver.LogsRange has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

func (r *queryResolver) LogsRange(ctx context.Context, contractAddress *string, chainID int, blockNumber *int, txHash *string, txIndex *int, blockHash *string, index *int, confirmed *bool, startBlock int, endBlock int, page int, asc *bool) ([]*model.Log, error) {
Severity: Major
Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

    Method queryResolver.LogsAtHeadRange has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func (r *queryResolver) LogsAtHeadRange(ctx context.Context, contractAddress *string, chainID int, blockNumber *int, txHash *string, txIndex *int, blockHash *string, index *int, confirmed *bool, startBlock int, endBlock int, page int) ([]*model.Log, error) {
    Severity: Major
    Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

      Method queryResolver.ReceiptsRange has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func (r *queryResolver) ReceiptsRange(ctx context.Context, chainID int, txHash *string, contractAddress *string, blockHash *string, blockNumber *int, txIndex *int, confirmed *bool, startBlock int, endBlock int, page int) ([]*model.Receipt, error) {
      Severity: Major
      Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

        Method queryResolver.ReceiptsAtHeadRange has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func (r *queryResolver) ReceiptsAtHeadRange(ctx context.Context, chainID int, txHash *string, contractAddress *string, blockHash *string, blockNumber *int, txIndex *int, confirmed *bool, startBlock int, endBlock int, page int) ([]*model.Receipt, error) {
        Severity: Major
        Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

          Method queryResolver.TransactionsAtHeadRange has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func (r *queryResolver) TransactionsAtHeadRange(ctx context.Context, txHash *string, chainID int, blockNumber *int, blockHash *string, confirmed *bool, startBlock int, endBlock int, lastIndexed int, page int) ([]*model.Transaction, error) {
          Severity: Major
          Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

            Method queryResolver.Logs has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func (r *queryResolver) Logs(ctx context.Context, contractAddress *string, chainID int, blockNumber *int, txHash *string, txIndex *int, blockHash *string, index *int, confirmed *bool, page int) ([]*model.Log, error) {
            Severity: Major
            Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

              Method queryResolver.Receipts has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func (r *queryResolver) Receipts(ctx context.Context, chainID int, txHash *string, contractAddress *string, blockHash *string, blockNumber *int, txIndex *int, confirmed *bool, page int) ([]*model.Receipt, error) {
              Severity: Major
              Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

                Method queryResolver.TransactionsRange has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func (r *queryResolver) TransactionsRange(ctx context.Context, txHash *string, chainID int, blockNumber *int, blockHash *string, confirmed *bool, startBlock int, endBlock int, page int) ([]*model.Transaction, error) {
                Severity: Major
                Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 1 hr to fix

                  Method queryResolver.Transactions has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  func (r *queryResolver) Transactions(ctx context.Context, txHash *string, chainID int, blockNumber *int, blockHash *string, confirmed *bool, page int) ([]*model.Transaction, error) {
                  Severity: Major
                  Found in services/scribe/graphql/server/graph/queries.resolvers.go - About 50 mins to fix

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

                    func (r *queryResolver) ReceiptsAtHeadRange(ctx context.Context, chainID int, txHash *string, contractAddress *string, blockHash *string, blockNumber *int, txIndex *int, confirmed *bool, startBlock int, endBlock int, page int) ([]*model.Receipt, error) {
                        receiptsFilter := db.BuildReceiptFilter(txHash, contractAddress, blockHash, blockNumber, txIndex, confirmed)
                        receiptsFilter.ChainID = uint32(chainID)
                        receipts, err := r.DB.RetrieveReceiptsFromHeadRangeQuery(ctx, receiptsFilter, uint64(startBlock), uint64(endBlock), page)
                        if err != nil {
                    Severity: Major
                    Found in services/scribe/graphql/server/graph/queries.resolvers.go and 1 other location - About 2 hrs to fix
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 66..75

                    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 214.

                    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 (r *queryResolver) ReceiptsRange(ctx context.Context, chainID int, txHash *string, contractAddress *string, blockHash *string, blockNumber *int, txIndex *int, confirmed *bool, startBlock int, endBlock int, page int) ([]*model.Receipt, error) {
                        receiptsFilter := db.BuildReceiptFilter(txHash, contractAddress, blockHash, blockNumber, txIndex, confirmed)
                        receiptsFilter.ChainID = uint32(chainID)
                        receipts, err := r.DB.RetrieveReceiptsInRange(ctx, receiptsFilter, uint64(startBlock), uint64(endBlock), page)
                        if err != nil {
                    Severity: Major
                    Found in services/scribe/graphql/server/graph/queries.resolvers.go and 1 other location - About 2 hrs to fix
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 249..258

                    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 214.

                    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 5 locations. Consider refactoring.
                    Open

                    func (r *queryResolver) LastStoredBlockNumber(ctx context.Context, chainID int) (*int, error) {
                        blockNumber, err := r.DB.RetrieveLastBlockStored(ctx, uint32(chainID))
                        if err != nil {
                            return nil, fmt.Errorf("error retrieving last block: %w", err)
                        }
                    Severity: Major
                    Found in services/scribe/graphql/server/graph/queries.resolvers.go and 4 other locations - About 40 mins to fix
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 143..152
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 155..164
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 213..222
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 225..234

                    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 111.

                    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 5 locations. Consider refactoring.
                    Open

                    func (r *queryResolver) LastConfirmedBlockNumber(ctx context.Context, chainID int) (*int, error) {
                        blockNumber, err := r.DB.RetrieveLastConfirmedBlock(ctx, uint32(chainID))
                        if err != nil {
                            return nil, fmt.Errorf("error retrieving first block: %w", err)
                        }
                    Severity: Major
                    Found in services/scribe/graphql/server/graph/queries.resolvers.go and 4 other locations - About 40 mins to fix
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 131..140
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 143..152
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 213..222
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 225..234

                    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 111.

                    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 5 locations. Consider refactoring.
                    Open

                    func (r *queryResolver) ReceiptCount(ctx context.Context, chainID int) (*int, error) {
                        receiptCount, err := r.DB.RetrieveReceiptCountForChain(ctx, uint32(chainID))
                        if err != nil {
                            return nil, fmt.Errorf("error retrieving receipt count: %w", err)
                        }
                    Severity: Major
                    Found in services/scribe/graphql/server/graph/queries.resolvers.go and 4 other locations - About 40 mins to fix
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 131..140
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 143..152
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 155..164
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 225..234

                    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 111.

                    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 5 locations. Consider refactoring.
                    Open

                    func (r *queryResolver) FirstStoredBlockNumber(ctx context.Context, chainID int) (*int, error) {
                        blockNumber, err := r.DB.RetrieveFirstBlockStored(ctx, uint32(chainID))
                        if err != nil {
                            return nil, fmt.Errorf("error retrieving first block: %w", err)
                        }
                    Severity: Major
                    Found in services/scribe/graphql/server/graph/queries.resolvers.go and 4 other locations - About 40 mins to fix
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 131..140
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 155..164
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 213..222
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 225..234

                    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 111.

                    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 5 locations. Consider refactoring.
                    Open

                    func (r *queryResolver) BlockTimeCount(ctx context.Context, chainID int) (*int, error) {
                        blockTimesCount, err := r.DB.RetrieveBlockTimesCountForChain(ctx, uint32(chainID))
                        if err != nil {
                            return nil, fmt.Errorf("error retrieving contract last block: %w", err)
                        }
                    Severity: Major
                    Found in services/scribe/graphql/server/graph/queries.resolvers.go and 4 other locations - About 40 mins to fix
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 131..140
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 143..152
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 155..164
                    services/scribe/graphql/server/graph/queries.resolvers.go on lines 213..222

                    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 111.

                    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