synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

// autogenerated file

package lightmanager

import (
Severity: Major
Found in agents/contracts/lightmanager/filterer_generated.go and 1 other location - About 2 days to fix
agents/contracts/bondingmanager/filterer_generated.go on lines 1..134

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

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

// autogenerated file

package bondingmanager

import (
Severity: Major
Found in agents/contracts/bondingmanager/filterer_generated.go and 1 other location - About 2 days to fix
agents/contracts/lightmanager/filterer_generated.go on lines 1..134

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

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 DumpWithOptions has a Cognitive Complexity of 139 (exceeds 20 allowed). Consider refactoring.
Open

func DumpWithOptions(showReq bool, showResp bool, showBody bool, showHeaders bool, showCookies bool, cb func(dumpStr string)) gin.HandlerFunc {
    headerHiddenFields := make([]string, 0)
    bodyHiddenFields := make([]string, 0)

    if !showCookies {
Severity: Minor
Found in core/ginhelper/gindump.go - About 2 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File i_bonding_manager.go has 1251 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Code generated by mockery v2.14.0. DO NOT EDIT.

package mocks

import (
Severity: Major
Found in agents/contracts/bondingmanager/mocks/i_bonding_manager.go - About 2 days to fix

    File swap.ts has 998 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export const SWAP_ABI = [
      {
        anonymous: false,
        inputs: [
          {
    Severity: Major
    Found in packages/synapse-interface/constants/abis/swap.ts - About 2 days 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

      export const NUSD: BridgeableToken = {
        addresses: {
          [CHAINS.ETHEREUM.id]: '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F',
          [CHAINS.OPTIMISM.id]: '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00',
          [CHAINS.CRONOS.id]: '0x396c9c192dd323995346632581BEF92a31AC623b',
      Severity: Major
      Found in packages/rest-api/src/constants/bridgeable.ts and 1 other location - About 2 days to fix
      packages/widget/src/constants/bridgeable.ts on lines 703..744

      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

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

      export const NUSD: BridgeableToken = {
        addresses: {
          [CHAINS.ETHEREUM.id]: '0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F',
          [CHAINS.OPTIMISM.id]: '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00',
          [CHAINS.CRONOS.id]: '0x396c9c192dd323995346632581BEF92a31AC623b',
      Severity: Major
      Found in packages/widget/src/constants/bridgeable.ts and 1 other location - About 2 days to fix
      packages/rest-api/src/constants/bridgeable.ts on lines 703..744

      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

      Method SwapParser.Parse has a Cognitive Complexity of 132 (exceeds 20 allowed). Consider refactoring.
      Open

      func (p *SwapParser) Parse(ctx context.Context, log ethTypes.Log, chainID uint32) (interface{}, error) {
          logTopic := log.Topics[0]
      
          iFace, err := func(log ethTypes.Log) (swapTypes.EventLog, error) {
              // nolint:nestif
      Severity: Minor
      Found in services/explorer/consumer/parser/swapparser.go - About 2 days to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File abi.ts has 951 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      export const ABI = {
        fastBridgeV1: [
          {
            inputs: [{ internalType: 'address', name: '_owner', type: 'address' }],
            stateMutability: 'nonpayable',
      Severity: Major
      Found in packages/rfq-loadtest/src/abi.ts - About 2 days to fix

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

        export const GOHM: BridgeableToken = {
          addresses: {
            [CHAINS.ETHEREUM.id]: '0x0ab87046fBb341D058F17CBC4c1133F25a20a52f',
            [CHAINS.OPTIMISM.id]: '0x0b5740c6b4a97f90eF2F0220651Cca420B868FfB',
            [CHAINS.BNBCHAIN.id]: '0x88918495892BAF4536611E38E75D771Dc6Ec0863',
        Severity: Major
        Found in packages/widget/src/constants/bridgeable.ts and 1 other location - About 2 days to fix
        packages/rest-api/src/constants/bridgeable.ts on lines 6..46

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

        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 GOHM: BridgeableToken = {
          addresses: {
            [CHAINS.ETHEREUM.id]: '0x0ab87046fBb341D058F17CBC4c1133F25a20a52f',
            [CHAINS.OPTIMISM.id]: '0x0b5740c6b4a97f90eF2F0220651Cca420B868FfB',
            [CHAINS.BNBCHAIN.id]: '0x88918495892BAF4536611E38E75D771Dc6Ec0863',
        Severity: Major
        Found in packages/rest-api/src/constants/bridgeable.ts and 1 other location - About 2 days to fix
        packages/widget/src/constants/bridgeable.ts on lines 6..46

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

        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 poolMaster.ts has 917 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import * as CHAINS from '@constants/chains/master'
        import {
          BUSD,
          USDC,
          USDT,
        Severity: Major
        Found in packages/synapse-interface/constants/tokens/poolMaster.ts - About 2 days to fix

          Function Terms has 440 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const Terms = () => {
            return (
              <StandardPageContainer title="Terms of Service">
                <p className="text-lg font-medium text-white ">
                  Last updated: February, 2023
          Severity: Major
          Found in packages/explorer-ui/pages/terms/index.tsx - About 2 days to fix

            File i_light_manager.go has 1135 lines of code (exceeds 500 allowed). Consider refactoring.
            Open

            // Code generated by mockery v2.14.0. DO NOT EDIT.
            
            package mocks
            
            import (
            Severity: Major
            Found in agents/contracts/lightmanager/mocks/i_light_manager.go - About 2 days 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

              File simulated_gen_test.go has 1131 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              // Code copied from github.com/ethereum/go-ethereum/accounts/abi/bind/backends:/simulated_test.go for testing by synapse modulecopier DO NOT EDIT."
              
              // Copyright 2019 The go-ethereum Authors
              // This file is part of the go-ethereum library.
              //
              Severity: Major
              Found in ethergo/backends/simulated/multibackend/simulated_gen_test.go - About 2 days to fix

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

                  describe('applySlippage', () => {
                    const originQuery: RouterQuery = {
                      swapAdapter: '1',
                      tokenOut: '2',
                      minAmountOut: parseFixed('1000', 18),
                Severity: Major
                Found in packages/sdk-router/src/router/synapseRouterSet.test.ts and 1 other location - About 2 days to fix
                packages/sdk-router/src/router/synapseCCTPRouterSet.test.ts on lines 197..282

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

                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