synapsecns/sanguine

View on GitHub
packages/explorer-ui/utils/styles/coins.ts

Summary

Maintainability
F
1 wk
Test Coverage

File coins.ts has 520 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  BUSD,
  USDT,
  USDC,
  DAI,
Severity: Major
Found in packages/explorer-ui/utils/styles/coins.ts - About 1 day to fix

    Function getCoinTextColorDark has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const getCoinTextColorDark = (coin) => {
      switch (COIN_COLORS[coin.symbol]) {
        case 'yellow':
          return 'dark:text-yellow-500 dark:group-hover:text-yellow-400'
        case 'green':
    Severity: Minor
    Found in packages/explorer-ui/utils/styles/coins.ts - About 1 hr to fix

      Function getCoinTextColor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getCoinTextColor = (coin) => {
        switch (COIN_COLORS[coin.symbol]) {
          case 'yellow':
            return 'text-yellow-500 group-hover:text-yellow-400'
          case 'green':
      Severity: Minor
      Found in packages/explorer-ui/utils/styles/coins.ts - About 1 hr to fix

        Function getCoinTextColorAlt has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const getCoinTextColorAlt = (coin) => {
          switch (COIN_COLORS[coin.symbol]) {
            case 'yellow':
              return 'dark:text-yellow-500 dark:group-hover:text-yellow-400'
            case 'green':
        Severity: Minor
        Found in packages/explorer-ui/utils/styles/coins.ts - About 1 hr to fix

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

          export const getCoinTextColorAlt = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'dark:text-yellow-500 dark:group-hover:text-yellow-400'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 1 other location - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 285..312

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

          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 getCoinTextColorDark = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'dark:text-yellow-500 dark:group-hover:text-yellow-400'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 1 other location - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 314..341

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

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

          export const getToStyleForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'to-yellow-100'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getSwapHoverStyleForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'hover:shadow-yellow-xl border-yellow-100'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getMenuItemHoverBgForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'hover:bg-yellow-100 dark:hover:bg-opacity-20 dark:hover:bg-yellow-700'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getMenuItemBgForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'bg-yellow-50 dark:bg-opacity-20 dark:bg-yellow-700'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getBorderStyleForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'border-yellow-300'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getInputBorderFocusStyleForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'focus-within:border-yellow-200 dark:focus-within:border-yellow-500'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getButtonStyleForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'shadow-yellow-xl border-yellow-100 dark:border-opacity-50 dark:border-yellow-700'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getMenuItemStyleForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'hover:bg-yellow-50 focus:bg-yellow-50 active:bg-yellow-50'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getFromStyleForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'from-yellow-100'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getSwapBorderStyleForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'border-yellow-50 dark:border-opacity-20 dark:border-yellow-700 '
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520
          packages/explorer-ui/utils/styles/coins.ts on lines 524..549

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

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

          export const getSwapCardShadowStyleForCoin = (coin) => {
            switch (COIN_COLORS[coin.symbol]) {
              case 'yellow':
                return 'shadow-yellow-xl hover:shadow-yellow-2xl'
              case 'green':
          Severity: Major
          Found in packages/explorer-ui/utils/styles/coins.ts and 10 other locations - About 3 hrs to fix
          packages/explorer-ui/utils/styles/coins.ts on lines 75..100
          packages/explorer-ui/utils/styles/coins.ts on lines 104..129
          packages/explorer-ui/utils/styles/coins.ts on lines 168..193
          packages/explorer-ui/utils/styles/coins.ts on lines 198..223
          packages/explorer-ui/utils/styles/coins.ts on lines 227..252
          packages/explorer-ui/utils/styles/coins.ts on lines 350..375
          packages/explorer-ui/utils/styles/coins.ts on lines 379..404
          packages/explorer-ui/utils/styles/coins.ts on lines 437..462
          packages/explorer-ui/utils/styles/coins.ts on lines 466..491
          packages/explorer-ui/utils/styles/coins.ts on lines 495..520

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

          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

          There are no issues that match your filters.

          Category
          Status