synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

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

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

Function StateManagedBridge has 422 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const StateManagedBridge = () => {
  const dispatch = useAppDispatch()
  const { address, isConnected, chain: connectedChain } = useAccount()
  const { balances } = usePortfolioState()
  const { synapseSDK } = useSynapseContext()
Severity: Major
Found in packages/synapse-interface/pages/state-managed-bridge/index.tsx - About 2 days to fix

    File poolMaster.ts has 860 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

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

      export const useEthereumWallet = () => {
        const [connectedAddress, setConnectedAddress] = useState<string>('')
        const [web3Provider, setWeb3Provider] = useState<any>(null)
        const [connectedNetwork, setConnectedNetwork] = useState<Network | null>()
      
      
      packages/widget/examples/with-next/app/hooks/useEthereumWallet.tsx on lines 10..62
      packages/widget/examples/with-react/src/hooks/useEthereumWallet.tsx on lines 10..62

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

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

      export const useEthereumWallet = () => {
        const [connectedAddress, setConnectedAddress] = useState<string>('')
        const [web3Provider, setWeb3Provider] = useState<any>(null)
        const [connectedNetwork, setConnectedNetwork] = useState<Network | null>()
      
      
      packages/widget/examples/landing-page/src/hooks/useEthereumWallet.tsx on lines 10..62
      packages/widget/examples/with-next/app/hooks/useEthereumWallet.tsx on lines 10..62

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

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

      export const useEthereumWallet = () => {
        const [connectedAddress, setConnectedAddress] = useState<string>('')
        const [web3Provider, setWeb3Provider] = useState<any>(null)
        const [connectedNetwork, setConnectedNetwork] = useState<Network | null>()
      
      
      packages/widget/examples/landing-page/src/hooks/useEthereumWallet.tsx on lines 10..62
      packages/widget/examples/with-react/src/hooks/useEthereumWallet.tsx on lines 10..62

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

      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 USDT: BridgeableToken = {
        addresses: {
          [CHAINS.ETHEREUM.id]: '0xdac17f958d2ee523a2206206994597c13d831ec7',
          [CHAINS.OPTIMISM.id]: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',
          [CHAINS.BNBCHAIN.id]: '0x55d398326f99059ff775485246999027b3197955',
      Severity: Major
      Found in packages/rest-api/src/constants/bridgeable.ts and 1 other location - About 1 day to fix
      packages/widget/src/constants/bridgeable.ts on lines 485..520

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

      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 USDT: BridgeableToken = {
        addresses: {
          [CHAINS.ETHEREUM.id]: '0xdac17f958d2ee523a2206206994597c13d831ec7',
          [CHAINS.OPTIMISM.id]: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',
          [CHAINS.BNBCHAIN.id]: '0x55d398326f99059ff775485246999027b3197955',
      Severity: Major
      Found in packages/widget/src/constants/bridgeable.ts and 1 other location - About 1 day to fix
      packages/rest-api/src/constants/bridgeable.ts on lines 485..520

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

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

      func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
          ec := executionContext{nil, e, 0, 0, nil}
          _ = ec
          switch typeName + "." + field {
      
      
      Severity: Major
      Found in services/explorer/consumer/client/resolver-client/server.go - About 1 day to fix

        Method executableSchema.Complexity has 417 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
            ec := executionContext{nil, e, 0, 0, nil}
            _ = ec
            switch typeName + "." + field {
        
        
        Severity: Major
        Found in services/scribe/graphql/server/graph/resolver/server.go - About 1 day to fix

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

            populateTransaction: {
              adapterSwap(
                recipient: string,
                tokenIn: string,
                amountIn: BigNumberish,
          Severity: Major
          Found in packages/sdk-router/src/typechain/SynapseCCTPRouter.ts and 1 other location - About 1 day to fix
          packages/sdk-router/src/typechain/SynapseCCTPRouter.ts on lines 364..412

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

          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

            estimateGas: {
              adapterSwap(
                recipient: string,
                tokenIn: string,
                amountIn: BigNumberish,
          Severity: Major
          Found in packages/sdk-router/src/typechain/SynapseCCTPRouter.ts and 1 other location - About 1 day to fix
          packages/sdk-router/src/typechain/SynapseCCTPRouter.ts on lines 414..465

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

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

          export const MINICHEF_ABI = [
            {
              inputs: [
                {
                  internalType: 'contract IERC20',
          Severity: Major
          Found in packages/synapse-interface/constants/abis/miniChef.ts - About 1 day to fix

            Method BackfillSuite.TestBackfill has 391 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (b *BackfillSuite) TestBackfill() {
                testChainID := b.testBackend.GetBigChainID()
            
                bridgeContract, bridgeRef := b.testDeployManager.GetTestSynapseBridge(b.GetTestContext(), b.testBackend)
                bridgeV1Contract, bridgeV1Ref := b.testDeployManager.GetTestSynapseBridgeV1(b.GetTestContext(), b.testBackend)
            Severity: Major
            Found in services/explorer/backfill/chain_test.go - About 1 day to fix

              File FastBridgeV2.ts has 774 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              export const FastBridgeV2Abi = [
                {
                  inputs: [{ internalType: 'address', name: '_owner', type: 'address' }],
                  stateMutability: 'nonpayable',
                  type: 'constructor',
              Severity: Major
              Found in packages/rfq-indexer/api/src/constants/abis/FastBridgeV2.ts - About 1 day to fix

                File FastBridgeV2.ts has 774 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                export const FastBridgeV2Abi = [
                  {
                    inputs: [{ internalType: 'address', name: '_owner', type: 'address' }],
                    stateMutability: 'nonpayable',
                    type: 'constructor',
                Severity: Major
                Found in packages/rfq-indexer/indexer/abis/FastBridgeV2.ts - About 1 day to fix

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

                  export const pendingTransactionsMissingRelayExceedDeadlineController = async (
                    req: Request,
                    res: Response
                  ) => {
                    try {
                  packages/rfq-indexer/api/src/controllers/pendingTransactionsController.ts on lines 88..131

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

                  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 pendingTransactionsMissingRelayController = async (
                    req: Request,
                    res: Response
                  ) => {
                    try {
                  packages/rfq-indexer/api/src/controllers/pendingTransactionsController.ts on lines 133..176

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

                  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

                  export const NETH: BridgeableToken = {
                    addresses: {
                      [CHAINS.OPTIMISM.id]: '0x809DC529f07651bD43A172e8dB6f4a7a0d771036',
                      [CHAINS.FANTOM.id]: '0x67C10C397dD0Ba417329543c1a40eb48AAa7cd00',
                      [CHAINS.BOBA.id]: '0x96419929d7949D6A801A6909c145C8EEf6A40431',
                  Severity: Major
                  Found in packages/rest-api/src/constants/bridgeable.ts and 3 other locations - About 1 day to fix
                  packages/rest-api/src/constants/bridgeable.ts on lines 1291..1324
                  packages/widget/src/constants/bridgeable.ts on lines 763..796
                  packages/widget/src/constants/bridgeable.ts on lines 1287..1320

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

                  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

                  export const WETH: BridgeableToken = {
                    addresses: {
                      [CHAINS.ETHEREUM.id]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
                      [CHAINS.OPTIMISM.id]: '0x121ab82b49B2BC4c7901CA46B8277962b4350204',
                      [CHAINS.BOBA.id]: '0xd203De32170130082896b4111eDF825a4774c18E',
                  Severity: Major
                  Found in packages/widget/src/constants/bridgeable.ts and 3 other locations - About 1 day to fix
                  packages/rest-api/src/constants/bridgeable.ts on lines 763..796
                  packages/rest-api/src/constants/bridgeable.ts on lines 1291..1324
                  packages/widget/src/constants/bridgeable.ts on lines 763..796

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

                  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