Showing 86 of 86 total issues

Function CreateProposalPage has 406 lines of code (exceeds 100 allowed). Consider refactoring.
Open

export default function CreateProposalPage() {
const { connection } = useNetwork();
const [activeStep, setActiveStep] = useState(1);
const [title, setTitle] = useState<string>("");
const [proposalType, setProposalType] = useState(
Severity: Major
Found in src/pages/governance/create/index.page.tsx - About 1 day to fix

    File ConfirmVoteDialog.tsx has 626 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, {
    useState,
    Dispatch,
    SetStateAction,
    useRef,
    Severity: Major
    Found in src/pages/governance/_components/ConfirmVoteDialog.tsx - About 1 day to fix

      File VotingResult.tsx has 580 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { Dispatch, SetStateAction } from "react";
      import BigNumber from "bignumber.js";
      import classNames from "classnames";
      import { NumericFormat } from "react-number-format";
      import { VoteDecision } from "@defichain/jellyfish-api-core/dist/category/governance";
      Severity: Major
      Found in src/pages/governance/_components/VotingResult.tsx - About 1 day to fix

        File Header.tsx has 563 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Link } from "@components/commons/link/Link";
        import { IoChevronDown } from "react-icons/io5";
        import { DeFiChainLogo } from "@components/icons/DeFiChainLogo";
        import classNames from "classnames";
        import { useRouter } from "next/router";
        Severity: Major
        Found in src/layouts/components/Header.tsx - About 1 day to fix

          File index.ts has 501 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint @typescript-eslint/quotes: 0 */
           
          export interface PriceCopy {
          /**
          * @example 'TSLA-USD'
          Severity: Major
          Found in content/prices/index.ts - About 1 day to fix

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

            import React from "react";
            import { Container } from "@components/commons/Container";
            import { ApiPagedResponse } from "@defichain/whale-api-client";
            import {
            CursorPage,
            Severity: Minor
            Found in src/pages/governance/index.page.tsx - About 6 hrs to fix

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

              import React, { useEffect, useState } from "react";
              import { Container } from "@components/commons/Container";
              import { Head } from "@components/commons/Head";
              import {
              MdRemove,
              Severity: Minor
              Found in src/pages/governance/create/index.page.tsx - About 6 hrs to fix

                File [id].page.tsx has 419 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { AdaptiveList } from "@components/commons/AdaptiveList";
                import { Breadcrumb } from "@components/commons/Breadcrumb";
                import { getAssetIcon, getTokenIcon } from "@components/icons/assets/tokens";
                import { getWhaleApiClient, useWhaleApiClient } from "@contexts/WhaleContext";
                import { TokenData } from "@defichain/whale-api-client/dist/api/tokens";
                Severity: Minor
                Found in src/pages/tokens/[id].page.tsx - About 6 hrs to fix

                  Function CreateProposalPage has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function CreateProposalPage() {
                  const { connection } = useNetwork();
                  const [activeStep, setActiveStep] = useState(1);
                  const [title, setTitle] = useState<string>("");
                  const [proposalType, setProposalType] = useState(
                  Severity: Minor
                  Found in src/pages/governance/create/index.page.tsx - About 4 hrs to fix

                  File OracleGraph.tsx has 357 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { JSX } from "@babel/types";
                  import { useWhaleApiClient } from "@contexts/WhaleContext";
                  import { WhaleApiClient } from "@defichain/whale-api-client";
                  import {
                  PriceFeedInterval,
                  Severity: Minor
                  Found in src/pages/oracles/_components/OracleGraph.tsx - About 4 hrs to fix

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

                    import React, { Dispatch, SetStateAction, useEffect, useState } from "react";
                    import { Container } from "@components/commons/Container";
                    import { getWhaleApiClient } from "@contexts/WhaleContext";
                    import { GetServerSidePropsContext, InferGetServerSidePropsType } from "next";
                    import {
                    Severity: Minor
                    Found in src/pages/governance/[proposalId]/index.page.tsx - About 4 hrs to fix

                      File Footer.tsx has 321 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { Link } from "@components/commons/link/Link";
                      import { DeFiChainLogo } from "@components/icons/DeFiChainLogo";
                      import { PropsWithChildren } from "react";
                      import {
                      FaDiscord,
                      Severity: Minor
                      Found in src/layouts/components/Footer.tsx - About 3 hrs to fix

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

                        <div className="flex flex-row">
                        <div className="flex flex-col grow">
                        <span
                        className={classNames(
                        percYes > percNo
                        Severity: Major
                        Found in src/pages/governance/_components/VotingResult.tsx and 1 other location - About 3 hrs to fix
                        src/pages/governance/_components/VotingResult.tsx on lines 123..164

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

                        <div className="flex flex-row">
                        <div className="flex flex-col grow">
                        <span
                        className={classNames(
                        percYes > percNo
                        Severity: Major
                        Found in src/pages/governance/_components/VotingResult.tsx and 1 other location - About 3 hrs to fix
                        src/pages/governance/_components/VotingResult.tsx on lines 309..350

                        File ProposalTable.tsx has 297 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import React, { useState } from "react";
                        import { useRouter } from "next/router";
                        import { OverflowTable } from "@components/commons/OverflowTable";
                        import { AiFillGithub, AiFillRedditCircle } from "react-icons/ai";
                        import classNames from "classnames";
                        Severity: Minor
                        Found in src/pages/governance/_components/ProposalTable.tsx - About 3 hrs to fix

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

                          <div className="w-full lg:w-1/2">
                          {props.dftx.data.from.map((scriptBalances) => {
                          const scriptFromAddress =
                          fromScript(scriptBalances.script, network)?.address ?? "N/A";
                          return (
                          src/pages/transactions/_components/DfTx/DfTxAnyAccountToAccount.tsx on lines 48..71

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

                          <div className="w-full lg:w-1/2">
                          {props.dftx.data.to.map((scriptBalances) => {
                          const scriptToAddress =
                          fromScript(scriptBalances.script, network)?.address ?? "N/A";
                          return (
                          src/pages/transactions/_components/DfTx/DfTxAnyAccountToAccount.tsx on lines 23..47

                          File ProposalCard.tsx has 285 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import React, { useState } from "react";
                          import classNames from "classnames";
                          import { AiFillGithub, AiFillRedditCircle } from "react-icons/ai";
                          import {
                          MdOutlineKeyboardArrowUp,
                          Severity: Minor
                          Found in src/pages/governance/_components/ProposalCard.tsx - About 2 hrs to fix

                            Function Header has 140 lines of code (exceeds 100 allowed). Consider refactoring.
                            Open

                            export function Header(): JSX.Element {
                            const [menu, setMenu] = useState(false);
                            const [atTop, setAtTop] = useState(true);
                            const [isSearchIconClicked, setIsSearchIconClicked] = useState(false);
                            const [openProposalsLength, setOpenProposalsLength] = useState<
                            Severity: Major
                            Found in src/layouts/components/Header.tsx - About 2 hrs to fix

                              Function SearchBar has 135 lines of code (exceeds 100 allowed). Consider refactoring.
                              Open

                              export function SearchBar(props: SearchBarInterface): JSX.Element {
                              const api = useWhaleApiClient();
                              const { name: network, connection } = useNetwork();
                              const router = useRouter();
                               
                               
                              Severity: Major
                              Found in src/components/commons/searchbar/SearchBar.tsx - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language