Showing 502 of 8,855 total issues
Function ChatDetailsScreen
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
Open
const ChatDetailsScreen = observer(({route}: any) => {
const {chatStore, loginStore, apiStore} = useStores();
const currentRoomDetail = chatStore.getRoomDetails(
route.params.roomJID,
) as roomListProps;
- Read upRead up
- Create a ticketCreate a ticket
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 AccountScreen
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AccountScreen = observer(() => {
const {loginStore, accountStore} = useStores();
const {userAvatar, initialData, userDescription, userToken} = loginStore;
- Create a ticketCreate a ticket
Function NewChat
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const NewChat: React.FC<INewChat> = ({}) => {
const theme = useTheme();
const user = useStoreState((state) => state.user);
const { showSnackbar } = useSnackbar();
const [loading, setLoading] = useState(false);
- Create a ticketCreate a ticket
File ProfileScreen.tsx
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
Copyright 2019-2021 (c) Dappros Ltd, registered in England & Wales, registration number 11455432. All rights reserved.
You may not use this file except in compliance with the License.
You may obtain a copy of the License at https://github.com/dappros/ethora/blob/main/LICENSE.
*/
- Create a ticketCreate a ticket
Function ChatDragItem
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ChatDragItem = (props: ChatDragItemProps) => {
const ref = useRef();
const [animation, setAnimation] = useState(new Animated.Value(0));
- Create a ticketCreate a ticket
File Message.tsx
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useEffect, useMemo, useState } from "react";
import {
Message as KitMessage,
MessageModel,
MessageSeparator,
- Create a ticketCreate a ticket
Function MainHeader
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const MainHeader = observer(() => {
const {chatStore, apiStore, loginStore} = useStores();
const navigation = useNavigation<HomeStackNavigationProp>();
const route = useRoute();
const buttons = [
- Create a ticketCreate a ticket
Function UsernameSignUpForm
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function UsernameSignUpForm(props: TProps) {
const history = useHistory();
const setUser = useStoreState((state) => state.setUser);
const [showPassword, setShowPassword] = useState(false);
- Create a ticketCreate a ticket
Function ChangeBackgroundScreen
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ChangeBackgroundScreen = observer((props: any) => {
const navigation = useNavigation();
const {chatStore, loginStore, apiStore} = useStores();
const roomJID = props.route.params.roomJID;
- Create a ticketCreate a ticket
Function Referrals
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Referrals: React.FC<IReferrals> = ({}) => {
const link = useStoreState((state) => state.user._id);
const walletAddress = useStoreState((state) => state.user.walletAddress);
const setBalance = useStoreState((state) => state.setBalance);
- Create a ticketCreate a ticket
Function EmailSignUpForm
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function EmailSignUpForm(props: TProps) {
const [showPassword, setShowPassword] = useState(false);
const [openSnack, setOpenSnack] = useState(false);
const [errorMsg, setErrorMsg] = useState("");
const history = useHistory();
- Create a ticketCreate a ticket
Function TransactionsListItem
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const TransactionsListItem = (props: TransactionListProps) => {
const {
transactionReceiver,
transactionSender,
transactionAmount,
- Create a ticketCreate a ticket
File index.tsx
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as React from "react";
import Container from "@mui/material/Container";
import Tabs from "@mui/material/Tabs";
import Tab from "@mui/material/Tab";
import Typography from "@mui/material/Typography";
- Create a ticketCreate a ticket
File NftItemHistoryScreen.tsx
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, {Fragment, useEffect, useState} from 'react';
import {ActivityIndicator, StyleSheet, TouchableOpacity} from 'react-native';
import {HStack, Image, ScrollView, Text, View, VStack} from 'native-base';
import SecondaryHeader from '../../components/SecondaryHeader/SecondaryHeader';
import AntIcon from 'react-native-vector-icons/AntDesign';
- Create a ticketCreate a ticket
Function HeaderMenu
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const HeaderMenu = () => {
const navigation = useNavigation<HomeStackNavigationProp>();
const [open, setOpen] = useState(false);
const {loginStore, debugStore} = useStores();
- Create a ticketCreate a ticket
XmppClass
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class XmppClass {
public client!: Client;
init(walletAddress: string, password: string) {
if (!password) {
- Create a ticketCreate a ticket
Function AddDocumentTabPanel
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const AddDocumentTabPanel = (props: AddDocumentTabPanelProps) => {
const {getSharedLinks} = props
const [expiration, setExpiration] = React.useState((-1).toString());
const [memo, setMemo] = React.useState('');
const [documentId, setDocumentId] = React.useState('');
- Create a ticketCreate a ticket
File inputUtils.ts
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {diffChars} from 'diff';
import {StyleProp, TextStyle} from 'react-native';
// @ts-ignore the lib do not have TS declarations yet
import matchAll from 'string.prototype.matchall';
import {
- Create a ticketCreate a ticket
Function onEnd
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function onEnd(
p: Participant,
client: Client,
walletAddress: string
) {
- Create a ticketCreate a ticket
Function _useStore
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
Open
immer((set, get) => {
return {
user: {
firstName: "",
lastName: "",
- Read upRead up
- Create a ticketCreate a ticket
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"