synapsecns/sanguine

View on GitHub
packages/explorer-ui/components/layouts/MainLayout/index.tsx

Summary

Maintainability
F
3 days
Test Coverage

File index.tsx has 374 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Fragment } from 'react'
import { Popover, Transition } from '@headlessui/react'
import { DocumentTextIcon, MenuIcon, XIcon } from '@heroicons/react/outline'
// import { useActiveWeb3React } from '@hooks/wallet/useActiveWeb3React'
import {
Severity: Minor
Found in packages/explorer-ui/components/layouts/MainLayout/index.tsx - About 5 hrs to fix

    Function LandingNav has 99 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const LandingNav = () => {
      const topBarBtns = <TopBarButtons />
      const mobileBarBtns = <MobileBarButtons />
      const moreInfoBtns = <MoreInfoButtons />
      const socialBtns = <SocialButtons />
    Severity: Major
    Found in packages/explorer-ui/components/layouts/MainLayout/index.tsx - About 3 hrs to fix

      Function SocialButtons has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const SocialButtons = () => {
        return (
          <Grid cols={{ xs: 2, sm: 1 }} gapY={1}>
            <MiniInfoItem
              href={DOCS_URL}
      Severity: Major
      Found in packages/explorer-ui/components/layouts/MainLayout/index.tsx - About 2 hrs to fix

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

        const MoreInfoItem: React.FC<MoreInfoItemProps> = ({
          to,
          labelText,
          description,
          className,
        Severity: Major
        Found in packages/explorer-ui/components/layouts/MainLayout/index.tsx and 1 other location - About 3 hrs to fix
        packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx on lines 297..321

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

        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

        const MiniInfoItem = ({ href, icon, labelText }) => {
          return (
            <a
              key={labelText}
              href={href}
        Severity: Major
        Found in packages/explorer-ui/components/layouts/MainLayout/index.tsx and 1 other location - About 3 hrs to fix
        packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx on lines 323..347

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

        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

                        <div className="-mr-2">
                          <Popover.Button
                            className={`
                                rounded-lg p-2 inline-flex items-center justify-center
                                text-gray-400 hover:text-gray-500 hover:bg-gray-100
        Severity: Major
        Found in packages/explorer-ui/components/layouts/MainLayout/index.tsx and 1 other location - About 2 hrs to fix
        packages/explorer-ui/components/layouts/MainLayout/index.tsx on lines 60..72

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

        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

                  <div className="items-center justify-center -mr-2 sm:flex lg:hidden">
                    <Popover.Button
                      className={`
                          rounded-lg p-2 inline-flex items-center justify-center
                          text-gray-400 hover:text-gray-500 hover:bg-gray-100
        Severity: Major
        Found in packages/explorer-ui/components/layouts/MainLayout/index.tsx and 1 other location - About 2 hrs to fix
        packages/explorer-ui/components/layouts/MainLayout/index.tsx on lines 123..135

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

        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

            <Transition
              as={Fragment}
              enter="transition ease-out duration-200"
              enterFrom="opacity-0 translate-y-1"
              enterTo="opacity-100 translate-y-0"
        Severity: Major
        Found in packages/explorer-ui/components/layouts/MainLayout/index.tsx and 1 other location - About 2 hrs to fix
        packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx on lines 163..185

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

        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