Showing 70 of 86 total issues

Function SwapCard has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function SwapCard({ swap }: { swap: PoolSwapData }): JSX.Element {
const age = useAge(swap.block.medianTime);
const FromIcon =
swap.from === undefined ? getAssetIcon("") : getAssetIcon(swap.from.symbol);
const ToIcon =
Severity: Minor
Found in src/pages/dex/[poolpairId]/_components/SwapCards.tsx - About 55 mins to fix

Function getActivePrice has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function getActivePrice(
symbol: string,
activePrice?: ActivePrice,
priceFactor: string = "1",
priceType: ActivePriceType = "ACTIVE",
Severity: Minor
Found in src/pages/vaults/utils/ActivePrice.ts - About 55 mins to fix

Function ProposalDetail has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function ProposalDetail({
proposal,
proposalCreationDate,
proposalEndDate,
}: {
Severity: Minor
Found in src/pages/governance/_components/ProposalDetail.tsx - About 55 mins to fix

Function PoolPairsCard has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function PoolPairsCard({
poolPair,
tokenPrice,
}: {
poolPair: PoolPairData;
Severity: Minor
Found in src/pages/dex/_components/PoolPairsCards.tsx - About 55 mins to fix

Function ProposalDetailPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function ProposalDetailPage({
proposal,
proposalVotes,
proposalCreationDate,
currentBlockHeight,
Severity: Minor
Found in src/pages/governance/[proposalId]/index.page.tsx - About 45 mins to fix

Function PoolPairRow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function PoolPairRow({
poolPair,
tokenPrice,
}: {
poolPair: PoolPairData;
Severity: Minor
Found in src/pages/dex/_components/PoolPairsTable.tsx - About 45 mins to fix

Function getServerSideProps has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export async function getServerSideProps(
context: GetServerSidePropsContext
): Promise<GetServerSidePropsResult<BlockDetailsPageProps>> {
const network =
context.query.network?.toString() ?? getEnvironment().networks[0];
Severity: Minor
Found in src/pages/blocks/countdown/[query]/index.page.tsx - About 45 mins to fix

Function fetchTimeFramePriceFeedInterval has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

api: WhaleApiClient,
token: string,
currency: string,
timeRange: number,
interval: number
Severity: Minor
Found in src/pages/oracles/_components/OracleGraph.tsx - About 35 mins to fix

    Function getActivePrice has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    symbol: string,
    activePrice?: ActivePrice,
    priceFactor: string = "1",
    priceType: ActivePriceType = "ACTIVE",
    tokenType: TokenType = "LOAN"
    Severity: Minor
    Found in src/pages/vaults/utils/ActivePrice.ts - About 35 mins to fix

      Function TransactionPage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function TransactionPage(
      props: InferGetServerSidePropsType<typeof getServerSideProps>,
      ): JSX.Element {
      const router = useRouter();
      const network = useNetwork().connection;
      Severity: Minor
      Found in src/pages/transactions/[txid].page.tsx - About 35 mins to fix

      Function OracleFeed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function OracleFeed(props: {
      oracle: PriceOracle;
      price: PriceTicker;
      }): JSX.Element {
      const {
      Severity: Minor
      Found in src/pages/oracles/_components/OracleTable.tsx - About 35 mins to fix

      Function HeaderCountBar has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export function HeaderCountBar(props: { className: string }): JSX.Element {
      const { count, tvl } = useSelector((state: RootState) => state.stats);
       
      function HeaderCount(props: {
      text: string;
      Severity: Minor
      Found in src/layouts/components/HeaderCountBar.tsx - About 35 mins to fix

      Function getServerSideProps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export async function getServerSideProps(
      context: GetServerSidePropsContext
      ): Promise<GetServerSidePropsResult<PoolPairPageProps>> {
      const poolpairId = context.params?.poolpairId?.toString().trim() as string;
      if (!isAlphanumeric(poolpairId, "-.")) {
      Severity: Minor
      Found in src/pages/dex/[poolpairId]/index.page.tsx - About 35 mins to fix

      Function RawTransaction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export function RawTransaction({ rawTx }: { rawTx: string }): JSX.Element {
      let transaction: TransactionSegWit | Transaction | undefined;
       
      useEffect(() => {
      const interval = setInterval(() => {
      Severity: Minor
      Found in src/pages/transactions/_components/RawTransaction.tsx - About 35 mins to fix

      Function VaultCollateralizationRatio has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export function VaultCollateralizationRatio(
      props: VaultCollateralizationRatioProps
      ): JSX.Element {
      if (props.collateralizationRatio === undefined) {
      return <span>N/A</span>;
      Severity: Minor
      Found in src/pages/vaults/_components/commons/VaultCollateralizationRatio.tsx - About 35 mins to fix

      Avoid too many return statements within this function.
      Open

      return <MdMenuBook size={24} />;
      Severity: Major
      Found in src/components/commons/searchbar/SearchResult.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

        return (
        <AddressLinkExternal
        url={TOKEN_BACKED_ADDRESS.ETH.cake.link}
        text={TOKEN_BACKED_ADDRESS.ETH.cake.address}
        testId="BackingAddress.ETH"
        Severity: Major
        Found in src/pages/tokens/[id].page.tsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

          return (
          <AddressLinkExternal
          url={TOKEN_BACKED_ADDRESS.MATIC.cake.link}
          text={TOKEN_BACKED_ADDRESS.MATIC.cake.address}
          testId="BackingAddress.MATIC"
          Severity: Major
          Found in src/pages/tokens/[id].page.tsx - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            return (
            <AddressLinkExternal
            url={TOKEN_BACKED_ADDRESS.SUI.cake.link}
            text={TOKEN_BACKED_ADDRESS.SUI.cake.address}
            testId="BackingAddress.SUI"
            Severity: Major
            Found in src/pages/tokens/[id].page.tsx - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

              return {
              props: {
              price: price,
              oracles: oracles,
              },
              Severity: Major
              Found in src/pages/oracles/[symbol].page.tsx - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language