mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/SendConfirmationScreen.tsx
File SendConfirmationScreen.tsx
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { WalletAlert } from "@components/WalletAlert";
import { Dispatch, useEffect, useState } from "react";
import { TouchableOpacity } from "react-native";
import { useSelector } from "react-redux";
import BigNumber from "bignumber.js";
Function send
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
async function send(
{ address, token, amount, domain, networkName, nonce, chainId }: SendForm,
dispatch: Dispatch<any>,
onBroadcast: () => void,
logger: NativeLoggingProps,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function SendConfirmationScreen
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
export function SendConfirmationScreen({ route }: Props): JSX.Element {
const { domain } = useDomainContext();
const { address, evmAddress } = useWalletContext();
const addressLabel = useAddressLabel(address);
const network = useNetworkContext();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function dvmToDvmSendSigner
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
account: WhaleWalletAccount,
token: WalletToken,
amount: BigNumber,
address: string,
networkName: NetworkName,