Showing 70 of 86 total issues

Function ProposalCard has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function ProposalCard({
proposal,
votes,
currentBlockHeight,
currentBlockMedianTime,
Severity: Minor
Found in src/pages/governance/_components/ProposalCard.tsx - About 1 hr to fix

Function findPath has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export function findPath(
graph: GraphProps[],
origin: string,
target: string
): { visitedNodes: Set<string>; path: string[] } {
Severity: Minor
Found in src/pages/vaults/utils/path-finding.tsx - About 1 hr to fix

Function getDuration has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export function getDuration(seconds: number): string {
const { y, m, d, h, min, s } = secondsToTime(seconds);
const yDisplay = y > 0 ? `${y}y` : "";
const mDisplay =
m > 0 ? ` ${y > 0 ? padStart(m.toString(), 2, "0") : m}m` : "";
Severity: Minor
Found in src/pages/governance/shared/durationHelper.ts - About 1 hr to fix

Function AddressSummaryTable has 118 lines of code (exceeds 100 allowed). Consider refactoring.
Open

export function AddressSummaryTable(
props: AddressSummaryTableProps
): JSX.Element {
const api = useWhaleApiClient();
const { connection } = useNetwork();
Severity: Major
Found in src/pages/address/_components/AddressSummaryTable.tsx - About 1 hr to fix

    Function SupplyStats has 117 lines of code (exceeds 100 allowed). Consider refactoring.
    Open

    export function SupplyStats(): JSX.Element {
    const apiClient = useWhaleApiClient();
     
    const [data, setData] = useState<SupplyStatsStateI>({
    stats: null,
    Severity: Major
    Found in src/components/index/SupplyStats.tsx - About 1 hr to fix

      Function PricesPage has 115 lines of code (exceeds 100 allowed). Consider refactoring.
      Open

      export default function PricesPage(
      props: InferGetServerSidePropsType<typeof getServerSideProps>
      ): JSX.Element {
      const types = ["All", "Crypto", "Stocks", "Forex", "Commodity", "ETF"];
       
       
      Severity: Major
      Found in src/pages/oracles/index.page.tsx - About 1 hr to fix

        Function getSearchResults has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        async function getSearchResults(
        api: WhaleApiClient,
        network: NetworkName,
        query: string,
        ): Promise<SearchResult[]> {
        Severity: Minor
        Found in src/components/commons/searchbar/SearchBar.tsx - About 1 hr to fix

        Function getLocalStorageItem has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        export function getLocalStorageItem(
        key: string,
        connection?: EnvironmentNetwork
        ) {
        const localStorageItem = localStorage.getItem(key)!;
        Severity: Minor
        Found in src/pages/governance/shared/localStorageHelper.ts - About 1 hr to fix

        Function DesktopAuctionDetails has 107 lines of code (exceeds 100 allowed). Consider refactoring.
        Open

        export function DesktopAuctionDetails(
        props: DesktopAuctionDetailsProps
        ): JSX.Element {
        const LoanSymbol = getAssetIcon(props.liquidationBatch.loan.symbol);
         
         

          Function VaultStatus has 107 lines of code (exceeds 100 allowed). Consider refactoring.
          Open

          export function VaultStatus(props: VaultStatusProps): JSX.Element {
          let textClassName = "";
          let bgClassName = "";
          let text = "";
          let signalSymbol: JSX.Element = <></>;
          Severity: Major
          Found in src/pages/vaults/_components/commons/VaultStatus.tsx - About 1 hr to fix

            Function MobileAuctionDetails has 107 lines of code (exceeds 100 allowed). Consider refactoring.
            Open

            export function MobileAuctionDetails(
            props: MobileAuctionDetailsProps
            ): JSX.Element {
            const LoanSymbol = getAssetIcon(props.liquidationBatch.loan.symbol);
             
             

              Function VotingResult has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export function VotingResult({
              voteCounts,
              status,
              onSubmitVote,
              voteCommand,
              Severity: Minor
              Found in src/pages/governance/_components/VotingResult.tsx - About 1 hr to fix

              Function VaultStatus has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export function VaultStatus(props: VaultStatusProps): JSX.Element {
              let textClassName = "";
              let bgClassName = "";
              let text = "";
              let signalSymbol: JSX.Element = <></>;
              Severity: Minor
              Found in src/pages/vaults/_components/commons/VaultStatus.tsx - About 1 hr to fix

              Function VaultTableRow has 105 lines of code (exceeds 100 allowed). Consider refactoring.
              Open

              export function VaultTableRow(props: VaultTableRowProps): JSX.Element {
              return (
              <OverflowTable.Row
              className={classNames(
              "cursor-pointer",
              Severity: Major
              Found in src/pages/vaults/_components/commons/VaultTableRow.tsx - About 1 hr to fix

                Function HeaderCountBar has 104 lines of code (exceeds 100 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: Major
                Found in src/layouts/components/HeaderCountBar.tsx - About 1 hr to fix

                  Function getOCGData has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  allProposals: GovernanceProposal[],
                  queryProposals: GovernanceProposal[],
                  proposalsVotes: ProposalsVotes,
                  currentBlockCount: number,
                  currentBlockMedianTime: number,
                  Severity: Major
                  Found in src/pages/governance/index.page.tsx - About 1 hr to fix

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

                    export function AddressVinVout(props: AddressVinVoutProps): JSX.Element {
                    const api = useWhaleApiClient();
                    const [vins, setVins] = useState<TransactionVin[] | undefined>(undefined);
                    const [vouts, setVouts] = useState<TransactionVout[] | undefined>(undefined);
                     
                     
                    Severity: Minor
                    Found in src/pages/address/_components/AddressVinVout.tsx - About 55 mins to fix

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

                    export function useTokenPrice(denominationTokenSymbol = "USDT"): TokenPrice {
                    const blockCount = useSelector((state: RootState) => state.stats.count);
                    const prices = useSelector((state: RootState) =>
                    dexPricesSelectorByDenomination(state.dexPrices, denominationTokenSymbol)
                    );
                    Severity: Minor
                    Found in src/pages/vaults/hooks/TokenPrice.ts - About 55 mins to fix

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

                    export async function getServerSideProps(
                    context: GetServerSidePropsContext,
                    ): Promise<GetServerSidePropsResult<TransactionPageProps>> {
                    const api = getWhaleApiClient(context);
                    const txid = context.params?.txid?.toString().trim() as string;
                    Severity: Minor
                    Found in src/pages/transactions/[txid].page.tsx - About 55 mins to fix

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

                    function SwapRow({ 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/SwapTable.tsx - About 55 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language