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 getToStyleForCoin = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `to-gray-300`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getSwapBorderHoverStyleForCoin = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `hover:border-gray-100 dark:hover:border-opacity-50 dark:hover:!border-gray-700`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getMenuItemBgForCoin = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `bg-gray-500 bg-opacity-20 dark:bg-opacity-20 dark:bg-gray-700`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getCoinTextColorDark = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `dark:text-gray-500 dark:group-hover:text-gray-400`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getMenuItemHoverBgForCoin = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `hover:bg-opacity-20 hover:bg-gray-500 dark:hover:bg-opacity-20 dark:hover:bg-gray-700`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getMenuItemStyleForCoin = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `hover:bg-opacity-20 hover:bg-gray-500 focus:bg-gray-500 active:bg-gray-500 active:bg-opacity-20 focus:bg-opacity-20`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getMenuItemStyleForCoinDark = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `dark:hover:bg-opacity-20 dark:focus:bg-opacity-20 dark:active:bg-opacity-20 dark:hover:bg-gray-500 dark:focus:bg-gray-500 dark:active:bg-gray-500`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getCoinTextColor = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `text-gray-500 group-hover:text-gray-400`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getFromStyleForCoin = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `from-gray-300`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getCoinTextColorAlt = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `dark:text-gray-500 dark:group-hover:text-gray-400`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 286..313
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 getCardStyleByPool = (tokenColor: string): string => {
  switch (tokenColor) {
    case ColorOptions.GRAY:
      return `shadow-gray-lg hover:shadow-gray-2xl`
    case ColorOptions.YELLOW:
Severity: Major
Found in packages/synapse-interface/styles/tokens.ts and 15 other locations - About 1 day to fix
packages/synapse-interface/styles/tokens.ts on lines 44..71
packages/synapse-interface/styles/tokens.ts on lines 73..100
packages/synapse-interface/styles/tokens.ts on lines 108..135
packages/synapse-interface/styles/tokens.ts on lines 137..164
packages/synapse-interface/styles/tokens.ts on lines 166..193
packages/synapse-interface/styles/tokens.ts on lines 195..222
packages/synapse-interface/styles/tokens.ts on lines 224..251
packages/synapse-interface/styles/tokens.ts on lines 253..280
packages/synapse-interface/styles/tokens.ts on lines 315..342
packages/synapse-interface/styles/tokens.ts on lines 344..371
packages/synapse-interface/styles/tokens.ts on lines 373..400
packages/synapse-interface/styles/tokens.ts on lines 402..429
packages/synapse-interface/styles/tokens.ts on lines 431..458
packages/synapse-interface/styles/tokens.ts on lines 460..487
packages/synapse-interface/styles/tokens.ts on lines 489..516

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

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 chain.go has 779 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Code generated by mockery v2.14.0. DO NOT EDIT.

package mocks

import (
Severity: Major
Found in ethergo/chain/mocks/chain.go - About 1 day to fix

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

          it('Does not filter zero amount queries', async () => {
            const destRequests: DestRequest[] = [
              {
                symbol: 'CCTP.USDC',
                amountIn: BigNumber.from(10).pow(9),
    Severity: Major
    Found in packages/sdk-router/src/router/synapseCCTPRouter.test.ts and 1 other location - About 1 day to fix
    packages/sdk-router/src/router/synapseRouter.test.ts on lines 151..170

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

    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('Does not filter zero amount queries', async () => {
            const destRequests: DestRequest[] = [
              {
                symbol: 'USDC',
                amountIn: BigNumber.from(10).pow(9),
    Severity: Major
    Found in packages/sdk-router/src/router/synapseRouter.test.ts and 1 other location - About 1 day to fix
    packages/sdk-router/src/router/synapseCCTPRouter.test.ts on lines 147..166

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

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

    func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
        fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
        ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
            Object: "Query",
        })
    Severity: Minor
    Found in services/explorer/graphql/server/graph/resolver/server.go - About 1 day 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

    File tokens.ts has 523 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const ColorOptions = {
      GRAY: 'gray',
      YELLOW: 'yellow',
      GREEN: 'green',
      LIME: 'lime',
    Severity: Major
    Found in packages/synapse-interface/styles/tokens.ts - About 1 day to fix

      Method SwapParser.Parse has 238 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (p *SwapParser) Parse(ctx context.Context, log ethTypes.Log, chainID uint32) (interface{}, error) {
          logTopic := log.Topics[0]
      
          iFace, err := func(log ethTypes.Log) (swapTypes.EventLog, error) {
              // nolint:nestif
      Severity: Major
      Found in services/explorer/consumer/parser/swapparser.go - About 1 day to fix

        File getFromTokens.test.ts has 521 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { expect } from '@jest/globals'
        
        import { getFromTokens } from '@/utils/routeMaker/getFromTokens'
        import { mockRoutes } from './__fixtures__/mockRoutes'
        
        
        Severity: Major
        Found in packages/synapse-interface/__tests__/getFromTokens.test.ts - About 1 day to fix

          ILightManager has 59 methods (exceeds 20 allowed). Consider refactoring.
          Open

          type ILightManager struct {
              mock.Mock
          }
          Severity: Major
          Found in agents/contracts/lightmanager/mocks/i_light_manager.go - About 1 day to fix

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

            package indexer_test
            
            import (
                "testing"
                "time"
            Severity: Major
            Found in services/scribe/service/indexer/suite_test.go and 1 other location - About 1 day to fix
            services/scribe/backend/suite_test.go on lines 1..74

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

            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