synapsecns/sanguine

View on GitHub
packages/synapse-interface/pages/pools/index.tsx

Summary

Maintainability
C
1 day
Test Coverage

Function PoolsPage has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const PoolsPage = () => {
  const { address: currentAddress } = useAccount()
  const { chain } = useAccount()
  const [connectedChainId, setConnectedChainId] = useState(0)
  const [address, setAddress] = useState(undefined)
Severity: Major
Found in packages/synapse-interface/pages/pools/index.tsx - About 2 hrs to fix

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

    export async function getStaticProps({ locale }) {
      const userMessages = (await import(`../../messages/${locale}.json`)).default
      const defaultMessages = (await import(`../../messages/en-US.json`)).default
      const messages = deepmerge(defaultMessages, userMessages)
    
    
    Severity: Major
    Found in packages/synapse-interface/pages/pools/index.tsx and 5 other locations - About 2 hrs to fix
    packages/synapse-interface/pages/index.tsx on lines 15..25
    packages/synapse-interface/pages/landing/index.tsx on lines 19..29
    packages/synapse-interface/pages/returntomonke/index.tsx on lines 13..23
    packages/synapse-interface/pages/stake/index.tsx on lines 19..29
    packages/synapse-interface/pages/swap/index.tsx on lines 49..59

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

    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

            <Grid cols={{ xs: 1, sm: 1, md: 2 }} gap={4} className="mb-5">
              <PoolCards address={address} pools={migratedPools} />
            </Grid>
    Severity: Major
    Found in packages/synapse-interface/pages/pools/index.tsx and 1 other location - About 1 hr to fix
    packages/synapse-interface/pages/pools/index.tsx on lines 102..104

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

    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

            <Grid cols={{ xs: 1, sm: 1, md: 2 }} gap={4} className="mb-5">
              <PoolCards address={address} pools={unIncentivizedPools} />
            </Grid>
    Severity: Major
    Found in packages/synapse-interface/pages/pools/index.tsx and 1 other location - About 1 hr to fix
    packages/synapse-interface/pages/pools/index.tsx on lines 111..113

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

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

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

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

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

    Refactorings

    Further Reading

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

            <div className="flex-wrap justify-between mb-4 md:flex">
              <PageHeader
                title={t('Incentivized Pools')}
                subtitle={t('Contributors are rewarded')}
              />
    Severity: Major
    Found in packages/synapse-interface/pages/pools/index.tsx and 3 other locations - About 35 mins to fix
    packages/synapse-interface/pages/pools/index.tsx on lines 96..101
    packages/synapse-interface/pages/pools/index.tsx on lines 105..110
    packages/synapse-interface/pages/swap/index.tsx on lines 399..404

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

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

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

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

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

    Refactorings

    Further Reading

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

            <div className="flex-wrap justify-between mt-8 mb-4 md:flex">
              <PageHeader
                title={t('Migrated Pools')}
                subtitle={t('Pools migrated to new reward contracts')}
              />
    Severity: Major
    Found in packages/synapse-interface/pages/pools/index.tsx and 3 other locations - About 35 mins to fix
    packages/synapse-interface/pages/pools/index.tsx on lines 86..91
    packages/synapse-interface/pages/pools/index.tsx on lines 96..101
    packages/synapse-interface/pages/swap/index.tsx on lines 399..404

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

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

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

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

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

    Refactorings

    Further Reading

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

            <div className="flex-wrap justify-between mt-8 mb-4 md:flex">
              <PageHeader
                title={t('Unincentivized Pools')}
                subtitle={t('Pools without contributor rewards')}
              />
    Severity: Major
    Found in packages/synapse-interface/pages/pools/index.tsx and 3 other locations - About 35 mins to fix
    packages/synapse-interface/pages/pools/index.tsx on lines 86..91
    packages/synapse-interface/pages/pools/index.tsx on lines 105..110
    packages/synapse-interface/pages/swap/index.tsx on lines 399..404

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

    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