synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

  describe('getSynapseCCTPRouter', () => {
    it('Returns the correct router for supported chain', () => {
      const router = routerSet.getSynapseCCTPRouter(SupportedChainId.ETH)
      expect(router).toEqual(routerSet.routers[SupportedChainId.ETH])
      expect(router).toBeInstanceOf(SynapseCCTPRouter)
Severity: Major
Found in packages/sdk-router/src/router/synapseCCTPRouterSet.test.ts and 1 other location - About 4 hrs to fix
packages/sdk-router/src/router/synapseRouterSet.test.ts on lines 107..119

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

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

  describe('getSynapseRouter', () => {
    it('Returns the correct router for supported chain', () => {
      const router = routerSet.getSynapseRouter(SupportedChainId.ETH)
      expect(router).toEqual(routerSet.routers[SupportedChainId.ETH])
      expect(router).toBeInstanceOf(SynapseRouter)
Severity: Major
Found in packages/sdk-router/src/router/synapseRouterSet.test.ts and 1 other location - About 4 hrs to fix
packages/sdk-router/src/router/synapseCCTPRouterSet.test.ts on lines 183..195

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

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

func (ec *executionContext) _DateResult(ctx context.Context, sel ast.SelectionSet, obj *model.DateResult) graphql.Marshaler {
    fields := graphql.CollectFields(ec.OperationContext, sel, dateResultImplementors)

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 4 other locations - About 4 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 10244..10278
services/explorer/graphql/server/graph/resolver/server.go on lines 10336..10370
services/explorer/graphql/server/graph/resolver/server.go on lines 11350..11384
services/explorer/graphql/server/graph/resolver/server.go on lines 11463..11497

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

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 (ec *executionContext) _VolumeByChainID(ctx context.Context, sel ast.SelectionSet, obj *model.VolumeByChainID) graphql.Marshaler {
    fields := graphql.CollectFields(ec.OperationContext, sel, volumeByChainIDImplementors)

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 4 other locations - About 4 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 10244..10278
services/explorer/graphql/server/graph/resolver/server.go on lines 10336..10370
services/explorer/graphql/server/graph/resolver/server.go on lines 10506..10540
services/explorer/graphql/server/graph/resolver/server.go on lines 11350..11384

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

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 (ec *executionContext) _AddressDailyCount(ctx context.Context, sel ast.SelectionSet, obj *model.AddressDailyCount) graphql.Marshaler {
    fields := graphql.CollectFields(ec.OperationContext, sel, addressDailyCountImplementors)

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 4 other locations - About 4 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 10336..10370
services/explorer/graphql/server/graph/resolver/server.go on lines 10506..10540
services/explorer/graphql/server/graph/resolver/server.go on lines 11350..11384
services/explorer/graphql/server/graph/resolver/server.go on lines 11463..11497

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

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 (ec *executionContext) _TransactionCountResult(ctx context.Context, sel ast.SelectionSet, obj *model.TransactionCountResult) graphql.Marshaler {
    fields := graphql.CollectFields(ec.OperationContext, sel, transactionCountResultImplementors)

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 4 other locations - About 4 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 10244..10278
services/explorer/graphql/server/graph/resolver/server.go on lines 10336..10370
services/explorer/graphql/server/graph/resolver/server.go on lines 10506..10540
services/explorer/graphql/server/graph/resolver/server.go on lines 11463..11497

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

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 (ec *executionContext) _AddressRanking(ctx context.Context, sel ast.SelectionSet, obj *model.AddressRanking) graphql.Marshaler {
    fields := graphql.CollectFields(ec.OperationContext, sel, addressRankingImplementors)

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 4 other locations - About 4 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 10244..10278
services/explorer/graphql/server/graph/resolver/server.go on lines 10506..10540
services/explorer/graphql/server/graph/resolver/server.go on lines 11350..11384
services/explorer/graphql/server/graph/resolver/server.go on lines 11463..11497

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

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 NotarySuite.TestNotaryE2E has 142 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (u *NotarySuite) TestNotaryE2E() {
    guardTestConfig := config.AgentConfig{
        Domains: map[string]config.DomainConfig{
            "origin_client":      u.OriginDomainClient.Config(),
            "destination_client": u.DestinationDomainClient.Config(),
Severity: Major
Found in agents/agents/notary/notary_test.go - About 4 hrs to fix

    Function AddressPage has 117 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const AddressPage = () => {
      const router = useRouter()
      const { address } = router.query
    
      const [platform, setPlatform] = useState('ALL')
    Severity: Major
    Found in packages/explorer-ui/pages/address/[address].tsx - About 4 hrs to fix

      LifecycleClient has 36 methods (exceeds 20 allowed). Consider refactoring.
      Open

      type LifecycleClient struct {
          underlyingClient EVMClient
          Permitter
          // chainID is the chain id used for the client
          chainID *big.Int
      Severity: Minor
      Found in ethergo/chain/client/lifecycle.go - About 4 hrs to fix

        IGasOracle has 36 methods (exceeds 20 allowed). Consider refactoring.
        Open

        type IGasOracle struct {
            mock.Mock
        }
        Severity: Minor
        Found in agents/contracts/gasoracle/mocks/i_gas_oracle.go - About 4 hrs to fix

          EventDB has 36 methods (exceeds 20 allowed). Consider refactoring.
          Open

          type EventDB struct {
              mock.Mock
          }
          Severity: Minor
          Found in services/scribe/db/mocks/event_db.go - About 4 hrs to fix

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

              it('should return 400 for invalid address, with error message', async () => {
                const response = await request(app).get('/swapTxInfo').query({
                  chain: '1',
                  fromToken: USDC.addresses[1],
                  toToken: DAI.addresses[1],
            Severity: Major
            Found in packages/rest-api/src/tests/swapTxInfoRoute.test.ts and 2 other locations - About 4 hrs to fix
            packages/rest-api/src/tests/swapRoute.test.ts on lines 171..182
            packages/rest-api/src/tests/swapTxInfoRoute.test.ts on lines 40..50

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

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

              it('should return 400 for invalid address', async () => {
                const response = await request(app).get('/swap').query({
                  chain: '1',
                  fromToken: USDC.addresses[1],
                  toToken: DAI.addresses[1],
            Severity: Major
            Found in packages/rest-api/src/tests/swapRoute.test.ts and 2 other locations - About 4 hrs to fix
            packages/rest-api/src/tests/swapTxInfoRoute.test.ts on lines 25..38
            packages/rest-api/src/tests/swapTxInfoRoute.test.ts on lines 40..50

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

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

              it('should return 400 for unsupported chain, with error message', async () => {
                const response = await request(app).get('/swapTxInfo').query({
                  chain: '111',
                  fromToken: USDC.addresses[1],
                  toToken: DAI.addresses[1],
            Severity: Major
            Found in packages/rest-api/src/tests/swapTxInfoRoute.test.ts and 2 other locations - About 4 hrs to fix
            packages/rest-api/src/tests/swapRoute.test.ts on lines 171..182
            packages/rest-api/src/tests/swapTxInfoRoute.test.ts on lines 25..38

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

            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 getCmpTestCases has 140 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func getCmpTestCases() []*cmpTestCase {
                // this will serve as a fuzz test for legacy txes
                gofakeit.Seed(time.Now().UnixNano())
            
                // gasPriceTests test gas price v gas price
            Severity: Major
            Found in ethergo/chain/gas/cmp_test.go - About 4 hrs to fix

              Method GuardSuite.TestInvalidReceipt has 140 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (g *GuardSuite) TestInvalidReceipt() {
                  testDone := false
                  defer func() {
                      testDone = true
                  }()
              Severity: Major
              Found in agents/agents/guard/fraud_test.go - About 4 hrs to fix

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

                  if (searchStr?.length > 0) {
                    const results = fuse.search(searchStr).map((i) => i.item)
                
                    possibleTokens = results.filter((item) => item.source === 'possibleTokens')
                    remainingChainTokens = results.filter(
                packages/synapse-interface/components/StateManagedBridge/hooks/useFromTokenListArray.ts on lines 95..104
                packages/synapse-interface/components/StateManagedBridge/hooks/useToTokenListArray.ts on lines 77..87

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

                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

                      <g fill="currentcolor" textAnchor="middle" dominantBaseline="middle">
                        <text x="-33%" y="24">
                          originChain
                        </text>
                        <text x="33%" y="24">
                Severity: Major
                Found in docs/bridge/src/components/CCTPFlow.tsx and 1 other location - About 4 hrs to fix
                docs/bridge/src/components/BridgeFlow.tsx on lines 54..64

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

                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

                      <g fill="currentcolor" textAnchor="middle" dominantBaseline="middle">
                        <text x="-33%" y="24">
                          originChain
                        </text>
                        <text x="33%" y="24">
                Severity: Major
                Found in docs/bridge/src/components/BridgeFlow.tsx and 1 other location - About 4 hrs to fix
                docs/bridge/src/components/CCTPFlow.tsx on lines 54..64

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

                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

                Severity
                Category
                Status
                Source
                Language