Showing 286 of 335 total issues
File DexRemoveLiquidity.tsx
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { NavigationProp, useNavigation } from "@react-navigation/native";
import { StackScreenProps } from "@react-navigation/stack";
import BigNumber from "bignumber.js";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Platform, View } from "react-native";
Function useDexStabilization
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
export function useDexStabilization(
tokenA: DexStabilizationTokenA,
tokenB: DexStabilizationTokenB
): {
dexStabilizationAnnouncement: Announcement | undefined;
- 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 AddOrEditAddressBookScreen
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
export function AddOrEditAddressBookScreen({
route,
navigation,
}: Props): JSX.Element {
const { isEvmFeatureEnabled } = useDomainContext();
- 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 TokenBreakdownDetailsV2
has 240 lines of code (exceeds 100 allowed). Consider refactoring. Open
export function TokenBreakdownDetailsV2(
props: TokenBreakdownDetailProps,
): JSX.Element {
const { denominationCurrency } = useDenominationCurrency();
const lockedToken = (useTokenLockedBalance({
File BottomSheetAddressDetailV2.tsx
has 437 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { View } from "@components";
import {
ThemedIcon,
ThemedText,
ThemedTextV2,
Function AddressBookScreen
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
export function AddressBookScreen({ route, navigation }: Props): JSX.Element {
const { selectedAddress, onAddressSelect, disabledTab, addressDomainType } =
route.params;
const { isLight } = useThemeContext();
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
File CreateOrEditAddressLabelForm.tsx
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { memo, useCallback, useEffect, useState } from "react";
import * as Clipboard from "expo-clipboard";
import { StackScreenProps } from "@react-navigation/stack";
import { BottomSheetWithNavRouteParam } from "@components/BottomSheetWithNav";
import {
File ConvertConfirmationScreen.tsx
has 413 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { WalletAlert } from "@components/WalletAlert";
import { ThemedScrollViewV2, ThemedViewV2 } from "@components/themed";
import { NavigationProp, useNavigation } from "@react-navigation/native";
import { StackScreenProps } from "@react-navigation/stack";
import BigNumber from "bignumber.js";
File PlaceBidScreen.tsx
has 410 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useEffect, useState, useCallback } from "react";
import { Platform, View, Text } from "react-native";
import { useSelector } from "react-redux";
import { useForm } from "react-hook-form";
import { StackScreenProps } from "@react-navigation/stack";
Function PortfolioScreen
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
export function PortfolioScreen({ navigation }: Props): JSX.Element {
const { isLight } = useThemeContext();
const { domain } = useDomainContext();
const isEvmDomain = domain === DomainType.EVM;
const isFocused = useIsFocused();
- 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 AddressRow
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
export function AddressRow({
control,
networkName,
onContactButtonPress,
onQrButtonPress,
- 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
File ConfirmBorrowLoanTokenScreen.tsx
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ThemedScrollViewV2,
ThemedTextV2,
ThemedViewV2,
} from "@components/themed";
File TransactionAuthorization.tsx
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { CTransactionSegWit } from "@defichain/jellyfish-transaction/dist";
import {
JellyfishWallet,
WalletHdNodeProvider,
} from "@defichain/jellyfish-wallet";
Function SettingsNavigator
has 215 lines of code (exceeds 100 allowed). Consider refactoring. Open
export function SettingsNavigator(): JSX.Element {
const navigation = useNavigation<NavigationProp<SettingsParamList>>();
const goToNetworkSelect = (): void => {
navigation.navigate("NetworkSelectionScreen");
Function LoansNavigator
has 212 lines of code (exceeds 100 allowed). Consider refactoring. Open
export function LoansNavigator(): JSX.Element {
const navigation = useNavigation<NavigationProp<LoanParamList>>();
const headerContainerTestId = "loans_header_container";
const screenOptions = useNavigatorScreenOptions();
const goToNetworkSelect = (): void => {
Function RestoreMnemonicWallet
has 211 lines of code (exceeds 100 allowed). Consider refactoring. Open
export function RestoreMnemonicWallet(): JSX.Element {
const navigation = useNavigation<NavigationProp<WalletParamList>>();
const {
control,
formState: { isValid, isDirty },
File DexConfirmAddLiquidity.tsx
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { WalletAlert } from "@components/WalletAlert";
import { CTransactionSegWit } from "@defichain/jellyfish-transaction";
import { WhaleWalletAccount } from "@defichain/whale-api-wallet";
import { NavigationProp, useNavigation } from "@react-navigation/native";
import { StackScreenProps } from "@react-navigation/stack";
Function OceanInterface
has 209 lines of code (exceeds 100 allowed). Consider refactoring. Open
export function OceanInterface(): JSX.Element | null {
const logger = useLogger();
const dispatch = useAppDispatch();
const client = useWhaleApiClient();
const { wallet, address } = useWalletContext();
File CFPDetailScreen.tsx
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useCallback, useEffect, useMemo, useState } from "react";
import { translate } from "@translations";
import { ThemedTextV2 } from "@components/themed";
import { tailwind } from "@tailwind";
import { ProposalURLInput } from "@screens/AppNavigator/screens/Portfolio/components/ProposalURLInput";
File VaultDetailScreen.tsx
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ThemedScrollViewV2 } from "@components/themed";
import { StackScreenProps } from "@react-navigation/stack";
import { tailwind } from "@tailwind";
import { useEffect, useState } from "react";
import { Platform, View } from "react-native";