synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

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

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 3 other locations - About 5 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 10374..10410
services/explorer/graphql/server/graph/resolver/server.go on lines 10672..10708
services/explorer/graphql/server/graph/resolver/server.go on lines 11310..11346

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

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

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

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 3 other locations - About 5 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 10204..10240
services/explorer/graphql/server/graph/resolver/server.go on lines 10374..10410
services/explorer/graphql/server/graph/resolver/server.go on lines 10672..10708

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

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

      <Grid cols={{ sm: 1, md: 3 }} gap={8} className="md:p-4">
        <SupportCard header={t('extensibleHeader')} image={<ExtensibleIcon />}>
          {t('extensibleDescription')}
        </SupportCard>
        <SupportCard header={t('secureHeader')} image={<SecureIcon />}>
packages/synapse-interface/pages/landing/sections/BridgeSection.tsx on lines 35..45

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

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

  it('should return min/max origin amounts bridging USDC', async () => {
    const response = await request(app).get('/bridgeLimits').query({
      fromChain: 1,
      fromToken: USDC.addresses[1],
      toChain: 10,
Severity: Major
Found in packages/rest-api/src/tests/bridgeLimitsRoute.test.ts and 1 other location - About 5 hrs to fix
packages/rest-api/src/tests/bridgeLimitsRoute.test.ts on lines 25..36

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

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

      <Grid cols={{ sm: 1, md: 3 }} gap={6}>
        <SupportCard header={t('Deep Liquidity')} image={<DeepLiquidityIcon />}>
          {t('Swap native assets')}
        </SupportCard>
        <SupportCard header={t('Wide Support')} image={<WideSupportIcon />}>
packages/synapse-interface/pages/landing/sections/SecuritySection.tsx on lines 34..47

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

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

  it('should return min/max origin amounts bridging ETH', async () => {
    const response = await request(app).get('/bridgeLimits').query({
      fromChain: 1,
      fromToken: ETH.addresses[1],
      toChain: 10,
Severity: Major
Found in packages/rest-api/src/tests/bridgeLimitsRoute.test.ts and 1 other location - About 5 hrs to fix
packages/rest-api/src/tests/bridgeLimitsRoute.test.ts on lines 12..23

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

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 generateMaps.js has 379 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const { ethers } = require('ethers')

const { prettyPrintTS } = require('./utils/prettyPrintTs')
const { fetchRfqData } = require('./utils/fetchRfqData')
// Provider URLs
Severity: Minor
Found in packages/synapse-interface/scripts/generateMaps.js - About 5 hrs to fix

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

    export const SDT = new Token({
      addresses: {
        [CHAINS.ETH.id]: '0x73968b9a57c6e53d41345fd57a6e6ae27d6cdb2f',
        [CHAINS.AVALANCHE.id]: '0xCCBf7c451F81752F7d2237F2c18C371E6e089E69',
        [CHAINS.ARBITRUM.id]: '0x087d18A77465c34CDFd3a081a2504b7E86CE4EF8',
    packages/synapse-constants/src/constants/tokens/bridgeable.ts on lines 320..338

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

    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 UNIDX = new Token({
      addresses: {
        [CHAINS.ETH.id]: '0xf0655dcee37e5c0b70fffd70d85f88f8edf0aff6',
        [CHAINS.ARBITRUM.id]: '0x5429706887FCb58a595677B73E9B0441C25d993D',
        [CHAINS.FANTOM.id]: '0x0483a76D80D0aFEC6bd2afd12C1AD865b9DF1471',
    packages/synapse-constants/src/constants/tokens/bridgeable.ts on lines 174..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 136.

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

    func TestNewContext(t *testing.T) {
        unsetGithubRepo(t)
        t.Run("with GITHUB_EVENT_PATH set", func(t *testing.T) {
            res := mock.MustMarshal(github.PushEvent{
                Repo: &github.PushEventRepository{
    Severity: Major
    Found in contrib/git-changes-action/detector/actionscore/context_test.go - About 5 hrs to fix

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

      func (r *finalizedProxyImpl) Run(ctx context.Context) error {
          router := ginhelper.NewWithExperimentalLogger(ctx, r.handler.ExperimentalLogger())
          router.Use(r.handler.Gin()...)
      
          router.POST("/", func(c *gin.Context) {
      services/omnirpc/modules/receiptsbackup/receiptsbackup.go on lines 67..96

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

      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 *receiptsProxyImpl) Run(ctx context.Context) error {
          router := ginhelper.NewWithExperimentalLogger(ctx, r.handler.ExperimentalLogger())
          router.Use(r.handler.Gin()...)
      
          router.POST("/", func(c *gin.Context) {
      Severity: Major
      Found in services/omnirpc/modules/receiptsbackup/receiptsbackup.go and 1 other location - About 5 hrs to fix
      services/omnirpc/modules/confirmedtofinalized/finalizedproxy.go on lines 68..97

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

      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._Query has 58 return statements (exceeds 4 allowed).
      Open

      func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
          fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
          ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
              Object: "Query",
          })
      Severity: Major
      Found in services/explorer/consumer/client/resolver-client/server.go - About 5 hrs to fix

        Method executionContext._Query has 58 return statements (exceeds 4 allowed).
        Open

        func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
            fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
            ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
                Object: "Query",
            })
        Severity: Major
        Found in services/scribe/graphql/server/graph/resolver/server.go - About 5 hrs to fix

          Function Wallet has 125 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const Wallet = () => {
            const { connector: activeConnector, address: connectedAddress } = useAccount()
            const { chain: currentChain } = useAccount()
            const walletId = activeConnector?.id
          
          
          Severity: Major
          Found in packages/synapse-interface/components/Wallet.tsx - About 5 hrs to fix

            File evm.go has 624 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/client/mocks/evm.go - About 5 hrs to fix

              File evm_client.go has 624 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/evm_client.go - About 5 hrs to fix

                File index.tsx has 374 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { Fragment } from 'react'
                import { Popover, Transition } from '@headlessui/react'
                import { DocumentTextIcon, MenuIcon, XIcon } from '@heroicons/react/outline'
                // import { useActiveWeb3React } from '@hooks/wallet/useActiveWeb3React'
                import {
                Severity: Minor
                Found in packages/explorer-ui/components/layouts/MainLayout/index.tsx - About 5 hrs to fix

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

                  func (_m *ILightInbox) VerifyStateWithSnapshotProof(opts *bind.TransactOpts, stateIndex uint8, statePayload []byte, snapProof [][32]byte, attPayload []byte, attSignature []byte) (*types.Transaction, error) {
                      ret := _m.Called(opts, stateIndex, statePayload, snapProof, attPayload, attSignature)
                  
                      var r0 *types.Transaction
                      if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint8, []byte, [][32]byte, []byte, []byte) *types.Transaction); ok {
                  Severity: Major
                  Found in agents/contracts/lightinbox/mocks/i_light_inbox.go and 1 other location - About 5 hrs to fix
                  agents/contracts/inbox/mocks/i_inbox.go on lines 1336..1356

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

                  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 *IInbox) VerifyStateWithSnapshotProof(opts *bind.TransactOpts, stateIndex uint8, statePayload []byte, snapProof [][32]byte, attPayload []byte, attSignature []byte) (*types.Transaction, error) {
                      ret := _m.Called(opts, stateIndex, statePayload, snapProof, attPayload, attSignature)
                  
                      var r0 *types.Transaction
                      if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint8, []byte, [][32]byte, []byte, []byte) *types.Transaction); ok {
                  Severity: Major
                  Found in agents/contracts/inbox/mocks/i_inbox.go and 1 other location - About 5 hrs to fix
                  agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1037..1057

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

                  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