synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

  it('should return 400 for invalid fromToken + toToken combo', async () => {
    const response = await request(app).get('/swap').query({
      chain: '1',
      fromToken: ETH.addresses[1],
      toToken: USDC.addresses[1],
Severity: Major
Found in packages/rest-api/src/tests/swapRoute.test.ts and 1 other location - About 4 hrs to fix
packages/rest-api/src/tests/swapRoute.test.ts on lines 81..94

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

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

  it('should return 400 for swap on unsupported chain', async () => {
    const response = await request(app).get('/swap').query({
      chain: '59144',
      fromToken: USDC.addresses[59144],
      toToken: USDT.addresses[59144],
Severity: Major
Found in packages/rest-api/src/tests/swapRoute.test.ts and 1 other location - About 4 hrs to fix
packages/rest-api/src/tests/swapRoute.test.ts on lines 96..109

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 122.

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) fieldContext_Query_addressRanking(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
    fc = &graphql.FieldContext{
        Object:     "Query",
        Field:      field,
        IsMethod:   true,
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 7059..7087
services/explorer/graphql/server/graph/resolver/server.go on lines 7395..7423

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

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) fieldContext_Query_countByChainId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
    fc = &graphql.FieldContext{
        Object:     "Query",
        Field:      field,
        IsMethod:   true,
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 7177..7205
services/explorer/graphql/server/graph/resolver/server.go on lines 7395..7423

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

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) fieldContext_Query_rankedChainIDsByVolume(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
    fc = &graphql.FieldContext{
        Object:     "Query",
        Field:      field,
        IsMethod:   true,
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 7059..7087
services/explorer/graphql/server/graph/resolver/server.go on lines 7177..7205

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

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 *ILightManager) SlashAgent(opts *bind.TransactOpts, domain uint32, agent common.Address, prover common.Address) (*types.Transaction, error) {
    ret := _m.Called(opts, domain, agent, prover)

    var r0 *types.Transaction
    if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint32, common.Address, common.Address) *types.Transaction); ok {
Severity: Major
Found in agents/contracts/lightmanager/mocks/i_light_manager.go and 1 other location - About 4 hrs to fix
agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 1219..1239

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

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 (c *rebalanceManagerCircleCCTP) listenMessageReceived(parentCtx context.Context, chainID int, ethClient client.EVM) (err error) {
    listener, ok := c.transmitterListeners[chainID]
    if !ok {
        return fmt.Errorf("could not find listener for chain %d", chainID)
    }
Severity: Major
Found in services/rfq/relayer/inventory/circle.go and 1 other location - About 4 hrs to fix
services/rfq/relayer/inventory/circle.go on lines 260..289

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

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 *IBondingManager) SlashAgent(opts *bind.TransactOpts, domain uint32, agent common.Address, prover common.Address) (*types.Transaction, error) {
    ret := _m.Called(opts, domain, agent, prover)

    var r0 *types.Transaction
    if rf, ok := ret.Get(0).(func(*bind.TransactOpts, uint32, common.Address, common.Address) *types.Transaction); ok {
Severity: Major
Found in agents/contracts/bondingmanager/mocks/i_bonding_manager.go and 1 other location - About 4 hrs to fix
agents/contracts/lightmanager/mocks/i_light_manager.go on lines 1091..1111

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

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 (c *rebalanceManagerCircleCCTP) listenDepositForBurn(parentCtx context.Context, chainID int, ethClient client.EVM) (err error) {
    listener, ok := c.messengerListeners[chainID]
    if !ok {
        return fmt.Errorf("could not find listener for chain %d", chainID)
    }
Severity: Major
Found in services/rfq/relayer/inventory/circle.go and 1 other location - About 4 hrs to fix
services/rfq/relayer/inventory/circle.go on lines 292..321

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

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 ExplorerLinks = {
  1: 'https://etherscan.com',
  42161: 'https://arbiscan.io',
  56: 'https://bscscan.com',
  43114: 'https://snowtrace.io/',
Severity: Major
Found in packages/widget/src/constants/explorer.ts and 1 other location - About 4 hrs to fix
packages/widget/src/constants/explorer.ts on lines 26..49

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

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 ExplorerNames = {
  1: 'Etherscan',
  42161: 'Arbiscan',
  56: 'BscScan',
  43114: 'Snowtrace',
Severity: Major
Found in packages/widget/src/constants/explorer.ts and 1 other location - About 4 hrs to fix
packages/widget/src/constants/explorer.ts on lines 1..24

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

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 swapEthWrapper.ts has 345 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export const SWAP_ETH_WRAPPER_ABI = [
  {
    inputs: [
      {
        internalType: 'address payable',
Severity: Minor
Found in packages/synapse-interface/constants/abis/swapEthWrapper.ts - About 4 hrs to fix

    File index.tsx has 345 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { BigNumber } from '@ethersproject/bignumber'
    import * as CHAINS from '@constants/chains/master'
    import { getAddress } from 'viem'
    
    export type Chain = {
    Severity: Minor
    Found in packages/synapse-interface/utils/types/index.tsx - About 4 hrs to fix

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

      func (_m *IOrigin) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*origin.OriginOwnershipTransferStartedIterator, error) {
          ret := _m.Called(opts, previousOwner, newOwner)
      
          var r0 *origin.OriginOwnershipTransferStartedIterator
          if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *origin.OriginOwnershipTransferStartedIterator); 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 380..400
      agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 403..423
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 134..154
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 157..177
      agents/contracts/inbox/mocks/i_inbox.go on lines 318..338
      agents/contracts/inbox/mocks/i_inbox.go on lines 341..361
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 272..292
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 295..315
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 288..308
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 311..331
      agents/contracts/origin/mocks/i_origin.go on lines 155..175

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

      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) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*lightinbox.LightInboxOwnershipTransferredIterator, error) {
          ret := _m.Called(opts, previousOwner, newOwner)
      
          var r0 *lightinbox.LightInboxOwnershipTransferredIterator
          if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *lightinbox.LightInboxOwnershipTransferredIterator); 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 380..400
      agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 403..423
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 134..154
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 157..177
      agents/contracts/inbox/mocks/i_inbox.go on lines 318..338
      agents/contracts/inbox/mocks/i_inbox.go on lines 341..361
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 272..292
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 288..308
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 311..331
      agents/contracts/origin/mocks/i_origin.go on lines 132..152
      agents/contracts/origin/mocks/i_origin.go on lines 155..175

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

      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) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*lightinbox.LightInboxOwnershipTransferStartedIterator, error) {
          ret := _m.Called(opts, previousOwner, newOwner)
      
          var r0 *lightinbox.LightInboxOwnershipTransferStartedIterator
          if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *lightinbox.LightInboxOwnershipTransferStartedIterator); 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 380..400
      agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 403..423
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 134..154
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 157..177
      agents/contracts/inbox/mocks/i_inbox.go on lines 318..338
      agents/contracts/inbox/mocks/i_inbox.go on lines 341..361
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 295..315
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 288..308
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 311..331
      agents/contracts/origin/mocks/i_origin.go on lines 132..152
      agents/contracts/origin/mocks/i_origin.go on lines 155..175

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

      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) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*origin.OriginOwnershipTransferredIterator, error) {
          ret := _m.Called(opts, previousOwner, newOwner)
      
          var r0 *origin.OriginOwnershipTransferredIterator
          if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *origin.OriginOwnershipTransferredIterator); 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 380..400
      agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 403..423
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 134..154
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 157..177
      agents/contracts/inbox/mocks/i_inbox.go on lines 318..338
      agents/contracts/inbox/mocks/i_inbox.go on lines 341..361
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 272..292
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 295..315
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 288..308
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 311..331
      agents/contracts/origin/mocks/i_origin.go on lines 132..152

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

      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) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*inbox.InboxOwnershipTransferredIterator, error) {
          ret := _m.Called(opts, previousOwner, newOwner)
      
          var r0 *inbox.InboxOwnershipTransferredIterator
          if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *inbox.InboxOwnershipTransferredIterator); 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 380..400
      agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 403..423
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 134..154
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 157..177
      agents/contracts/inbox/mocks/i_inbox.go on lines 318..338
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 272..292
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 295..315
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 288..308
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 311..331
      agents/contracts/origin/mocks/i_origin.go on lines 132..152
      agents/contracts/origin/mocks/i_origin.go on lines 155..175

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

      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) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*bondingmanager.BondingManagerOwnershipTransferStartedIterator, error) {
          ret := _m.Called(opts, previousOwner, newOwner)
      
          var r0 *bondingmanager.BondingManagerOwnershipTransferStartedIterator
          if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *bondingmanager.BondingManagerOwnershipTransferStartedIterator); 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 403..423
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 134..154
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 157..177
      agents/contracts/inbox/mocks/i_inbox.go on lines 318..338
      agents/contracts/inbox/mocks/i_inbox.go on lines 341..361
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 272..292
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 295..315
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 288..308
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 311..331
      agents/contracts/origin/mocks/i_origin.go on lines 132..152
      agents/contracts/origin/mocks/i_origin.go on lines 155..175

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

      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) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*gasoracle.GasOracleOwnershipTransferStartedIterator, error) {
          ret := _m.Called(opts, previousOwner, newOwner)
      
          var r0 *gasoracle.GasOracleOwnershipTransferStartedIterator
          if rf, ok := ret.Get(0).(func(*bind.FilterOpts, []common.Address, []common.Address) *gasoracle.GasOracleOwnershipTransferStartedIterator); 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 380..400
      agents/contracts/bondingmanager/mocks/i_bonding_manager.go on lines 403..423
      agents/contracts/gasoracle/mocks/i_gas_oracle.go on lines 157..177
      agents/contracts/inbox/mocks/i_inbox.go on lines 318..338
      agents/contracts/inbox/mocks/i_inbox.go on lines 341..361
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 272..292
      agents/contracts/lightinbox/mocks/i_light_inbox.go on lines 295..315
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 288..308
      agents/contracts/lightmanager/mocks/i_light_manager.go on lines 311..331
      agents/contracts/origin/mocks/i_origin.go on lines 132..152
      agents/contracts/origin/mocks/i_origin.go on lines 155..175

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

      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