synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

export const CRONOS: Chain = {
  priorityRank: 10,
  id: 25,
  chainSymbol: 'CRONOS',
  name: 'Cronos',
Severity: Major
Found in packages/synapse-interface/constants/chains/master.tsx and 15 other locations - About 4 hrs to fix
packages/synapse-interface/constants/chains/master.tsx on lines 63..87
packages/synapse-interface/constants/chains/master.tsx on lines 115..138
packages/synapse-interface/constants/chains/master.tsx on lines 140..163
packages/synapse-interface/constants/chains/master.tsx on lines 165..189
packages/synapse-interface/constants/chains/master.tsx on lines 191..215
packages/synapse-interface/constants/chains/master.tsx on lines 217..240
packages/synapse-interface/constants/chains/master.tsx on lines 242..265
packages/synapse-interface/constants/chains/master.tsx on lines 267..290
packages/synapse-interface/constants/chains/master.tsx on lines 317..340
packages/synapse-interface/constants/chains/master.tsx on lines 342..365
packages/synapse-interface/constants/chains/master.tsx on lines 367..390
packages/synapse-interface/constants/chains/master.tsx on lines 392..415
packages/synapse-interface/constants/chains/master.tsx on lines 417..440
packages/synapse-interface/constants/chains/master.tsx on lines 442..465
packages/synapse-interface/constants/chains/master.tsx on lines 467..490

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

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

export const METIS: Chain = {
  priorityRank: 10,
  id: 1088,
  chainSymbol: 'METIS',
  name: 'Metis',
Severity: Major
Found in packages/synapse-interface/constants/chains/master.tsx and 15 other locations - About 4 hrs to fix
packages/synapse-interface/constants/chains/master.tsx on lines 63..87
packages/synapse-interface/constants/chains/master.tsx on lines 115..138
packages/synapse-interface/constants/chains/master.tsx on lines 140..163
packages/synapse-interface/constants/chains/master.tsx on lines 165..189
packages/synapse-interface/constants/chains/master.tsx on lines 191..215
packages/synapse-interface/constants/chains/master.tsx on lines 217..240
packages/synapse-interface/constants/chains/master.tsx on lines 242..265
packages/synapse-interface/constants/chains/master.tsx on lines 267..290
packages/synapse-interface/constants/chains/master.tsx on lines 292..315
packages/synapse-interface/constants/chains/master.tsx on lines 317..340
packages/synapse-interface/constants/chains/master.tsx on lines 367..390
packages/synapse-interface/constants/chains/master.tsx on lines 392..415
packages/synapse-interface/constants/chains/master.tsx on lines 417..440
packages/synapse-interface/constants/chains/master.tsx on lines 442..465
packages/synapse-interface/constants/chains/master.tsx on lines 467..490

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export const SCROLL: Chain = {
  priorityRank: 90,
  id: 534352,
  chainSymbol: 'SCROLL',
  name: 'Scroll',
Severity: Major
Found in packages/synapse-interface/constants/chains/master.tsx and 4 other locations - About 4 hrs to fix
packages/synapse-interface/constants/chains/master.tsx on lines 37..61
packages/synapse-interface/constants/chains/master.tsx on lines 492..516
packages/synapse-interface/constants/chains/master.tsx on lines 518..542
packages/synapse-interface/constants/chains/master.tsx on lines 595..619

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

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

export const AURORA: Chain = {
  priorityRank: 10,
  id: 1313161554,
  chainSymbol: 'AURORA',
  name: 'Aurora',
Severity: Major
Found in packages/synapse-interface/constants/chains/master.tsx and 15 other locations - About 4 hrs to fix
packages/synapse-interface/constants/chains/master.tsx on lines 63..87
packages/synapse-interface/constants/chains/master.tsx on lines 115..138
packages/synapse-interface/constants/chains/master.tsx on lines 140..163
packages/synapse-interface/constants/chains/master.tsx on lines 165..189
packages/synapse-interface/constants/chains/master.tsx on lines 191..215
packages/synapse-interface/constants/chains/master.tsx on lines 217..240
packages/synapse-interface/constants/chains/master.tsx on lines 242..265
packages/synapse-interface/constants/chains/master.tsx on lines 267..290
packages/synapse-interface/constants/chains/master.tsx on lines 292..315
packages/synapse-interface/constants/chains/master.tsx on lines 317..340
packages/synapse-interface/constants/chains/master.tsx on lines 342..365
packages/synapse-interface/constants/chains/master.tsx on lines 392..415
packages/synapse-interface/constants/chains/master.tsx on lines 417..440
packages/synapse-interface/constants/chains/master.tsx on lines 442..465
packages/synapse-interface/constants/chains/master.tsx on lines 467..490

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export const BLAST: Chain = {
  priorityRank: 90,
  id: 81457,
  chainSymbol: 'BLAST',
  name: 'Blast',
Severity: Major
Found in packages/synapse-interface/constants/chains/master.tsx and 4 other locations - About 4 hrs to fix
packages/synapse-interface/constants/chains/master.tsx on lines 37..61
packages/synapse-interface/constants/chains/master.tsx on lines 492..516
packages/synapse-interface/constants/chains/master.tsx on lines 544..567
packages/synapse-interface/constants/chains/master.tsx on lines 595..619

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

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 [chainId].tsx has 341 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import _ from 'lodash'
import { useState, useEffect } from 'react'
import { useRouter } from 'next/router'
import { CHAINS } from '@synapsecns/synapse-constants'
import { useLazyQuery, useQuery } from '@apollo/client'
Severity: Minor
Found in packages/explorer-ui/pages/chain/[chainId].tsx - About 4 hrs to fix

    Client has 33 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type Client struct {
        *rpc.Client
    }
    Severity: Minor
    Found in ethergo/backends/anvil/client.go - About 4 hrs to fix

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

      func (_m *ILightInbox) GetGuardReport(opts *bind.CallOpts, index *big.Int) (struct {
          StatementPayload []byte
          ReportSignature  []byte
      }, error) {
          ret := _m.Called(opts, index)
      Severity: Major
      Found in agents/contracts/lightinbox/mocks/i_light_inbox.go and 1 other location - About 4 hrs to fix
      agents/contracts/inbox/mocks/i_inbox.go on lines 410..440

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

      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 (_m *IInbox) GetGuardReport(opts *bind.CallOpts, index *big.Int) (struct {
          StatementPayload []byte
          ReportSignature  []byte
      }, error) {
          ret := _m.Called(opts, index)
      Severity: Major
      Found in agents/contracts/inbox/mocks/i_inbox.go and 1 other location - About 4 hrs to fix
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 318..348

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

      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 (p *ProxySuite) TestBlockByNumber() {
          backend := geth.NewEmbeddedBackend(p.GetTestContext(), p.T())
      
          latestNumber, err := backend.BlockNumber(p.GetTestContext())
          Nil(p.T(), err)
      Severity: Major
      Found in services/omnirpc/proxy/response_test.go and 1 other location - About 4 hrs to fix
      services/omnirpc/proxy/response_test.go on lines 350..374

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

      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 (p *ProxySuite) TestHeaderByNumber() {
          backend := geth.NewEmbeddedBackend(p.GetTestContext(), p.T())
      
          latestNumber, err := backend.BlockNumber(p.GetTestContext())
          Nil(p.T(), err)
      Severity: Major
      Found in services/omnirpc/proxy/response_test.go and 1 other location - About 4 hrs to fix
      services/omnirpc/proxy/response_test.go on lines 323..347

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

      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 (_m *ILightInbox) VerifyStateWithSnapshot(opts *bind.TransactOpts, stateIndex uint8, snapPayload []byte, snapSignature []byte) (*types.Transaction, error) {
          ret := _m.Called(opts, stateIndex, snapPayload, snapSignature)
      
          var r0 *types.Transaction
          if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint8, []byte, []byte) *types.Transaction); ok {
      Severity: Major
      Found in agents/contracts/lightinbox/mocks/i_light_inbox.go and 1 other location - About 4 hrs to fix
      agents/contracts/inbox/mocks/i_inbox.go on lines 1313..1333

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

      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 (_m *IInbox) VerifyStateWithSnapshot(opts *bind.TransactOpts, stateIndex uint8, snapPayload []byte, snapSignature []byte) (*types.Transaction, error) {
          ret := _m.Called(opts, stateIndex, snapPayload, snapSignature)
      
          var r0 *types.Transaction
          if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint8, []byte, []byte) *types.Transaction); ok {
      Severity: Major
      Found in agents/contracts/inbox/mocks/i_inbox.go and 1 other location - About 4 hrs to fix
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1014..1034

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

      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

      const functionsList: FooterDataProps[] = [
        {
          text: 'Functions',
          type: null,
          url: null,
      packages/explorer-ui/components/layouts/MainLayout/PageFooter.tsx on lines 32..58
      packages/explorer-ui/components/layouts/MainLayout/PageFooter.tsx on lines 60..86
      packages/synapse-interface/components/layouts/LandingPageWrapper/PageFooter.tsx on lines 63..89

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

      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

      const developersList: FooterDataProps[] = [
        {
          text: 'Developers',
          type: null,
          url: null,
      packages/explorer-ui/components/layouts/MainLayout/PageFooter.tsx on lines 32..58
      packages/explorer-ui/components/layouts/MainLayout/PageFooter.tsx on lines 60..86
      packages/synapse-interface/components/layouts/LandingPageWrapper/PageFooter.tsx on lines 35..61

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

      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

      const functions: FooterDataProps[] = [
        {
          text: 'Functions',
          type: null,
          url: null,
      packages/explorer-ui/components/layouts/MainLayout/PageFooter.tsx on lines 60..86
      packages/synapse-interface/components/layouts/LandingPageWrapper/PageFooter.tsx on lines 35..61
      packages/synapse-interface/components/layouts/LandingPageWrapper/PageFooter.tsx on lines 63..89

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

      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

      const developers: FooterDataProps[] = [
        {
          text: 'Developers',
          type: null,
          url: null,
      packages/explorer-ui/components/layouts/MainLayout/PageFooter.tsx on lines 32..58
      packages/synapse-interface/components/layouts/LandingPageWrapper/PageFooter.tsx on lines 35..61
      packages/synapse-interface/components/layouts/LandingPageWrapper/PageFooter.tsx on lines 63..89

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

      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

        public async bridge(
          to: string,
          chainId: number,
          token: string,
          amount: BigintIsh,
      Severity: Major
      Found in packages/sdk-router/src/router/synapseCCTPRouter.ts and 1 other location - About 4 hrs to fix
      packages/sdk-router/src/router/synapseRouter.ts on lines 164..187

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

      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

        public async bridge(
          to: string,
          chainId: number,
          token: string,
          amount: BigintIsh,
      Severity: Major
      Found in packages/sdk-router/src/router/synapseRouter.ts and 1 other location - About 4 hrs to fix
      packages/sdk-router/src/router/synapseCCTPRouter.ts on lines 122..145

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

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

      func GetDefiLlamaData(ctx context.Context, timestamp int, coinGeckoID string) *float64 {
          zero := float64(0)
      
          if coinGeckoID == "NO_TOKEN" || coinGeckoID == "NO_PRICE" {
              // if there is no data on the token, the amount returned will be 1:1 (price will be same as the amount of token
      Severity: Minor
      Found in services/explorer/consumer/fetcher/pricefetcher.go - About 4 hrs 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

      Severity
      Category
      Status
      Source
      Language