Showing 502 of 8,855 total issues
Function EnterInviteCode
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const EnterInviteCode = observer(() => {
const [code, setCode] = useState('');
const [loading, setLoading] = useState(false);
const {loginStore, apiStore} = useStores();
- Create a ticketCreate a ticket
File Authentication.tsx
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Clipboard from '@react-native-clipboard/clipboard';
import { useWalletConnect } from '@walletconnect/react-native-dapp';
import React, { useEffect, useState } from 'react';
import { Linking, StyleSheet, Text, View } from 'react-native';
import { TouchableOpacity } from 'react-native-gesture-handler';
- Create a ticketCreate a ticket
Function router
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const router = (handlerData) => {
if(currentItem.status === "work"){
userSteps('setStep', handlerData.userJID, 4);
}
- 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 MessageDefault
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const MessageDefault: React.FC<IMessagesProps> = ({message, previousJID, nextJID}) => {
const [messagePositionData, setMessagePositionData] = useState<IMessagePosition>({
position: "single",
type: "single"
});
- 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 NewUserModal
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function NewUserModal({ open, setOpen, setUsers }: TProps) {
const apps = useStoreState((state) => state.apps);
const addAppUsers = useStoreState((state) => state.addAppUsers);
const [loading, setLoading] = useState(false);
- 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 message
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
message: async (p) => {
let balance, error;
try {
const web3 = new Web3(process.env.EXTERNAL_BC_WS as string);
const contractAddressUSDC = process.env.USDC_CONTRACT_ADDRESS as string;
- Create a ticketCreate a ticket
Function TransactionDetails
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TransactionDetails: React.FC<ITransactionDetailsProps> = (
props
) => {
const [transactionDetails, setTransactionDetails] = useState<
ITransaction | {}
- Create a ticketCreate a ticket
File PrivacyPolicy.tsx
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
Copyright 2019-2022 (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.
Note: linked open-source libraries and components may be subject to their own licenses.
- Create a ticketCreate a ticket
File AccountScreen.tsx
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {observer} from 'mobx-react-lite';
import React, {useEffect, useState} from 'react';
import {
Text,
View,
- Create a ticketCreate a ticket
Function userData
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const userData = (type, jid, data, dataGroup) => {
let userIndex = userDatalist.findIndex(user => user.name === jid);
if (userIndex < 0) {
console.log('=>=> Create user data', jid);
- Create a ticketCreate a ticket
Function questionHandler
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const questionHandler = (data) => {
let currentButtonType = userData('getData', data.userJID, null, 'buttonType');
getQuestionsInGroup(currentButtonType).then(result => {
console.log('QUESTION LIST IN GROUP ===========> ', result)
- Create a ticketCreate a ticket
Function Provenance
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Provenance: React.FC<IProvenance> = ({}) => {
const location = useLocation<{
nftItem: TBalance & IDocument;
walletAddress: string;
}>();
- Create a ticketCreate a ticket
Function handleAppleLogin
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const handleAppleLogin = async (
defaultToken: string,
loginUser: any,
registerSocialUser: any,
type: string,
- Create a ticketCreate a ticket
Function router
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const router = (xmpp, message, sender, receiver, requestType, receiverData, stanzaId) => {
if (requestType === 'x' && message.match(/\binvite\S*\b/g)) {
console.log('=> The bot was invited to the chat room ', receiver);
connectRoom(xmpp, sender, receiver);
}
- Create a ticketCreate a ticket
File Users.tsx
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as React from "react";
import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell";
import TableContainer from "@mui/material/TableContainer";
- Create a ticketCreate a ticket
Function OptionsItem
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function OptionsItem(props:optionsItemProps){
const {
handleChange,
selectedValue,
title,
- Create a ticketCreate a ticket
Function ActionItems
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ActionItems = (type: ActionItemType) => {
type TIconName =
| 'delete'
| 'edit'
| 'text-snippet'
- Create a ticketCreate a ticket
Function DocumentsShare
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const DocumentsShare = (props: DocumentsShareProps) => {
const [tab, setTab] = React.useState(0);
const [openModal, setOpenModal] = React.useState(false);
const [loading, setLoading] = React.useState(false);
const [sharedLinks, setSharedLinks] = React.useState<ISharedLink[]>([]);
- Create a ticketCreate a ticket
Function Dashboard
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Dashboard() {
const apps = useStoreState((state) => state.apps);
const [currentAppIndex, setCurrentAppIndex] = useState(0);
const [blockchain, setBlockchain] = useState<IBlockChain>({
- Create a ticketCreate a ticket
Function RoomsTabBar
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const RoomsTabBar = observer(() => {
const {chatStore} = useStores();
const privateRooms = chatStore.roomList?.filter((item: any) => {
const splitedJid = item?.jid?.split('@')[0];
- Create a ticketCreate a ticket