synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

Method executionContext._Log has a Cognitive Complexity of 89 (exceeds 20 allowed). Consider refactoring.
Open

func (ec *executionContext) _Log(ctx context.Context, sel ast.SelectionSet, obj *model.Log) graphql.Marshaler {
    fields := graphql.CollectFields(ec.OperationContext, sel, logImplementors)

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Minor
Found in services/explorer/consumer/client/resolver-client/server.go - About 1 day 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

Method executionContext._Log has a Cognitive Complexity of 89 (exceeds 20 allowed). Consider refactoring.
Open

func (ec *executionContext) _Log(ctx context.Context, sel ast.SelectionSet, obj *model.Log) graphql.Marshaler {
    fields := graphql.CollectFields(ec.OperationContext, sel, logImplementors)

    out := graphql.NewFieldSet(fields)
    deferred := make(map[string]*graphql.FieldSet)
Severity: Minor
Found in services/scribe/graphql/server/graph/resolver/server.go - About 1 day 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

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

Function RehydrateCache has 138 return statements (exceeds 4 allowed).
Open

func RehydrateCache(parentCtx context.Context, client *gqlClient.Client, service cache.Service, handler metrics.Handler) (err error) {
    traceCtx, span := handler.Tracer().Start(parentCtx, "RehydrateCache")
    defer func() {
        metrics.EndSpanWithErr(span, err)
    }()
Severity: Major
Found in services/explorer/api/server.go - About 1 day to fix

    Method executionContext._Receipt has a Cognitive Complexity of 88 (exceeds 20 allowed). Consider refactoring.
    Open

    func (ec *executionContext) _Receipt(ctx context.Context, sel ast.SelectionSet, obj *model.Receipt) graphql.Marshaler {
        fields := graphql.CollectFields(ec.OperationContext, sel, receiptImplementors)
    
        out := graphql.NewFieldSet(fields)
        deferred := make(map[string]*graphql.FieldSet)
    Severity: Minor
    Found in services/explorer/consumer/client/resolver-client/server.go - About 1 day 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

    Method executionContext._Receipt has a Cognitive Complexity of 88 (exceeds 20 allowed). Consider refactoring.
    Open

    func (ec *executionContext) _Receipt(ctx context.Context, sel ast.SelectionSet, obj *model.Receipt) graphql.Marshaler {
        fields := graphql.CollectFields(ec.OperationContext, sel, receiptImplementors)
    
        out := graphql.NewFieldSet(fields)
        deferred := make(map[string]*graphql.FieldSet)
    Severity: Minor
    Found in services/scribe/graphql/server/graph/resolver/server.go - About 1 day 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

    Function OverviewChart has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
    Open

    export const OverviewChart: React.FC<OverviewChartProps> = ({
      chartData,
      isUSD,
      loading = false,
      showAggregated,
    Severity: Minor
    Found in packages/explorer-ui/components/ChainChart/index.tsx - About 1 day 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 master.tsx has 619 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import arbitrumImg from '@assets/chains/arbitrum.svg'
    import auroraImg from '@assets/chains/aurora.svg'
    import avalancheImg from '@assets/chains/avalanche.svg'
    import baseImg from '@assets/chains/base.svg'
    import blastImg from '@assets/chains/blast.svg'
    Severity: Major
    Found in packages/synapse-interface/constants/chains/master.tsx - About 1 day to fix

      IInbox has 72 methods (exceeds 20 allowed). Consider refactoring.
      Open

      type IInbox struct {
          mock.Mock
      }
      Severity: Major
      Found in agents/contracts/inbox/mocks/i_inbox.go - About 1 day to fix

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

        func (a *SimulatedBackendsTestSuite) SetupOrigin(deployManager *DeployManager) {
            a.OriginContractMetadata, a.OriginContract = deployManager.GetOriginHarness(a.GetTestContext(), a.TestBackendOrigin)
            a.DestinationContractMetadataOnOrigin, a.DestinationContractOnOrigin = deployManager.GetDestinationHarness(a.GetTestContext(), a.TestBackendOrigin)
            a.TestClientMetadataOnOrigin, a.TestClientOnOrigin = deployManager.GetTestClient(a.GetTestContext(), a.TestBackendOrigin)
            a.PingPongClientMetadataOnOrigin, a.PingPongClientOnOrigin = deployManager.GetPingPongClient(a.GetTestContext(), a.TestBackendOrigin)
        Severity: Major
        Found in agents/testutil/simulated_backends_suite.go and 1 other location - About 1 day to fix
        agents/testutil/simulated_backends_suite.go on lines 219..255

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

        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

        func (a *SimulatedBackendsTestSuite) SetupDestination(deployManager *DeployManager) {
            a.DestinationContractMetadata, a.DestinationContract = deployManager.GetDestinationHarness(a.GetTestContext(), a.TestBackendDestination)
            a.OriginContractMetadataOnDestination, a.OriginContractOnDestination = deployManager.GetOriginHarness(a.GetTestContext(), a.TestBackendDestination)
            a.TestClientMetadataOnDestination, a.TestClientOnDestination = deployManager.GetTestClient(a.GetTestContext(), a.TestBackendDestination)
            a.PingPongClientMetadataOnDestination, a.PingPongClientOnDestination = deployManager.GetPingPongClient(a.GetTestContext(), a.TestBackendDestination)
        Severity: Major
        Found in agents/testutil/simulated_backends_suite.go and 1 other location - About 1 day to fix
        agents/testutil/simulated_backends_suite.go on lines 187..214

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

        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 getNetworkButtonBorderActive = (chainColor: string): string => {
          switch (chainColor) {
            case ColorOptions.YELLOW:
              return `active: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 201..232
        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 getNetworkButtonBorderHover = (chainColor: string): string => {
          switch (chainColor) {
            case ColorOptions.YELLOW:
              return `hover: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 168..199
        packages/synapse-interface/styles/chains.ts on lines 201..232
        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 getNetworkTextColor = (chainColor: string): string => {
          switch (chainColor) {
            case ColorOptions.YELLOW:
              return `text-[#ecae0b] dark:text-[#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 234..265
        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 getNetworkButtonBgClassNameActive = (
          chainColor: string
        ): string => {
          switch (chainColor) {
            case ColorOptions.YELLOW:
        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 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 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 getNetworkBgClassNameLightDark = (chainColor: string): string => {
          switch (chainColor) {
            case ColorOptions.YELLOW:
              return `bg-[#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 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 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 getNetworkShadow = (chainColor: string): string => {
          switch (chainColor) {
            case ColorOptions.ETH:
              return `shadow-blue-xl hover:shadow-blue-2xl`
            case ColorOptions.YELLOW:
        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 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 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 getNetworkLinkTextColor = (chainColor: string): string => {
          switch (chainColor) {
            case ColorOptions.YELLOW:
              return `text-gray-800 hover:text-[#ecae0b] dark:text-[#ecae0b] dark:hover:text-[#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 234..265
        packages/synapse-interface/styles/chains.ts on lines 267..298
        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 getNetworkHover = (chainColor: string): string => {
          switch (chainColor) {
            case ColorOptions.YELLOW:
              return `hover:bg-[bg-yellow-500] hover:bg-opacity-30 dark:hover:bg-yellow-500 dark:hover:bg-opacity-30`
            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 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

        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

        Severity
        Category
        Status
        Source
        Language