Showing 502 of 8,855 total issues
Function EnterInviteCode
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const EnterInviteCode = observer(() => {
const [code, setCode] = useState('');
const [loading, setLoading] = useState(false);
const {loginStore, apiStore} = useStores();
- Create a ticketCreate a ticket
Function Message
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
export const Message: React.FC<IMessage> = ({
message,
position,
onMessageButtonClick,
toggleTransferDialog,
- 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
File ChatDragItem.tsx
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
Function router
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const router = (handlerData) => {
if(currentItem.status === "work"){
userSteps('setStep', handlerData.userJID, 4);
}
- Create a ticketCreate a ticket
Function createMessage
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const createMessage = (
data: any,
body: any,
id: string,
from: string
- Create a ticketCreate a ticket
Function Blocking
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Blocking: React.FC<IBlocking> = observer(({}) => {
const {chatStore, loginStore} = useStores();
const manipulatedWalletAddress = underscoreManipulation(
loginStore.initialData.walletAddress,
);
- Create a ticketCreate a ticket
XmppHandler
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class XmppHandler {
public lastMsgId: string = "";
public isGettingMessages: boolean = false;
public isGettingFirstMessages: boolean = false;
private temporaryMessages: TMessageHistory[] = [];
- Create a ticketCreate a ticket
Function searchItemsHandler
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const searchItemsHandler = (data) => {
console.log('=> searchItemsHandler | Message received from ', data.receiver, data.message);
let tokenAmount = 1;
userPaymentVerify(data, botOptions.botData.collectFee).then(response => {
if (!response) {
- Create a ticketCreate a ticket
Function gettingCoinsHandler
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const gettingCoinsHandler = (data) => {
logCurrentHandler('gettingCoinsHandler', data.userJID, data.message);
const coinAmount = 7;
if (messageCheck(data.message, botOptions.botData.firstName + ' ' + botOptions.botData.lastName)) {
- Create a ticketCreate a ticket
Function ManageTabPanel
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ManageTabPanel = (props: ManageTabPanelProps) => {
const {
handleChangeTab,
sharedLinks,
loading,
- Create a ticketCreate a ticket
Function TransactionsTable
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function TransactionsTable(props: TProps) {
const history = useHistory();
return (
<TableContainer style={{ flex: 1, marginTop: "10px" }} component={Paper}>
- Create a ticketCreate a ticket
File DebugScreen.tsx
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, {useEffect, useState} from 'react';
import {
ScrollView,
Text,
TextInput,
- Create a ticketCreate a ticket
Function BlockDetails
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function BlockDetails(props) {
const [blockDetails, setBlockDetails] = useState<IBlock | {}>({});
const [loading, setLoading] = useState(false);
const params = useParams<{ blockNumber: string }>();
const getDetails = async () => {
- Create a ticketCreate a ticket
Function helloMessageHandler
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const helloMessageHandler = (data) => {
console.log('=> helloMessageHandler || Message received from ', data.userJID, data.message);
userData('setData', data.userJID, '', 'deleteItem');
getUserData(data.userJID).then(userData => {
- Create a ticketCreate a ticket
Function transferTokens
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async transferTokens(
bodyData: any,
token: string,
fromWallet: string,
senderName: string,
- Create a ticketCreate a ticket
Function handleCreateNewChat
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleCreateNewChat = () => {
let roomHash = '';
sha256(chatName).then(async hash => {
roomHash = hash;
- Create a ticketCreate a ticket
Function answerHandler
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const answerHandler = (data) => {
console.log('=> answerHandler | Message received from ', data.receiver, data.message);
const userMessage = data.message.split(' ').slice(1).join(' ');
getListAnswers(data.receiver).then(result => {
const answerId = result.length+1;
- Create a ticketCreate a ticket
Function ManageDocumentShareTabPanel
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ManageDocumentShareTabPanel = (
props: ManageDocumentShareTabPanelProps
) => {
const { handleChangeTab, loading, sharedLinks, handleOpenModal, deleteLink } =
props;
- Create a ticketCreate a ticket
Function sendFile
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const sendFile = async (file: File, isReply: boolean) => {
const formData = new FormData();
formData.append("files", file);
setFileUploading(true);
try {
- Create a ticketCreate a ticket
Function RenderMainMessageSection
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const RenderMainMessageSection: React.FC = () => {
const firstName = currentThreadMessage?.user.name.split(' ')[0] || 'N/A';
const lastName = currentThreadMessage?.user.name.split(' ')[1] || 'N/A';
//@ts-ignore
const parentDate = new Date(currentThreadMessage?.createdAt * 1000);
- Create a ticketCreate a ticket