synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

Method Indexer.store has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
Open

func (x *Indexer) store(parentCtx context.Context, log types.Log) (err error) {
    ctx, span := x.handler.Tracer().Start(parentCtx, "store", trace.WithAttributes(
        attribute.String("contract", x.addressesToString(x.indexerConfig.Addresses)),
        attribute.String("tx", log.TxHash.Hex()),
        attribute.String("block", fmt.Sprintf("%d", log.BlockNumber)),
Severity: Minor
Found in services/scribe/service/indexer/indexer.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

Function nest_results has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

const nest_results = (sqlResults: any[]) => {
  return sqlResults.map((transaction: any) => {
    const bridgeRequest: { [key: string]: any } = {}
    const bridgeRelay: { [key: string]: any } = {}
    const bridgeProof: { [key: string]: any } = {}
Severity: Minor
Found in packages/rfq-indexer/api/src/graphql/resolvers.ts - 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

Function nest_results has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

export const nest_results = (sqlResults: any[]) => {
  return sqlResults.map((transaction: any) => {
    const bridgeRequest: { [key: string]: any } = {}
    const bridgeRelay: { [key: string]: any } = {}
    const bridgeProof: { [key: string]: any } = {}
Severity: Minor
Found in packages/rfq-indexer/api/src/utils/nestResults.ts - 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

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

    t.Run("Close writer before reading", func(t *testing.T) {
        pipe := processlog.NewBufferedPipe()

        testData := []byte("Hello, World!")

Severity: Major
Found in core/processlog/stream_test.go and 1 other location - About 4 hrs to fix
core/processlog/stream_test.go on lines 207..246

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

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

    t.Run("Write and read data", func(t *testing.T) {
        pipe := processlog.NewBufferedPipe()

        testData := []byte("Hello, World!")

Severity: Major
Found in core/processlog/stream_test.go and 1 other location - About 4 hrs to fix
core/processlog/stream_test.go on lines 248..287

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

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

func (_m *IBondingManager) FilterStatusUpdated(opts *bind.FilterOpts, domain []uint32, agent []common.Address) (*bondingmanager.BondingManagerStatusUpdatedIterator, error) {
    ret := _m.Called(opts, domain, agent)

    var r0 *bondingmanager.BondingManagerStatusUpdatedIterator
    if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint32, []common.Address) *bondingmanager.BondingManagerStatusUpdatedIterator); ok {
Severity: Major
Found in agents/contracts/bondingmanager/mocks/i_bonding_manager.go and 2 other locations - About 4 hrs to fix
agents/contracts/inbox/mocks/i_inbox.go on lines 387..407
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 403..423

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

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

func (_m *ILightManager) FilterStatusUpdated(opts *bind.FilterOpts, domain []uint32, agent []common.Address) (*lightmanager.LightManagerStatusUpdatedIterator, error) {
    ret := _m.Called(opts, domain, agent)

    var r0 *lightmanager.LightManagerStatusUpdatedIterator
    if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint32, []common.Address) *lightmanager.LightManagerStatusUpdatedIterator); ok {
Severity: Major
Found in agents/contracts/lightmanager/mocks/i_light_manager.go and 2 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 495..515
agents/contracts/inbox/mocks/i_inbox.go on lines 387..407

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

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

func (_m *IInbox) FilterSnapshotAccepted(opts *bind.FilterOpts, domain []uint32, agent []common.Address) (*inbox.InboxSnapshotAcceptedIterator, error) {
    ret := _m.Called(opts, domain, agent)

    var r0 *inbox.InboxSnapshotAcceptedIterator
    if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []uint32, []common.Address) *inbox.InboxSnapshotAcceptedIterator); ok {
Severity: Major
Found in agents/contracts/inbox/mocks/i_inbox.go and 2 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 495..515
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 403..423

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

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

        for i := 1; i <= confirmedBlockHeight; i++ {
            // Nonce is used to determine if a tx is confirmed or not
            testTx := types.NewTx(&types.LegacyTx{
                Nonce:    uint64(1),
                GasPrice: new(big.Int).SetUint64(gofakeit.Uint64()),
Severity: Major
Found in services/scribe/db/athead_test.go and 1 other location - About 4 hrs to fix
services/scribe/db/athead_test.go on lines 162..179

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

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

        for i := confirmedBlockHeight + 1; i <= headBlock; i++ {
            testTx := types.NewTx(&types.LegacyTx{
                Nonce:    uint64(0),
                GasPrice: new(big.Int).SetUint64(gofakeit.Uint64()),
                Gas:      gofakeit.Uint64(),
Severity: Major
Found in services/scribe/db/athead_test.go and 1 other location - About 4 hrs to fix
services/scribe/db/athead_test.go on lines 141..159

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

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 *Chain) HeaderByTime(ctx context.Context, startBlock *big.Int, searchTime time.Time) (*types.Header, error) {
    ret := _m.Called(ctx, startBlock, searchTime)

    var r0 *types.Header
    if rf, ok := ret.Get(0).(func(context.Context, *big.Int, time.Time) *types.Header); ok {
Severity: Major
Found in ethergo/chain/mocks/chain.go and 1 other location - About 4 hrs to fix
ethergo/backends/mocks/simulated_test_backend.go on lines 623..643

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

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 *SimulatedTestBackend) HeaderByTime(ctx context.Context, startBlock *big.Int, searchTime time.Time) (*types.Header, error) {
    ret := _m.Called(ctx, startBlock, searchTime)

    var r0 *types.Header
    if rf, ok := ret.Get(0).(func(context.Context, *big.Int, time.Time) *types.Header); ok {
Severity: Major
Found in ethergo/backends/mocks/simulated_test_backend.go and 1 other location - About 4 hrs to fix
ethergo/chain/mocks/chain.go on lines 511..531

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

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

func (ec *executionContext) _AddressData_chainRanking(ctx context.Context, field graphql.CollectedField, obj *model.AddressData) (ret graphql.Marshaler) {
    fc, err := ec.fieldContext_AddressData_chainRanking(ctx, field)
    if err != nil {
        return graphql.Null
    }
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 2 other locations - About 4 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 3085..3111
services/explorer/graphql/server/graph/resolver/server.go on lines 5155..5181

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

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

func (ec *executionContext) _AddressData_dailyData(ctx context.Context, field graphql.CollectedField, obj *model.AddressData) (ret graphql.Marshaler) {
    fc, err := ec.fieldContext_AddressData_dailyData(ctx, field)
    if err != nil {
        return graphql.Null
    }
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 2 other locations - About 4 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 3036..3062
services/explorer/graphql/server/graph/resolver/server.go on lines 5155..5181

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

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

func (ec *executionContext) _HistoricalResult_dateResults(ctx context.Context, field graphql.CollectedField, obj *model.HistoricalResult) (ret graphql.Marshaler) {
    fc, err := ec.fieldContext_HistoricalResult_dateResults(ctx, field)
    if err != nil {
        return graphql.Null
    }
Severity: Major
Found in services/explorer/graphql/server/graph/resolver/server.go and 2 other locations - About 4 hrs to fix
services/explorer/graphql/server/graph/resolver/server.go on lines 3036..3062
services/explorer/graphql/server/graph/resolver/server.go on lines 3085..3111

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

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

export const LINK: BridgeableToken = {
  addresses: {
    [CHAINS.ETHEREUM.id]: '0x514910771af9ca656af840dff83e8264ecf986ca',
    [CHAINS.KLAYTN.id]: '0xfbed1abb3ad0f8c467068de9fde905887e8c9118',
  },
Severity: Major
Found in packages/widget/src/constants/bridgeable.ts and 21 other locations - About 4 hrs to fix
packages/rest-api/src/constants/bridgeable.ts on lines 48..65
packages/rest-api/src/constants/bridgeable.ts on lines 67..81
packages/rest-api/src/constants/bridgeable.ts on lines 104..121
packages/rest-api/src/constants/bridgeable.ts on lines 167..184
packages/rest-api/src/constants/bridgeable.ts on lines 270..287
packages/rest-api/src/constants/bridgeable.ts on lines 320..337
packages/rest-api/src/constants/bridgeable.ts on lines 339..356
packages/rest-api/src/constants/bridgeable.ts on lines 404..421
packages/rest-api/src/constants/bridgeable.ts on lines 976..993
packages/rest-api/src/constants/bridgeable.ts on lines 1022..1039
packages/rest-api/src/constants/bridgeable.ts on lines 1326..1344
packages/widget/src/constants/bridgeable.ts on lines 67..81
packages/widget/src/constants/bridgeable.ts on lines 104..121
packages/widget/src/constants/bridgeable.ts on lines 167..184
packages/widget/src/constants/bridgeable.ts on lines 270..287
packages/widget/src/constants/bridgeable.ts on lines 320..337
packages/widget/src/constants/bridgeable.ts on lines 339..356
packages/widget/src/constants/bridgeable.ts on lines 404..421
packages/widget/src/constants/bridgeable.ts on lines 974..991
packages/widget/src/constants/bridgeable.ts on lines 1018..1035
packages/widget/src/constants/bridgeable.ts on lines 1322..1340

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

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

export const SFI: BridgeableToken = {
  addresses: {
    [CHAINS.ETHEREUM.id]: '0xb753428af26e81097e7fd17f40c88aaa3e04902c',
    [CHAINS.AVALANCHE.id]: '0xc2Bf0A1f7D8Da50D608bc96CF701110d4A438312',
  },
Severity: Major
Found in packages/rest-api/src/constants/bridgeable.ts and 21 other locations - About 4 hrs to fix
packages/rest-api/src/constants/bridgeable.ts on lines 48..65
packages/rest-api/src/constants/bridgeable.ts on lines 67..81
packages/rest-api/src/constants/bridgeable.ts on lines 167..184
packages/rest-api/src/constants/bridgeable.ts on lines 270..287
packages/rest-api/src/constants/bridgeable.ts on lines 320..337
packages/rest-api/src/constants/bridgeable.ts on lines 339..356
packages/rest-api/src/constants/bridgeable.ts on lines 404..421
packages/rest-api/src/constants/bridgeable.ts on lines 976..993
packages/rest-api/src/constants/bridgeable.ts on lines 1022..1039
packages/rest-api/src/constants/bridgeable.ts on lines 1326..1344
packages/widget/src/constants/bridgeable.ts on lines 48..65
packages/widget/src/constants/bridgeable.ts on lines 67..81
packages/widget/src/constants/bridgeable.ts on lines 104..121
packages/widget/src/constants/bridgeable.ts on lines 167..184
packages/widget/src/constants/bridgeable.ts on lines 270..287
packages/widget/src/constants/bridgeable.ts on lines 320..337
packages/widget/src/constants/bridgeable.ts on lines 339..356
packages/widget/src/constants/bridgeable.ts on lines 404..421
packages/widget/src/constants/bridgeable.ts on lines 974..991
packages/widget/src/constants/bridgeable.ts on lines 1018..1035
packages/widget/src/constants/bridgeable.ts on lines 1322..1340

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

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

export const XJEWEL: BridgeableToken = {
  addresses: {
    [CHAINS.DFK.id]: '0x77f2656d04E158f915bC22f07B779D94c1DC47Ff',
    [CHAINS.HARMONY.id]: '0xA9cE83507D872C5e1273E745aBcfDa849DAA654F',
  },
Severity: Major
Found in packages/widget/src/constants/bridgeable.ts and 21 other locations - About 4 hrs to fix
packages/rest-api/src/constants/bridgeable.ts on lines 48..65
packages/rest-api/src/constants/bridgeable.ts on lines 67..81
packages/rest-api/src/constants/bridgeable.ts on lines 104..121
packages/rest-api/src/constants/bridgeable.ts on lines 167..184
packages/rest-api/src/constants/bridgeable.ts on lines 270..287
packages/rest-api/src/constants/bridgeable.ts on lines 320..337
packages/rest-api/src/constants/bridgeable.ts on lines 339..356
packages/rest-api/src/constants/bridgeable.ts on lines 404..421
packages/rest-api/src/constants/bridgeable.ts on lines 976..993
packages/rest-api/src/constants/bridgeable.ts on lines 1022..1039
packages/rest-api/src/constants/bridgeable.ts on lines 1326..1344
packages/widget/src/constants/bridgeable.ts on lines 48..65
packages/widget/src/constants/bridgeable.ts on lines 67..81
packages/widget/src/constants/bridgeable.ts on lines 104..121
packages/widget/src/constants/bridgeable.ts on lines 167..184
packages/widget/src/constants/bridgeable.ts on lines 270..287
packages/widget/src/constants/bridgeable.ts on lines 320..337
packages/widget/src/constants/bridgeable.ts on lines 339..356
packages/widget/src/constants/bridgeable.ts on lines 404..421
packages/widget/src/constants/bridgeable.ts on lines 1018..1035
packages/widget/src/constants/bridgeable.ts on lines 1322..1340

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

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

export const XJEWEL: BridgeableToken = {
  addresses: {
    [CHAINS.DFK.id]: '0x77f2656d04E158f915bC22f07B779D94c1DC47Ff',
    [CHAINS.HARMONY.id]: '0xA9cE83507D872C5e1273E745aBcfDa849DAA654F',
  },
Severity: Major
Found in packages/rest-api/src/constants/bridgeable.ts and 21 other locations - About 4 hrs to fix
packages/rest-api/src/constants/bridgeable.ts on lines 48..65
packages/rest-api/src/constants/bridgeable.ts on lines 67..81
packages/rest-api/src/constants/bridgeable.ts on lines 104..121
packages/rest-api/src/constants/bridgeable.ts on lines 167..184
packages/rest-api/src/constants/bridgeable.ts on lines 270..287
packages/rest-api/src/constants/bridgeable.ts on lines 320..337
packages/rest-api/src/constants/bridgeable.ts on lines 339..356
packages/rest-api/src/constants/bridgeable.ts on lines 404..421
packages/rest-api/src/constants/bridgeable.ts on lines 1022..1039
packages/rest-api/src/constants/bridgeable.ts on lines 1326..1344
packages/widget/src/constants/bridgeable.ts on lines 48..65
packages/widget/src/constants/bridgeable.ts on lines 67..81
packages/widget/src/constants/bridgeable.ts on lines 104..121
packages/widget/src/constants/bridgeable.ts on lines 167..184
packages/widget/src/constants/bridgeable.ts on lines 270..287
packages/widget/src/constants/bridgeable.ts on lines 320..337
packages/widget/src/constants/bridgeable.ts on lines 339..356
packages/widget/src/constants/bridgeable.ts on lines 404..421
packages/widget/src/constants/bridgeable.ts on lines 974..991
packages/widget/src/constants/bridgeable.ts on lines 1018..1035
packages/widget/src/constants/bridgeable.ts on lines 1322..1340

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

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

export const PLS: BridgeableToken = {
  addresses: {
    [CHAINS.ARBITRUM.id]: '0x51318b7d00db7acc4026c88c3952b66278b6a67f',
    [CHAINS.OPTIMISM.id]: '0xD9eAA386cCD65F30b77FF175F6b52115FE454fD6',
  },
Severity: Major
Found in packages/widget/src/constants/bridgeable.ts and 21 other locations - About 4 hrs to fix
packages/rest-api/src/constants/bridgeable.ts on lines 48..65
packages/rest-api/src/constants/bridgeable.ts on lines 67..81
packages/rest-api/src/constants/bridgeable.ts on lines 104..121
packages/rest-api/src/constants/bridgeable.ts on lines 167..184
packages/rest-api/src/constants/bridgeable.ts on lines 270..287
packages/rest-api/src/constants/bridgeable.ts on lines 320..337
packages/rest-api/src/constants/bridgeable.ts on lines 339..356
packages/rest-api/src/constants/bridgeable.ts on lines 404..421
packages/rest-api/src/constants/bridgeable.ts on lines 976..993
packages/rest-api/src/constants/bridgeable.ts on lines 1022..1039
packages/rest-api/src/constants/bridgeable.ts on lines 1326..1344
packages/widget/src/constants/bridgeable.ts on lines 48..65
packages/widget/src/constants/bridgeable.ts on lines 67..81
packages/widget/src/constants/bridgeable.ts on lines 104..121
packages/widget/src/constants/bridgeable.ts on lines 167..184
packages/widget/src/constants/bridgeable.ts on lines 270..287
packages/widget/src/constants/bridgeable.ts on lines 320..337
packages/widget/src/constants/bridgeable.ts on lines 404..421
packages/widget/src/constants/bridgeable.ts on lines 974..991
packages/widget/src/constants/bridgeable.ts on lines 1018..1035
packages/widget/src/constants/bridgeable.ts on lines 1322..1340

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

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