synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

  {
    inputs: [
      {
        internalType: 'uint8',
        name: 'tokenIndexFrom',
Severity: Major
Found in packages/synapse-interface/constants/abis/avSwapWrapper.ts and 4 other locations - About 4 hrs to fix
packages/rfq-loadtest/src/abi.ts on lines 822..836
packages/synapse-interface/constants/abis/swap.ts on lines 889..927
packages/synapse-interface/constants/abis/swapEthWrapper.ts on lines 302..340
packages/synapse-interface/constants/abis/synapseRouter.ts on lines 32..70

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

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

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

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

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

Refactorings

Further Reading

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

export const UNIDX = new Token({
  addresses: {
    [CHAINS.ETH.id]: '0xf0655dcee37e5c0b70fffd70d85f88f8edf0aff6',
    [CHAINS.ARBITRUM.id]: '0x5429706887FCb58a595677B73E9B0441C25d993D',
    [CHAINS.FANTOM.id]: '0x0483a76D80D0aFEC6bd2afd12C1AD865b9DF1471',
Severity: Major
Found in packages/synapse-interface/constants/tokens/bridgeable.ts and 1 other location - About 4 hrs to fix
packages/synapse-interface/constants/tokens/bridgeable.ts on lines 226..243

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

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

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

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

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

Refactorings

Further Reading

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

export const SDT = new Token({
  addresses: {
    [CHAINS.ETH.id]: '0x73968b9a57c6e53d41345fd57a6e6ae27d6cdb2f',
    [CHAINS.AVALANCHE.id]: '0xCCBf7c451F81752F7d2237F2c18C371E6e089E69',
    [CHAINS.ARBITRUM.id]: '0x087d18A77465c34CDFd3a081a2504b7E86CE4EF8',
Severity: Major
Found in packages/synapse-interface/constants/tokens/bridgeable.ts and 1 other location - About 4 hrs to fix
packages/synapse-interface/constants/tokens/bridgeable.ts on lines 364..381

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

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

func (_m *IGasOracle) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *gasoracle.GasOracleOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *gasoracle.GasOracleOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/gasoracle/mocks/i_gas_oracle.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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

func (_m *IInbox) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *inbox.InboxOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *inbox.InboxOwnershipTransferStarted, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/inbox/mocks/i_inbox.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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

func (_m *ILightManager) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *lightmanager.LightManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *lightmanager.LightManagerOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/lightmanager/mocks/i_light_manager.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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

func (_m *IInbox) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *inbox.InboxOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *inbox.InboxOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/inbox/mocks/i_inbox.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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

func (_m *ILightInbox) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *lightinbox.LightInboxOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *lightinbox.LightInboxOwnershipTransferStarted, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/lightinbox/mocks/i_light_inbox.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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

func (_m *ILightManager) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *lightmanager.LightManagerOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *lightmanager.LightManagerOwnershipTransferStarted, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/lightmanager/mocks/i_light_manager.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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

func (_m *IGasOracle) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *gasoracle.GasOracleOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *gasoracle.GasOracleOwnershipTransferStarted, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/gasoracle/mocks/i_gas_oracle.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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

func (_m *IOrigin) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *origin.OriginOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *origin.OriginOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/origin/mocks/i_origin.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950

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

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

func (_m *ILightInbox) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *lightinbox.LightInboxOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *lightinbox.LightInboxOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/lightinbox/mocks/i_light_inbox.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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

func (_m *IOrigin) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *origin.OriginOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *origin.OriginOwnershipTransferStarted, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/origin/mocks/i_origin.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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) SubmitStateReportWithAttestation(opts *bind.TransactOpts, stateIndex uint8, srSignature []byte, snapPayload []byte, attPayload []byte, attSignature []byte) (*types.Transaction, error) {
    ret := _m.Called(opts, stateIndex, srSignature, snapPayload, attPayload, attSignature)

    var r0 *types.Transaction
    if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint8, []byte, []byte, []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 809..829

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

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

func (_m *IBondingManager) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *bondingmanager.BondingManagerOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *bondingmanager.BondingManagerOwnershipTransferStarted, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/bondingmanager/mocks/i_bonding_manager.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1445..1465
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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

func (_m *IBondingManager) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *bondingmanager.BondingManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
    ret := _m.Called(opts, sink, previousOwner, newOwner)

    var r0 event.Subscription
    if rf, ok := ret.Get(0).(func(*bind.WatchOpts, chan<- *bondingmanager.BondingManagerOwnershipTransferred, []common.Address, []common.Address) event.Subscription); ok {
Severity: Major
Found in agents/contracts/bondingmanager/mocks/i_bonding_manager.go and 11 other locations - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1422..1442
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 798..818
agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 821..841
agents/contracts/inbox/mocks/i_inbox.go on lines 1587..1607
agents/contracts/inbox/mocks/i_inbox.go on lines 1610..1630
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1242..1262
agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 1265..1285
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1294..1314
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1317..1337
agents/contracts/origin/mocks/i_origin.go on lines 930..950
agents/contracts/origin/mocks/i_origin.go on lines 953..973

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

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) SubmitStateReportWithAttestation(opts *bind.TransactOpts, stateIndex uint8, srSignature []byte, snapPayload []byte, attPayload []byte, attSignature []byte) (*types.Transaction, error) {
    ret := _m.Called(opts, stateIndex, srSignature, snapPayload, attPayload, attSignature)

    var r0 *types.Transaction
    if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint8, []byte, []byte, []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 1039..1059

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

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

func getChainBackfiller(consumerDB db.ConsumerDB, chainConfig indexerConfig.ChainConfig, fetcher fetcherpkg.ScribeFetcher, client bind.ContractBackend, tokenDataService tokendata.Service, priceDataService tokenprice.Service) (*backfill.ChainBackfiller, error) {
    var err error
    var bridgeParser *parser.BridgeParser
    var messageBusParser *parser.MessageBusParser
    var cctpParser *parser.CCTPParser
Severity: Minor
Found in services/explorer/node/explorer.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

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

func (x *Indexer) Index(parentCtx context.Context, startHeight uint64, endHeight uint64) (err error) {
    ctx, span := x.handler.Tracer().Start(parentCtx, "contract.Backfill", trace.WithAttributes(
        attribute.Int("chain", int(x.indexerConfig.ChainID)),
        attribute.String("address", x.addressesToString(x.indexerConfig.Addresses)),
        attribute.Int("start", int(startHeight)),
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 StateManagedSwap has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

const StateManagedSwap = () => {
  const { address } = useAccount()
  const { synapseSDK } = useSynapseContext()
  const swapDisplayRef = useRef(null)
  const quoteToastRef = useRef({ id: '' })
Severity: Minor
Found in packages/synapse-interface/pages/swap/index.tsx - 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