Showing 335 of 335 total issues
Function send
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. 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 BorrowLoanTokenScreen
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export function BorrowLoanTokenScreen({
route,
navigation,
}: Props): JSX.Element {
const client = useWhaleApiClient();
- 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 WalletTextInput
has 160 lines of code (exceeds 100 allowed). Consider refactoring. Open
(props: WalletTextInputProps, ref: React.Ref<any>): JSX.Element => {
const [isFocus, setIsFocus] = useState(false);
const {
title,
titleTestID,
Function ConfirmSummaryTitle
has 160 lines of code (exceeds 100 allowed). Consider refactoring. Open
export function ConfirmSummaryTitle(
props: ConfirmSummaryTitleV2Props
): JSX.Element {
const IconA = getNativeIcon(props.iconA);
const IconB = getNativeIcon(props.iconB);
File DexConfirmRemoveLiquidity.tsx
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { WalletAlert } from "@components/WalletAlert";
import { CTransactionSegWit } from "@defichain/jellyfish-transaction";
import { PoolPairData } from "@defichain/whale-api-client/dist/api/poolpairs";
import { WhaleWalletAccount } from "@defichain/whale-api-wallet";
import { NavigationProp, useNavigation } from "@react-navigation/native";
File EditLoanSchemeScreen.tsx
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ThemedScrollViewV2,
ThemedTextV2,
ThemedViewV2,
} from "@components/themed";
File BatchCard.tsx
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as React from "react";
import { memo, useMemo, useState } from "react";
import { Text, View, LayoutChangeEvent } from "react-native";
import {
ThemedText,
Function TotalPortfolio
has 157 lines of code (exceeds 100 allowed). Consider refactoring. Open
export function TotalPortfolio(props: TotalPortfolioProps): JSX.Element {
const { hasFetchedToken } = useSelector((state: RootState) => state.wallet);
const { domain } = useDomainContext();
const isEvmDomain = domain === DomainType.EVM;
const { hasFetchedVaultsData } = useSelector(
File CloseVaultScreen.tsx
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Dispatch, useEffect, useState } from "react";
import { Image } from "expo-image";
import { useSelector } from "react-redux";
import { StackScreenProps } from "@react-navigation/stack";
import { EnvironmentNetwork } from "@waveshq/walletkit-core";
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (offline !== undefined && offline) {
return (
<View style={tailwind("flex flex-row items-center")}>
<ThemedTextV2
dark={tailwind("text-mono-dark-v2-700", {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 230.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (online !== undefined && online) {
return (
<View style={tailwind("flex flex-row items-center")}>
<ThemedTextV2
dark={tailwind("text-mono-dark-v2-700", {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 230.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function SummaryTransactionDetails
has 156 lines of code (exceeds 100 allowed). Consider refactoring. Open
function SummaryTransactionDetails(
props: SummaryTransactionDetailsProps
): JSX.Element {
const borrowAmountUSD = new BigNumber(props.borrowAmount).multipliedBy(
getActivePrice(props.loanToken.token.symbol, props.loanToken.activePrice)
Function DexNavigator
has 155 lines of code (exceeds 100 allowed). Consider refactoring. Open
export function DexNavigator(): JSX.Element {
const navigation = useNavigation<NavigationProp<DexParamList>>();
const screenOptions = useNavigatorScreenOptions();
const goToNetworkSelect = (): void => {
navigation.navigate("NetworkSelectionScreenDex");
File ActionButtons.tsx
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
IconName,
IconType,
ThemedIcon,
ThemedTextV2,
Similar blocks of code found in 3 locations. Consider refactoring. Open
const TextInputIOS = forwardRef(
(props: WalletTextInputProps, ref: React.Ref<any>) => {
const { inputType, onBlur, onFocus, ...otherProps } = props;
const { shouldHandleKeyboardEvents } = useBottomSheetInternal();
const handleOnFocus = useCallback(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 228.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
const TextInputIOS = forwardRef(
(props: WalletTextInputProps, ref: React.Ref<any>) => {
const { inputType, onBlur, onFocus, ...otherProps } = props;
const { shouldHandleKeyboardEvents } = useBottomSheetInternal();
const handleOnFocus = useCallback(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 228.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
const TextInputIOS = forwardRef(
(props: WalletTextInputProps, ref: React.Ref<any>) => {
const { inputType, onBlur, onFocus, ...otherProps } = props;
const { shouldHandleKeyboardEvents } = useBottomSheetInternal();
const handleOnFocus = useCallback(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 228.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File DexNavigator.tsx
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { NavigationProp, useNavigation } from "@react-navigation/native";
import { PoolPairData } from "@defichain/whale-api-client/dist/api/poolpairs";
import { createStackNavigator } from "@react-navigation/stack";
import BigNumber from "bignumber.js";
import { HeaderFont } from "@components/Text";
File BrowseAuctions.tsx
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useCallback, useRef, useState } from "react";
import { useScrollToTop } from "@react-navigation/native";
import { tailwind } from "@tailwind";
import { BatchCard } from "@screens/AppNavigator/screens/Auctions/components/BatchCard";
import { Platform, View } from "react-native";
Function SwapTokenSelectionScreen
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export function SwapTokenSelectionScreen({ route }: Props): JSX.Element {
const {
fromToken,
listType,
list,
- 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"