synapsecns/sanguine

View on GitHub
packages/sdk-router/src/typechain/FastBridgeRouter.ts

Summary

Maintainability
F
6 days
Test Coverage

File FastBridgeRouter.ts has 422 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

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

      estimateGas: {
        GAS_REBATE_FLAG(overrides?: CallOverrides): Promise<BigNumber>
    
        adapterSwap(
          recipient: string,
    Severity: Major
    Found in packages/sdk-router/src/typechain/FastBridgeRouter.ts and 1 other location - About 2 days to fix
    packages/sdk-router/src/typechain/FastBridgeRouter.ts on lines 447..500

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

    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

      populateTransaction: {
        GAS_REBATE_FLAG(overrides?: CallOverrides): Promise<PopulatedTransaction>
    
        adapterSwap(
          recipient: string,
    Severity: Major
    Found in packages/sdk-router/src/typechain/FastBridgeRouter.ts and 1 other location - About 2 days to fix
    packages/sdk-router/src/typechain/FastBridgeRouter.ts on lines 392..445

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

    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

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

      queryFilter<TEvent extends TypedEvent>(
        event: TypedEventFilter<TEvent>,
        fromBlockOrBlockhash?: string | number | undefined,
        toBlock?: string | number | undefined
      ): Promise<Array<TEvent>>
    Severity: Major
    Found in packages/sdk-router/src/typechain/FastBridgeRouter.ts and 5 other locations - About 1 hr to fix
    packages/sdk-router/src/typechain/FastBridge.ts on lines 700..704
    packages/sdk-router/src/typechain/SynapseBridge.ts on lines 642..646
    packages/sdk-router/src/typechain/SynapseCCTP.ts on lines 526..530
    packages/sdk-router/src/typechain/SynapseCCTPRouter.ts on lines 159..163
    packages/sdk-router/src/typechain/SynapseRouter.ts on lines 469..473

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

    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

        getOriginAmountOut(
          tokenIn: string,
          rfqTokens: string[],
          amountIn: BigNumberish,
          overrides?: CallOverrides
    Severity: Major
    Found in packages/sdk-router/src/typechain/FastBridgeRouter.ts and 2 other locations - About 1 hr to fix
    packages/sdk-router/src/typechain/SynapseCCTPRouter.ts on lines 232..239
    packages/sdk-router/src/typechain/SynapseRouter.ts on lines 607..614

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

    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

    export type SwapQueryStructOutput = [
      string,
      string,
      BigNumber,
      BigNumber,
    Severity: Major
    Found in packages/sdk-router/src/typechain/FastBridgeRouter.ts and 4 other locations - About 1 hr to fix
    packages/sdk-router/src/typechain/SynapseCCTPRouter.ts on lines 33..45
    packages/sdk-router/src/typechain/SynapseRouter.ts on lines 57..69
    packages/synapse-constants/src/types/index.ts on lines 34..40
    packages/synapse-interface/utils/types/index.tsx on lines 37..43

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

    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

        bridge(
          recipient: string,
          chainId: BigNumberish,
          token: string,
          amount: BigNumberish,
    Severity: Major
    Found in packages/sdk-router/src/typechain/FastBridgeRouter.ts and 3 other locations - About 1 hr to fix
    packages/sdk-router/src/typechain/SynapseCCTP.ts on lines 977..985
    packages/sdk-router/src/typechain/SynapseCCTPRouter.ts on lines 312..320
    packages/sdk-router/src/typechain/SynapseRouter.ts on lines 928..936

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

    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

        adapterSwap(
          recipient: string,
          tokenIn: string,
          amountIn: BigNumberish,
          tokenOut: string,
    Severity: Major
    Found in packages/sdk-router/src/typechain/FastBridgeRouter.ts and 2 other locations - About 50 mins to fix
    packages/sdk-router/src/typechain/SynapseCCTPRouter.ts on lines 303..310
    packages/sdk-router/src/typechain/SynapseRouter.ts on lines 901..908

    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

    export type SwapQueryStruct = {
      routerAdapter: string
      tokenOut: string
      minAmountOut: BigNumberish
      deadline: BigNumberish
    Severity: Major
    Found in packages/sdk-router/src/typechain/FastBridgeRouter.ts and 2 other locations - About 45 mins to fix
    packages/sdk-router/src/typechain/SynapseCCTPRouter.ts on lines 25..31
    packages/sdk-router/src/typechain/SynapseRouter.ts on lines 49..55

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

    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