livepeer/livepeerjs

View on GitHub
packages/explorer-2.0/hooks/index.tsx

Summary

Maintainability
C
7 hrs
Test Coverage

Function useWeb3Mutation has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function useWeb3Mutation(mutation, options) {
  const client: any = useApolloClient();
  const context = useWeb3React();
  const [mutate, { data, loading: dataLoading }] = useMutation(mutation, {
    ...options,
Severity: Major
Found in packages/explorer-2.0/hooks/index.tsx - About 3 hrs to fix

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

import { useState, useEffect, useRef } from "react";
import { useQuery, useMutation, useApolloClient, gql } from "@apollo/client";
import { useWeb3React } from "@web3-react/core";
import { Injected } from "../lib/connectors";
import { isMobile } from "react-device-detect";
Severity: Minor
Found in packages/explorer-2.0/hooks/index.tsx - About 2 hrs to fix

Function useInactiveListener has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function useInactiveListener(suppress = false) {
  const { active, error, activate } = useWeb3React();

  useEffect(() => {
    const ethereum = window["ethereum"];
Severity: Minor
Found in packages/explorer-2.0/hooks/index.tsx - About 1 hr to fix

There are no issues that match your filters.

Category
Status