synapsecns/sanguine

View on GitHub

Showing 13,422 of 13,422 total issues

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

export const OPTIMISM: Chain = {
  priorityRank: 80,
  id: 10,
  chainSymbol: 'OPTIMISM',
  name: 'Optimism',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 15 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 29..49
packages/synapse-constants/src/constants/chains/master.ts on lines 74..94
packages/synapse-constants/src/constants/chains/master.ts on lines 96..116
packages/synapse-constants/src/constants/chains/master.ts on lines 140..160
packages/synapse-constants/src/constants/chains/master.ts on lines 162..182
packages/synapse-constants/src/constants/chains/master.ts on lines 184..204
packages/synapse-constants/src/constants/chains/master.ts on lines 206..226
packages/synapse-constants/src/constants/chains/master.ts on lines 228..248
packages/synapse-constants/src/constants/chains/master.ts on lines 250..270
packages/synapse-constants/src/constants/chains/master.ts on lines 272..292
packages/synapse-constants/src/constants/chains/master.ts on lines 294..314
packages/synapse-constants/src/constants/chains/master.ts on lines 316..336
packages/synapse-constants/src/constants/chains/master.ts on lines 338..358
packages/synapse-constants/src/constants/chains/master.ts on lines 360..380
packages/synapse-constants/src/constants/chains/master.ts on lines 382..402

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

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

export const WORLDCHAIN: Chain = {
  priorityRank: 99,
  id: 480,
  chainSymbol: 'WORLDCHAIN',
  name: 'World Chain',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 5 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 3..27
packages/synapse-constants/src/constants/chains/master.ts on lines 404..428
packages/synapse-constants/src/constants/chains/master.ts on lines 430..454
packages/synapse-constants/src/constants/chains/master.ts on lines 456..480
packages/synapse-constants/src/constants/chains/master.ts on lines 482..506

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

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

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

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

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

Refactorings

Further Reading

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

export const POLYGON: Chain = {
  priorityRank: 80,
  id: 137,
  chainSymbol: 'POLYGON',
  name: 'Polygon',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 15 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 29..49
packages/synapse-constants/src/constants/chains/master.ts on lines 74..94
packages/synapse-constants/src/constants/chains/master.ts on lines 96..116
packages/synapse-constants/src/constants/chains/master.ts on lines 118..138
packages/synapse-constants/src/constants/chains/master.ts on lines 162..182
packages/synapse-constants/src/constants/chains/master.ts on lines 184..204
packages/synapse-constants/src/constants/chains/master.ts on lines 206..226
packages/synapse-constants/src/constants/chains/master.ts on lines 228..248
packages/synapse-constants/src/constants/chains/master.ts on lines 250..270
packages/synapse-constants/src/constants/chains/master.ts on lines 272..292
packages/synapse-constants/src/constants/chains/master.ts on lines 294..314
packages/synapse-constants/src/constants/chains/master.ts on lines 316..336
packages/synapse-constants/src/constants/chains/master.ts on lines 338..358
packages/synapse-constants/src/constants/chains/master.ts on lines 360..380
packages/synapse-constants/src/constants/chains/master.ts on lines 382..402

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

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

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

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

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

Refactorings

Further Reading

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

  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'tokenAmount',
Severity: Major
Found in packages/synapse-interface/constants/abis/swapEthWrapper.ts and 3 other locations - About 3 hrs to fix
packages/synapse-interface/constants/abis/avSwapWrapper.ts on lines 243..276
packages/synapse-interface/constants/abis/swap.ts on lines 797..830
packages/synapse-interface/constants/abis/synapseRouter.ts on lines 402..435

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

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

export const LINEA: Chain = {
  priorityRank: 90,
  id: 59144,
  chainSymbol: 'LINEA',
  name: 'Linea',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 5 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 3..27
packages/synapse-constants/src/constants/chains/master.ts on lines 404..428
packages/synapse-constants/src/constants/chains/master.ts on lines 430..454
packages/synapse-constants/src/constants/chains/master.ts on lines 456..480
packages/synapse-constants/src/constants/chains/master.ts on lines 508..532

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

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

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

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

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

Refactorings

Further Reading

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

export const BOBA: Chain = {
  priorityRank: 10,
  id: 288,
  chainSymbol: 'BOBA',
  name: 'Boba Chain',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 15 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 29..49
packages/synapse-constants/src/constants/chains/master.ts on lines 74..94
packages/synapse-constants/src/constants/chains/master.ts on lines 96..116
packages/synapse-constants/src/constants/chains/master.ts on lines 118..138
packages/synapse-constants/src/constants/chains/master.ts on lines 140..160
packages/synapse-constants/src/constants/chains/master.ts on lines 162..182
packages/synapse-constants/src/constants/chains/master.ts on lines 184..204
packages/synapse-constants/src/constants/chains/master.ts on lines 206..226
packages/synapse-constants/src/constants/chains/master.ts on lines 228..248
packages/synapse-constants/src/constants/chains/master.ts on lines 272..292
packages/synapse-constants/src/constants/chains/master.ts on lines 294..314
packages/synapse-constants/src/constants/chains/master.ts on lines 316..336
packages/synapse-constants/src/constants/chains/master.ts on lines 338..358
packages/synapse-constants/src/constants/chains/master.ts on lines 360..380
packages/synapse-constants/src/constants/chains/master.ts on lines 382..402

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

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

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

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

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

Refactorings

Further Reading

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

export const CRONOS: Chain = {
  priorityRank: 10,
  id: 25,
  chainSymbol: 'CRONOS',
  name: 'Cronos',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 15 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 29..49
packages/synapse-constants/src/constants/chains/master.ts on lines 74..94
packages/synapse-constants/src/constants/chains/master.ts on lines 96..116
packages/synapse-constants/src/constants/chains/master.ts on lines 118..138
packages/synapse-constants/src/constants/chains/master.ts on lines 140..160
packages/synapse-constants/src/constants/chains/master.ts on lines 162..182
packages/synapse-constants/src/constants/chains/master.ts on lines 184..204
packages/synapse-constants/src/constants/chains/master.ts on lines 206..226
packages/synapse-constants/src/constants/chains/master.ts on lines 250..270
packages/synapse-constants/src/constants/chains/master.ts on lines 272..292
packages/synapse-constants/src/constants/chains/master.ts on lines 294..314
packages/synapse-constants/src/constants/chains/master.ts on lines 316..336
packages/synapse-constants/src/constants/chains/master.ts on lines 338..358
packages/synapse-constants/src/constants/chains/master.ts on lines 360..380
packages/synapse-constants/src/constants/chains/master.ts on lines 382..402

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

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

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

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

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

Refactorings

Further Reading

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

export const AURORA: Chain = {
  priorityRank: 10,
  id: 1313161554,
  chainSymbol: 'AURORA',
  name: 'Aurora',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 15 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 29..49
packages/synapse-constants/src/constants/chains/master.ts on lines 74..94
packages/synapse-constants/src/constants/chains/master.ts on lines 96..116
packages/synapse-constants/src/constants/chains/master.ts on lines 118..138
packages/synapse-constants/src/constants/chains/master.ts on lines 140..160
packages/synapse-constants/src/constants/chains/master.ts on lines 162..182
packages/synapse-constants/src/constants/chains/master.ts on lines 184..204
packages/synapse-constants/src/constants/chains/master.ts on lines 206..226
packages/synapse-constants/src/constants/chains/master.ts on lines 228..248
packages/synapse-constants/src/constants/chains/master.ts on lines 250..270
packages/synapse-constants/src/constants/chains/master.ts on lines 272..292
packages/synapse-constants/src/constants/chains/master.ts on lines 316..336
packages/synapse-constants/src/constants/chains/master.ts on lines 338..358
packages/synapse-constants/src/constants/chains/master.ts on lines 360..380
packages/synapse-constants/src/constants/chains/master.ts on lines 382..402

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

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

export const ETH: Chain = {
  priorityRank: 100,
  id: 1,
  chainSymbol: 'ETH',
  name: 'Ethereum',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 5 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 404..428
packages/synapse-constants/src/constants/chains/master.ts on lines 430..454
packages/synapse-constants/src/constants/chains/master.ts on lines 456..480
packages/synapse-constants/src/constants/chains/master.ts on lines 482..506
packages/synapse-constants/src/constants/chains/master.ts on lines 508..532

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

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

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

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

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

Refactorings

Further Reading

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

  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'tokenAmount',
Severity: Major
Found in packages/synapse-interface/constants/abis/avSwapWrapper.ts and 3 other locations - About 3 hrs to fix
packages/synapse-interface/constants/abis/swap.ts on lines 797..830
packages/synapse-interface/constants/abis/swapEthWrapper.ts on lines 261..294
packages/synapse-interface/constants/abis/synapseRouter.ts on lines 402..435

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

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

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

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

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

Refactorings

Further Reading

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

export const CANTO: Chain = {
  priorityRank: 70,
  id: 7700,
  chainSymbol: 'CANTO',
  name: 'Canto',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 15 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 29..49
packages/synapse-constants/src/constants/chains/master.ts on lines 74..94
packages/synapse-constants/src/constants/chains/master.ts on lines 118..138
packages/synapse-constants/src/constants/chains/master.ts on lines 140..160
packages/synapse-constants/src/constants/chains/master.ts on lines 162..182
packages/synapse-constants/src/constants/chains/master.ts on lines 184..204
packages/synapse-constants/src/constants/chains/master.ts on lines 206..226
packages/synapse-constants/src/constants/chains/master.ts on lines 228..248
packages/synapse-constants/src/constants/chains/master.ts on lines 250..270
packages/synapse-constants/src/constants/chains/master.ts on lines 272..292
packages/synapse-constants/src/constants/chains/master.ts on lines 294..314
packages/synapse-constants/src/constants/chains/master.ts on lines 316..336
packages/synapse-constants/src/constants/chains/master.ts on lines 338..358
packages/synapse-constants/src/constants/chains/master.ts on lines 360..380
packages/synapse-constants/src/constants/chains/master.ts on lines 382..402

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

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

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

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

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

Refactorings

Further Reading

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

export const DFK: Chain = {
  priorityRank: 75,
  id: 53935,
  chainSymbol: 'DFK',
  name: 'DFK Chain',
Severity: Major
Found in packages/synapse-constants/src/constants/chains/master.ts and 15 other locations - About 3 hrs to fix
packages/synapse-constants/src/constants/chains/master.ts on lines 29..49
packages/synapse-constants/src/constants/chains/master.ts on lines 74..94
packages/synapse-constants/src/constants/chains/master.ts on lines 96..116
packages/synapse-constants/src/constants/chains/master.ts on lines 118..138
packages/synapse-constants/src/constants/chains/master.ts on lines 140..160
packages/synapse-constants/src/constants/chains/master.ts on lines 184..204
packages/synapse-constants/src/constants/chains/master.ts on lines 206..226
packages/synapse-constants/src/constants/chains/master.ts on lines 228..248
packages/synapse-constants/src/constants/chains/master.ts on lines 250..270
packages/synapse-constants/src/constants/chains/master.ts on lines 272..292
packages/synapse-constants/src/constants/chains/master.ts on lines 294..314
packages/synapse-constants/src/constants/chains/master.ts on lines 316..336
packages/synapse-constants/src/constants/chains/master.ts on lines 338..358
packages/synapse-constants/src/constants/chains/master.ts on lines 360..380
packages/synapse-constants/src/constants/chains/master.ts on lines 382..402

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

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

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

export const validateAddresses = (addresses: {
  [x: number]: string
}): { [x: number]: string } => {
  const reformatted: { [x: number]: string } = {}
  for (const chainId in addresses) {
Severity: Major
Found in packages/synapse-constants/src/utils/validateAddresses.ts and 1 other location - About 3 hrs to fix
packages/synapse-interface/utils/types/index.tsx on lines 355..365

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

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

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

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

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

Refactorings

Further Reading

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

  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'tokenAmount',
Severity: Major
Found in packages/synapse-interface/constants/abis/swap.ts and 3 other locations - About 3 hrs to fix
packages/synapse-interface/constants/abis/avSwapWrapper.ts on lines 243..276
packages/synapse-interface/constants/abis/swapEthWrapper.ts on lines 261..294
packages/synapse-interface/constants/abis/synapseRouter.ts on lines 402..435

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

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

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

const validateAddresses = (addresses: {
  [x: number]: string
}): { [x: number]: string } => {
  const reformatted: { [x: number]: string } = {}
  for (const chainId in addresses) {
Severity: Major
Found in packages/synapse-interface/utils/types/index.tsx and 1 other location - About 3 hrs to fix
packages/synapse-constants/src/utils/validateAddresses.ts on lines 3..13

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

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

      segmentAnalyticsEvent(`[Bridge] bridges successfully`, {
        id: bridgeQuote.id,
        originChainId: fromChainId,
        destinationChainId:
          toChainId === HYPERLIQUID.id ? ARBITRUM.id : toChainId,
packages/synapse-interface/pages/state-managed-bridge/index.tsx on lines 292..305

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

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

  swapableOn: [
    CHAINS.BNB.id,
    CHAINS.POLYGON.id,
    CHAINS.FANTOM.id,
    CHAINS.ARBITRUM.id,
packages/synapse-constants/src/constants/tokens/bridgeable.ts on lines 401..414

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

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

      {
        id: bridgeQuote.id,
        originChainId: fromChainId,
        destinationChainId:
          toChainId === HYPERLIQUID.id ? ARBITRUM.id : toChainId,
packages/synapse-interface/pages/state-managed-bridge/index.tsx on lines 375..388

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

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

  swapableOn: [
    CHAINS.BNB.id,
    CHAINS.ETH.id,
    CHAINS.POLYGON.id,
    CHAINS.ARBITRUM.id,
packages/synapse-constants/src/constants/tokens/bridgeable.ts on lines 667..680

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

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

Method Bot.rfqRefund has 123 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (b *Bot) rfqRefund() *slacker.CommandDefinition {
    return &slacker.CommandDefinition{
        Command:     "refund <tx>",
        Description: "refund a quote request",
        Examples:    []string{"refund 0x1234"},
Severity: Major
Found in contrib/opbot/botmd/commands.go - About 3 hrs to fix
    Severity
    Category
    Status
    Source
    Language