dappros/ethora

View on GitHub

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();

Severity: Major
Found in client-reactnative/src/Screens/EnterInviteCodeScreen.tsx - About 2 hrs to fix

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';
Severity: Minor
Found in client-reactnative/src/Screens/Account/Authentication.tsx - About 2 hrs to fix

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);
    }
Severity: Minor
Found in bots/raffle/router.js - About 2 hrs to fix

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"
    });
Severity: Minor
Found in client-web/src/components/Chat/Messages/MessageDefault.tsx - About 2 hrs to fix

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);

Severity: Minor
Found in client-web/src/pages/Owner/NewUserModal.tsx - About 2 hrs to fix

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 TransactionDetails has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const TransactionDetails: React.FC<ITransactionDetailsProps> = (
  props
) => {
  const [transactionDetails, setTransactionDetails] = useState<
    ITransaction | {}
Severity: Major
Found in client-web/src/pages/Explorer/TransactionDetails.tsx - About 2 hrs to fix

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;
Severity: Major
Found in bots/exportToUSDC/src/questions.create.ts - About 2 hrs to fix

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.
Severity: Minor
Found in client-reactnative/src/components/PrivacyPolicy.tsx - About 2 hrs to fix

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,
Severity: Minor
Found in client-reactnative/src/Screens/Account/AccountScreen.tsx - About 2 hrs to fix

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)
Severity: Major
Found in bots/merchantBot/handlers/question.js - About 2 hrs to fix

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);
Severity: Major
Found in bots/merchantBot/actions.js - About 2 hrs to fix

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;
  }>();
Severity: Major
Found in client-web/src/pages/Transactions/Provenance.tsx - About 2 hrs to fix

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,
Severity: Major
Found in client-reactnative/src/helpers/login/socialLoginHandle.ts - About 2 hrs to fix

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);
    }
Severity: Major
Found in bots/huthut/router.js - About 2 hrs to fix

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";
Severity: Minor
Found in client-web/src/pages/Owner/Users.tsx - About 2 hrs to fix

Function OptionsItem has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function OptionsItem(props:optionsItemProps){
    const {
    handleChange,
    selectedValue,
    title,
Severity: Major
Found in client-web/src/pages/Privacy/AddProfileTabPanel.tsx - About 2 hrs to fix

Function ActionItems has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const ActionItems = (type: ActionItemType) => {
    type TIconName =
      | 'delete'
      | 'edit'
      | 'text-snippet'
Severity: Major
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 2 hrs to fix

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>({
Severity: Major
Found in client-web/src/pages/Dashboard/index.tsx - About 2 hrs to fix

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[]>([]);
Severity: Major
Found in client-web/src/pages/Privacy/DocumentsShareTab.tsx - About 2 hrs to fix

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];

Severity: Major
Found in client-reactnative/src/components/RoomList/RoomsTabBar.tsx - About 2 hrs to fix
Severity
Category
Status
Source
Language