synapsecns/sanguine

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

Summary

Maintainability
F
1 wk
Test Coverage

File networks.ts has 451 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { CHAINS } from '@synapsecns/synapse-constants'

const ChainId = CHAINS.ChainId

const ETH_CURRENCY_TEXT_CLASSNAME = 'text-[#5170ad] dark:text-[#78a5ff]'
Severity: Minor
Found in packages/explorer-ui/utils/styles/networks.ts - About 6 hrs to fix

    Function getNetworkCurrencyColor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const getNetworkCurrencyColor = (chainId) => {
      switch (parseInt(chainId)) {
        case ChainId.BSC:
          return 'text-[#ecae0b] dark:text-[#ecae0b]'
        case ChainId.ETH:
    Severity: Minor
    Found in packages/explorer-ui/utils/styles/networks.ts - About 1 hr to fix

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

      export const getNetworkTextColor = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'text-[#ecae0b] dark:text-[#ecae0b]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkButtonBgClassNameActive = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'dark:active:!bg-[#3c3c44] '
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkButtonBorderHover = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'hover:!border-[#ecae0b]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkHoverShadow = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'hover:!shadow-yellow-500'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446

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

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

      export const getNetworkButtonBorderActive = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'focus:!border-[#ecae0b] active:!border-[#ecae0b]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkTextHoverColor = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'hover:text-[#ecae0b]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkLinkTextColor = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return '!text-gray-800 hover:!text-[#ecae0b] dark:!text-[#ecae0b] dark:hover:!text-[#ecae0b]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkButtonBgClassName = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'bg-stone-800 hover:bg-stone-900 active:bg-[#3c3c44]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkButtonBorderImportant = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return '!border-[#ecae0b] dark:!border-[#ecae0b]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkBgClassNameLightDark = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'bg-[#ecae0b] '
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkTextColorContrast = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'text-[#ecae0b]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkShadow = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return ' !shadow-yellow-600 hover:shadow-yellow-500'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkButtonBorder = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'border-[#ecae0b] dark:border-[#ecae0b]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkTextColorContrastHover = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'group-hover:text-[#ecae0b]'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 367..392
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

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

      export const getNetworkBgClassName = (chainId) => {
        switch (NETWORK_COLORS[chainId]) {
          case 'yellow':
            return 'bg-stone-800'
          case 'eth':
      Severity: Major
      Found in packages/explorer-ui/utils/styles/networks.ts and 14 other locations - About 3 hrs to fix
      packages/explorer-ui/utils/styles/networks.ts on lines 70..95
      packages/explorer-ui/utils/styles/networks.ts on lines 97..122
      packages/explorer-ui/utils/styles/networks.ts on lines 124..149
      packages/explorer-ui/utils/styles/networks.ts on lines 151..176
      packages/explorer-ui/utils/styles/networks.ts on lines 178..203
      packages/explorer-ui/utils/styles/networks.ts on lines 205..230
      packages/explorer-ui/utils/styles/networks.ts on lines 232..257
      packages/explorer-ui/utils/styles/networks.ts on lines 259..284
      packages/explorer-ui/utils/styles/networks.ts on lines 286..311
      packages/explorer-ui/utils/styles/networks.ts on lines 313..338
      packages/explorer-ui/utils/styles/networks.ts on lines 340..365
      packages/explorer-ui/utils/styles/networks.ts on lines 394..419
      packages/explorer-ui/utils/styles/networks.ts on lines 421..446
      packages/explorer-ui/utils/styles/networks.ts on lines 448..473

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

      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