synapsecns/sanguine

View on GitHub
packages/widget/src/hooks/useBridgeSelectionData.ts

Summary

Maintainability
B
6 hrs
Test Coverage

Function useBridgeSelectionData has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useBridgeSelectionData = (): BridgeSelections => {
  const [originChain, setOriginChain] = useState('')
  const [originToken, setOriginToken] = useState('')
  const [destinationChain, setDestinationChain] = useState('')
  const [destinationToken, setDestinationToken] = useState('')
Severity: Major
Found in packages/widget/src/hooks/useBridgeSelectionData.ts - About 3 hrs to fix

    Consider simplifying this complex logical expression.
    Open

          if (
            originChainSelect &&
            destinationChainSelect &&
            originTokenSelect &&
            destinationTokenSelect
    Severity: Critical
    Found in packages/widget/src/hooks/useBridgeSelectionData.ts - About 1 hr to fix

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

          const checkElements = () => {
            originChainSelect = document.getElementById('origin-chain-select')
            destinationChainSelect = document.getElementById(
              'destination-chain-select'
            )
      Severity: Minor
      Found in packages/widget/src/hooks/useBridgeSelectionData.ts - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status