synapsecns/sanguine

View on GitHub
packages/sdk-router/src/sdk.test.ts

Summary

Maintainability
F
3 wks
Test Coverage

File sdk.test.ts has 1565 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Provider } from '@ethersproject/abstract-provider'
import { BigNumber, PopulatedTransaction } from 'ethers'
import { AddressZero, Zero } from '@ethersproject/constants'
import { parseFixed } from '@ethersproject/bignumber'

Severity: Major
Found in packages/sdk-router/src/sdk.test.ts - About 4 days to fix

    Function createApplySlippageTests has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        const createApplySlippageTests = (moduleSet: SynapseModuleSet) => {
          describe(`${moduleSet.bridgeModuleName} module`, () => {
            beforeEach(() => {
              jest.spyOn(moduleSet, 'applySlippage').mockImplementation(jest.fn())
            })
    Severity: Minor
    Found in packages/sdk-router/src/sdk.test.ts - About 1 hr to fix

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

            describe('SynapseBridge', () => {
              const ethSynBridge = '0x2796317b0fF8538F253012862c06787Adfb8cEb6'
              const events =
                'TokenDeposit, TokenDepositAndSwap, TokenRedeem, TokenRedeemAndRemove, TokenRedeemAndSwap, TokenRedeemV2'
      
      
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 2 days to fix
      packages/sdk-router/src/sdk.test.ts on lines 1196..1253

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

      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('SynapseCCTP', () => {
              const ethSynCCTP = '0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E'
              const events = 'CircleRequestSent'
      
              it('ETH -> ARB', async () => {
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 2 days to fix
      packages/sdk-router/src/sdk.test.ts on lines 1132..1194

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

      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

          describe('ARB Native -> ETH Native', () => {
            const amount = BigNumber.from(10).pow(18)
            const resultPromise: Promise<BridgeQuote> = synapse.bridgeQuote(
              SupportedChainId.ARBITRUM,
              SupportedChainId.ETH,
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 4 other locations - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 320..357
      packages/sdk-router/src/sdk.test.ts on lines 359..396
      packages/sdk-router/src/sdk.test.ts on lines 459..496
      packages/sdk-router/src/sdk.test.ts on lines 709..746

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

      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

          describe('AVAX gOHM -> BSC gOHM', () => {
            const amount = BigNumber.from(10).pow(21)
            const resultPromise: Promise<BridgeQuote> = synapse.bridgeQuote(
              SupportedChainId.AVALANCHE,
              SupportedChainId.BSC,
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 4 other locations - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 320..357
      packages/sdk-router/src/sdk.test.ts on lines 459..496
      packages/sdk-router/src/sdk.test.ts on lines 623..660
      packages/sdk-router/src/sdk.test.ts on lines 709..746

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

      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

          describe('BSC gOHM -> AVAX gOHM', () => {
            const amount = BigNumber.from(10).pow(21)
            const resultPromise: Promise<BridgeQuote> = synapse.bridgeQuote(
              SupportedChainId.BSC,
              SupportedChainId.AVALANCHE,
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 4 other locations - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 320..357
      packages/sdk-router/src/sdk.test.ts on lines 359..396
      packages/sdk-router/src/sdk.test.ts on lines 459..496
      packages/sdk-router/src/sdk.test.ts on lines 623..660

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

      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

          describe('ARB USDC -> ETH USDC (using CCTP)', () => {
            const amount = BigNumber.from(10).pow(12)
            const resultPromise: Promise<BridgeQuote> = synapse.bridgeQuote(
              SupportedChainId.ARBITRUM,
              SupportedChainId.ETH,
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 4 other locations - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 320..357
      packages/sdk-router/src/sdk.test.ts on lines 359..396
      packages/sdk-router/src/sdk.test.ts on lines 623..660
      packages/sdk-router/src/sdk.test.ts on lines 709..746

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

      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

          describe('AVAX USDC.e -> BSC USDC', () => {
            const amount = BigNumber.from(10).pow(9)
            const resultPromise: Promise<BridgeQuote> = synapse.bridgeQuote(
              SupportedChainId.AVALANCHE,
              SupportedChainId.BSC,
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 4 other locations - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 359..396
      packages/sdk-router/src/sdk.test.ts on lines 459..496
      packages/sdk-router/src/sdk.test.ts on lines 623..660
      packages/sdk-router/src/sdk.test.ts on lines 709..746

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

      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('excludeCCTP flag omitted', () => {
              const resultPromise: Promise<BridgeQuote> = synapse.bridgeQuote(
                SupportedChainId.ARBITRUM,
                SupportedChainId.ETH,
                ARB_USDT,
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 543..579

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

      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('excludeCCTP flag off', () => {
              const resultPromise: Promise<BridgeQuote> = synapse.bridgeQuote(
                SupportedChainId.ARBITRUM,
                SupportedChainId.ETH,
                ARB_USDT,
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 505..541

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

      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('SynapseCCTP', () => {
              it('ETH -> ARB', async () => {
                const txStatus = await synapse.getBridgeTxStatus(
                  SupportedChainId.ARBITRUM,
                  'SynapseCCTP',
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 1330..1368

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

      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('SynapseBridge', () => {
              it('ETH -> ARB', async () => {
                const txStatus = await synapse.getBridgeTxStatus(
                  SupportedChainId.ARBITRUM,
                  'SynapseBridge',
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 1370..1408

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

      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('Handles lowercase token addresses', async () => {
            const amounts: Record<string, BigNumber> = {}
            amounts[ARB_NETH.toLowerCase()] = BigNumber.from(10).pow(18)
            amounts[ARB_WETH.toLowerCase()] = BigNumber.from(10).pow(18).mul(2)
            const result = await synapse.calculateAddLiquidity(
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 1669..1683

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

      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('Handles uppercase token addresses', async () => {
            const amounts: Record<string, BigNumber> = {}
            amounts[ARB_NETH.toUpperCase()] = BigNumber.from(10).pow(18)
            amounts[ARB_WETH.toLowerCase()] = BigNumber.from(10).pow(18).mul(2)
            const result = await synapse.calculateAddLiquidity(
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/sdk.test.ts on lines 1653..1667

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

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

          const destQuery: Query = {
            routerAdapter: '6',
            tokenOut: '7',
            minAmountOut: BigNumber.from(8),
            deadline: BigNumber.from(9),
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 5 other locations - About 1 hr to fix
      packages/sdk-router/src/module/query.test.ts on lines 16..22
      packages/sdk-router/src/module/query.test.ts on lines 24..30
      packages/sdk-router/src/router/synapseCCTPRouter.test.ts on lines 18..24
      packages/sdk-router/src/router/synapseRouter.test.ts on lines 18..24
      packages/sdk-router/src/sdk.test.ts on lines 871..877

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

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

          const originQuery: Query = {
            routerAdapter: '1',
            tokenOut: '2',
            minAmountOut: BigNumber.from(3),
            deadline: BigNumber.from(4),
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 5 other locations - About 1 hr to fix
      packages/sdk-router/src/module/query.test.ts on lines 16..22
      packages/sdk-router/src/module/query.test.ts on lines 24..30
      packages/sdk-router/src/router/synapseCCTPRouter.test.ts on lines 18..24
      packages/sdk-router/src/router/synapseRouter.test.ts on lines 18..24
      packages/sdk-router/src/sdk.test.ts on lines 878..884

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

      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('bridgeQuote throws', async () => {
              await expect(
                synapse.bridgeQuote(
                  SupportedChainId.ETH,
                  SupportedChainId.ETH,
      Severity: Minor
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 55 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 1007..1017

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

      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('bridgeQuote throws on unknown chainId', async () => {
            await expect(
              synapse.bridgeQuote(
                SupportedChainId.ETH,
                SupportedChainId.AVALANCHE,
      Severity: Minor
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 55 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 975..987

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

      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('Returns correct set for SynapseRFQ', () => {
              const routerSet = operations.getModuleSet.call(synapse, 'SynapseRFQ')
              expect(routerSet).toEqual(synapse.fastBridgeRouterSet)
            })
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 2 other locations - About 50 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 1798..1801
      packages/sdk-router/src/sdk.test.ts on lines 1803..1806

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

      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('Returns correct set for SynapseBridge', () => {
              const routerSet = operations.getModuleSet.call(synapse, 'SynapseBridge')
              expect(routerSet).toEqual(synapse.synapseRouterSet)
            })
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 2 other locations - About 50 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 1803..1806
      packages/sdk-router/src/sdk.test.ts on lines 1808..1811

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

      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('Returns correct set for SynapseCCTP', () => {
              const routerSet = operations.getModuleSet.call(synapse, 'SynapseCCTP')
              expect(routerSet).toEqual(synapse.synapseCCTPRouterSet)
            })
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 2 other locations - About 50 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 1798..1801
      packages/sdk-router/src/sdk.test.ts on lines 1808..1811

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

      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('Throws when bridge module name is invalid', async () => {
              await expect(
                synapse.getSynapseTxId(
                  SupportedChainId.ETH,
                  'SynapseSynapse',
      Severity: Minor
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 50 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 1450..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 52.

      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('Throws when bridge module name is invalid', async () => {
              await expect(
                synapse.getBridgeTxStatus(
                  SupportedChainId.ETH,
                  'SynapseSynapse',
      Severity: Minor
      Found in packages/sdk-router/src/sdk.test.ts and 1 other location - About 50 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 1318..1326

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

      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('Returns estimated time for SynapseBridge', () => {
              expect(
                synapse.getEstimatedTime(SupportedChainId.BSC, 'SynapseBridge')
              ).toEqual(MEDIAN_TIME_BRIDGE[SupportedChainId.BSC])
            })
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 2 other locations - About 40 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 1532..1536
      packages/sdk-router/src/sdk.test.ts on lines 1558..1562

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

      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('Returns estimated time for SynapseCCTP', () => {
              expect(
                synapse.getEstimatedTime(SupportedChainId.ARBITRUM, 'SynapseCCTP')
              ).toEqual(MEDIAN_TIME_CCTP[SupportedChainId.ARBITRUM])
            })
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 2 other locations - About 40 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 1532..1536
      packages/sdk-router/src/sdk.test.ts on lines 1552..1556

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

      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('Returns estimated time for SynapseCCTP', () => {
              expect(
                synapse.getEstimatedTime(SupportedChainId.ETH, 'SynapseCCTP')
              ).toEqual(MEDIAN_TIME_CCTP[SupportedChainId.ETH])
            })
      Severity: Major
      Found in packages/sdk-router/src/sdk.test.ts and 2 other locations - About 40 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 1552..1556
      packages/sdk-router/src/sdk.test.ts on lines 1558..1562

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

      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

            const allQuotes = await synapse.allBridgeQuotes(
              SupportedChainId.ETH,
              SupportedChainId.ARBITRUM,
              NATIVE_ADDRESS,
              NATIVE_ADDRESS,
      Severity: Minor
      Found in packages/sdk-router/src/sdk.test.ts and 2 other locations - About 30 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 797..803
      packages/sdk-router/src/sdk.test.ts on lines 837..843

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

      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

            const allQuotes = await synapse.allBridgeQuotes(
              SupportedChainId.ETH,
              SupportedChainId.ARBITRUM,
              ETH_USDC,
              ARB_USDT,
      Severity: Minor
      Found in packages/sdk-router/src/sdk.test.ts and 2 other locations - About 30 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 837..843
      packages/sdk-router/src/sdk.test.ts on lines 848..854

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

      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

            const allQuotes = await synapse.allBridgeQuotes(
              SupportedChainId.ETH,
              SupportedChainId.ARBITRUM,
              ETH_USDC,
              ARB_USDT,
      Severity: Minor
      Found in packages/sdk-router/src/sdk.test.ts and 2 other locations - About 30 mins to fix
      packages/sdk-router/src/sdk.test.ts on lines 797..803
      packages/sdk-router/src/sdk.test.ts on lines 848..854

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

      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