synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

export const getNetworkButtonBorder = (chainColor: string): string => {
  switch (chainColor) {
    case ColorOptions.YELLOW:
      return `border-[#ecae0b] dark:border-[#ecae0b]`
    case ColorOptions.ETH:
Severity: Major
Found in packages/synapse-interface/styles/chains.ts and 9 other locations - About 1 day to fix
packages/synapse-interface/styles/chains.ts on lines 100..133
packages/synapse-interface/styles/chains.ts on lines 135..166
packages/synapse-interface/styles/chains.ts on lines 168..199
packages/synapse-interface/styles/chains.ts on lines 234..265
packages/synapse-interface/styles/chains.ts on lines 267..298
packages/synapse-interface/styles/chains.ts on lines 300..331
packages/synapse-interface/styles/chains.ts on lines 445..476
packages/synapse-interface/styles/chains.ts on lines 478..509
packages/synapse-interface/styles/chains.ts on lines 511..542

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

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

export const getNetworkButtonBorderImportant = (chainColor: string): string => {
  switch (chainColor) {
    case ColorOptions.YELLOW:
      return `border-[#ecae0b] dark:border-[#ecae0b]`
    case ColorOptions.ETH:
Severity: Major
Found in packages/synapse-interface/styles/chains.ts and 9 other locations - About 1 day to fix
packages/synapse-interface/styles/chains.ts on lines 100..133
packages/synapse-interface/styles/chains.ts on lines 135..166
packages/synapse-interface/styles/chains.ts on lines 168..199
packages/synapse-interface/styles/chains.ts on lines 201..232
packages/synapse-interface/styles/chains.ts on lines 267..298
packages/synapse-interface/styles/chains.ts on lines 300..331
packages/synapse-interface/styles/chains.ts on lines 445..476
packages/synapse-interface/styles/chains.ts on lines 478..509
packages/synapse-interface/styles/chains.ts on lines 511..542

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

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 server.go has 847 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package api

import (
    "context"
    "encoding/json"
Severity: Major
Found in services/explorer/api/server.go - About 1 day to fix

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

    package l2gateway
    
    import (
        "bytes"
        "fmt"
    Severity: Major
    Found in services/rfq/contracts/l2gateway/parser.go and 1 other location - About 1 day to fix
    services/rfq/contracts/l1gateway/parser.go on lines 1..112

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

    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

    package l1gateway
    
    import (
        "bytes"
        "fmt"
    Severity: Major
    Found in services/rfq/contracts/l1gateway/parser.go and 1 other location - About 1 day to fix
    services/rfq/contracts/l2gateway/parser.go on lines 1..112

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

    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

    File i_origin.go has 837 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/origin/mocks/i_origin.go - About 1 day to fix

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

            describe('Invalid origin token', () => {
              it('No origin token separator is found', () => {
                expect(() =>
                  unmarshallTicker(`${noSeparator}-${ethUSDCStr}`)
                ).toThrow(`Can not unmarshall "${noSeparator}": invalid format`)
      Severity: Major
      Found in packages/sdk-router/src/rfq/ticker.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/rfq/ticker.test.ts on lines 140..166

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

      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('Invalid destination token', () => {
              it('No destination token separator is found', () => {
                expect(() =>
                  unmarshallTicker(`${arbUSDCStr}-${noSeparator}`)
                ).toThrow(`Can not unmarshall "${noSeparator}": invalid format`)
      Severity: Major
      Found in packages/sdk-router/src/rfq/ticker.test.ts and 1 other location - About 1 day to fix
      packages/sdk-router/src/rfq/ticker.test.ts on lines 112..138

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

      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 executor_test.go has 823 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      package executor_test
      
      import (
          "fmt"
          "math/big"
      Severity: Major
      Found in agents/agents/executor/executor_test.go - About 1 day to fix

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

        const calculateTimeUntilTarget = (targetDate: Date) => {
          const currentDate = new Date()
          const timeDifference = targetDate.getTime() - currentDate.getTime()
          const isComplete = timeDifference <= 0
        
        
        Severity: Major
        Found in packages/widget/src/utils/getCountdownTimeStatus.ts and 1 other location - About 1 day to fix
        packages/synapse-interface/components/Maintenance/components/EventCountdownProgressBar.tsx on lines 199..220

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

        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

        const calculateTimeUntilTarget = (targetDate: Date) => {
          const currentDate = new Date()
          const timeDifference = targetDate.getTime() - currentDate.getTime()
          const isComplete = timeDifference <= 0
        
        
        packages/widget/src/utils/getCountdownTimeStatus.ts on lines 88..109

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

        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 MetamaskIcon has 243 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const MetamaskIcon: React.FC<IconProps> = (props) => {
          return (
            <svg
              width="50"
              height="49"
        Severity: Major
        Found in packages/synapse-interface/components/icons/WalletIcons/Metamask.tsx - About 1 day to fix

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

          import { expect } from '@jest/globals'
          
          import { getToTokens } from '@/utils/routeMaker/getToTokens'
          import { mockRoutes } from './__fixtures__/mockRoutes'
          
          
          Severity: Major
          Found in packages/synapse-interface/__tests__/getToTokens.test.ts - About 1 day to fix

            Function HowSynapseWorks has 242 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function HowSynapseWorks() {
              return (
                <svg
                  width="1590"
                  height="500"

              IBondingManager has 66 methods (exceeds 20 allowed). Consider refactoring.
              Open

              type IBondingManager struct {
                  mock.Mock
              }
              Severity: Major
              Found in agents/contracts/bondingmanager/mocks/i_bonding_manager.go - About 1 day to fix

                SimulatedTestBackend has 66 methods (exceeds 20 allowed). Consider refactoring.
                Open

                type SimulatedTestBackend struct {
                    mock.Mock
                }
                Severity: Major
                Found in ethergo/backends/mocks/simulated_test_backend.go - About 1 day to fix

                  File partials.go has 814 lines of code (exceeds 500 allowed). Consider refactoring.
                  Open

                  package graph
                  
                  // TODO make more dynamic.
                  const swapDeDup = `
                  swapDeDup AS (
                  Severity: Major
                  Found in services/explorer/graphql/server/graph/partials.go - About 1 day to fix

                    File client.go has 811 lines of code (exceeds 500 allowed). Consider refactoring.
                    Open

                    // Code generated by github.com/Yamashou/gqlgenc, DO NOT EDIT.
                    
                    package client
                    
                    import (
                    Severity: Major
                    Found in services/scribe/graphql/client/client.go - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language