synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

// generate gql schema
package main

import (
    "fmt"
Severity: Major
Found in services/scribe/graphql/contrib/main.go and 1 other location - About 6 hrs to fix
services/explorer/graphql/contrib/client/main.go on lines 1..56

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

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

export const getNetworkTextColorContrastHover = (
  chainColor: string
): string => {
  switch (chainColor) {
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/chains.ts and 1 other location - About 6 hrs to fix
packages/synapse-interface/styles/chains.ts on lines 364..385

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

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

export const getNetworkTextColorContrast = (chainColor: string): string => {
  switch (chainColor) {
    case ColorOptions.YELLOW:
      return `text-[#ecae0b]`
    case ColorOptions.ETH:
Severity: Major
Found in packages/synapse-interface/styles/chains.ts and 1 other location - About 6 hrs to fix
packages/synapse-interface/styles/chains.ts on lines 387..410

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

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

Function Token has 151 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const Token = () => {
  const router = useRouter()
  const { tokenAddress } = router.query
  const search = useSearchParams()
  const chain_id = Number(search.get('chainId')) || 1
Severity: Major
Found in packages/explorer-ui/pages/token/[tokenAddress].tsx - About 6 hrs to fix

    Method executionContext._Receipt has 175 lines of code (exceeds 50 allowed). Consider refactoring.
    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 6 hrs to fix

      Method executionContext._Receipt has 175 lines of code (exceeds 50 allowed). Consider refactoring.
      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 6 hrs to fix

        File metered_evm_client.go has 664 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        // Code generated by mockery v2.14.0. DO NOT EDIT.
        
        package mocks
        
        import (
        Severity: Minor
        Found in ethergo/chain/client/mocks/metered_evm_client.go - About 5 hrs to fix

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

          // Package sqlite provides a common interface for starting sql-lite databases
          package sqlite
          
          import (
              "context"
          Severity: Major
          Found in services/rfq/relayer/reldb/sqlite/sqlite.go and 1 other location - About 5 hrs to fix
          services/rfq/guard/guarddb/sqlite/sqlite.go on lines 1..62

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

          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

          // Package sqlite provides a common interface for starting sql-lite databases
          package sqlite
          
          import (
              "context"
          Severity: Major
          Found in services/rfq/guard/guarddb/sqlite/sqlite.go and 1 other location - About 5 hrs to fix
          services/rfq/relayer/reldb/sqlite/sqlite.go on lines 1..61

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

          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

          Method executionContext._Log has 173 lines of code (exceeds 50 allowed). Consider refactoring.
          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 5 hrs to fix

            Method executionContext._Log has 173 lines of code (exceeds 50 allowed). Consider refactoring.
            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 5 hrs to fix

              Method executionContext.field_Query_bridgeTransactions_args has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
              Open

              func (ec *executionContext) field_Query_bridgeTransactions_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["chainIDFrom"]; ok {
              Severity: Minor
              Found in services/explorer/graphql/server/graph/resolver/server.go - About 5 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

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

              func (b *BackfillSuite) removeLiquidityImbalanceParity(log *types.Log, parser *parser.SwapParser, chainID uint32) error {
                  // parse the log
                  parsedLog, err := parser.Filterer.ParseRemoveLiquidityImbalance(*log)
                  if err != nil {
                      return fmt.Errorf("error parsing log: %w", err)
              Severity: Major
              Found in services/explorer/backfill/chain_test.go and 1 other location - About 5 hrs to fix
              services/explorer/backfill/chain_test.go on lines 1425..1458

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

              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 (b *BackfillSuite) addLiquidityParity(log *types.Log, parser *parser.SwapParser, chainID uint32) error {
                  // parse the log
                  parsedLog, err := parser.Filterer.ParseAddLiquidity(*log)
                  if err != nil {
                      return fmt.Errorf("error parsing log: %w", err)
              Severity: Major
              Found in services/explorer/backfill/chain_test.go and 1 other location - About 5 hrs to fix
              services/explorer/backfill/chain_test.go on lines 1532..1565

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

              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

              package sqlite
              
              import (
                  "context"
                  "fmt"
              Severity: Major
              Found in agents/agents/guard/db/sql/sqlite/sqlite.go and 1 other location - About 5 hrs to fix
              agents/agents/notary/db/sql/sqlite/sqlite.go on lines 1..59

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

              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

              package sqlite
              
              import (
                  "context"
                  "fmt"
              Severity: Major
              Found in agents/agents/notary/db/sql/sqlite/sqlite.go and 1 other location - About 5 hrs to fix
              agents/agents/guard/db/sql/sqlite/sqlite.go on lines 1..59

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

              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

              File resolver_test.go has 659 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              package api_test
              
              import (
                  gosql "database/sql"
                  "fmt"
              Severity: Minor
              Found in services/explorer/api/resolver_test.go - About 5 hrs to fix

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

                func (_m *Service) GetAllTXAttemptByStatus(ctx context.Context, fromAddress common.Address, chainID *big.Int, options ...db.Option) ([]db.TX, error) {
                    _va := make([]interface{}, len(options))
                    for _i := range options {
                        _va[_i] = options[_i]
                    }
                Severity: Major
                Found in ethergo/submitter/db/mocks/service.go and 1 other location - About 5 hrs to fix
                ethergo/submitter/db/mocks/service.go on lines 214..241

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

                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 (_m *Service) GetTXS(ctx context.Context, fromAddress common.Address, chainID *big.Int, options ...db.Option) ([]db.TX, error) {
                    _va := make([]interface{}, len(options))
                    for _i := range options {
                        _va[_i] = options[_i]
                    }
                Severity: Major
                Found in ethergo/submitter/db/mocks/service.go and 1 other location - About 5 hrs to fix
                ethergo/submitter/db/mocks/service.go on lines 59..86

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

                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

                File SynapseCCTPRouter.ts has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* Autogenerated file. Do not edit manually. */
                /* tslint:disable */
                /* eslint-disable */
                import type {
                  BaseContract,
                Severity: Minor
                Found in packages/sdk-router/src/typechain/SynapseCCTPRouter.ts - About 5 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language