dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

File MintScreen.tsx has 371 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, {Fragment, useState} from 'react';
import {
  Text,
  View,
  StyleSheet,
Severity: Minor
Found in client-reactnative/src/Screens/Actions/MintScreen.tsx - About 4 hrs to fix

Function ProfileShareAdd has 122 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ProfileShareAdd: React.FC<IProfileShareAdd> = ({}) => {
  const [memo, setMemo] = useState('');
  const [expiration, setExpiration] = useState('-1');
  const [createdLink, setCreatedLink] = useState<ISharedLink>({
    _id: '',
Severity: Major
Found in client-reactnative/src/Screens/Privacy/ProfileShareAdd.tsx - About 4 hrs to fix

Function ChatDetailMemebersList has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ChatDetailMemebersList:React.FC<ChatDetailMemebersListProps> = (props: ChatDetailMemebersListProps) => {

    //component props
    const {
        handleMemberLongTap,

Function BasicTable has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function BasicTable() {
  const apps = useStoreState((state) => state.apps)
  const [open, setOpen] = React.useState(false)
  const [showDelete, setShowDelete] = React.useState(false)
  const [showEdit, setShowEdit] = React.useState(false)
Severity: Major
Found in client-web/src/pages/Owner/Apps.tsx - About 4 hrs to fix

Function ManageData has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ManageData = (props: ManageDataProps) => {
  const [deleteDialogOpen, setDeleteDialogOpen] = React.useState(false);
  const [loading, setLoading] = React.useState(false);
  const { showSnackbar } = useSnackbar();
  const clearUser = useStoreState((state) => state.clearUser);
Severity: Major
Found in client-web/src/pages/Privacy/ManageData.tsx - About 4 hrs to fix

Function ChatDetailHeader has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ChatDetailHeader: React.FunctionComponent<ChatDetailHeaderProps> = (
  props: ChatDetailHeaderProps,
) => {
  //component props
  const {deleteRoomDialog, toggleFavourite, currentRoomDetail} = props;

Function userData has a Cognitive Complexity of 32 (exceeds 5 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: Minor
Found in bots/merchantBot/actions.js - About 4 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 parseValue has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

const parseValue = (
  value: string,
  partTypes: PartType[],
  positionOffset = 0,
): {plainText: string; parts: Part[]} => {
Severity: Minor
Found in client-reactnative/src/helpers/chat/inputUtils.ts - About 4 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 messagingTimeout has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const messagingTimeout = (data, timeToAdd) => {
    console.log("START TIMEOUT ", timeToAdd)
    const timeData = timeToAdd.split(":");
    const addedTime = addingTime(data, timeData);

Severity: Major
Found in bots/raffle/handlers/helpers/messagingTimeout.js - About 4 hrs to fix

Function RenderChatFooter has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RenderChatFooter = (props: RenderChatFooterProps) => {
  const boxHeight = useSharedValue(0);
  const {
    fileUploadProgress,
    setFileUploadProgress,
Severity: Major
Found in client-reactnative/src/components/Chat/RenderChatFooter.tsx - About 4 hrs to fix

ChatStore has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

export class ChatStore {
  messages: IMessage[] = [];
  xmpp: any = null;
  xmppError: any = '';
  roomList: roomListProps[] | [] = [];
Severity: Minor
Found in client-reactnative/src/stores/chatStore.ts - About 4 hrs to fix

Function UsernameSignInForm has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function UsernameSignInForm(props: TProps) {
  const setUser = useStoreState((state) => state.setUser);
  const history = useHistory();
  const formik = useFormik({
    initialValues: {
Severity: Major
Found in client-web/src/pages/Signon/UsernameSignInForm.tsx - About 4 hrs to fix

Function ChatDetails has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function ChatDetails() {
  const { roomJID } = useParams<{ roomJID: string }>();

  const [newDescription, setNewDescription] = useState("");
  const [newRoomName, setNewRoomName] = useState("");
Severity: Major
Found in client-web/src/pages/ChatRoomDetails/ChatDetailCard.tsx - About 4 hrs to fix

Function createMessageObject has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const createMessageObject = (messageDetails = []) => {
  const message: IMessage = {
    _id: '',
    text: '',
    createdAt: '',
Severity: Major
Found in client-reactnative/src/helpers/chat/createMessageObject.ts - About 4 hrs to fix

Function AddTabPanel has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const AddTabPanel = (props: AddTabPanelProps) => {

    const {getSharedLinks} = props
    const [expiration, setExpiration] = React.useState((-1).toString());
    const [memo, setMemo] = React.useState('');
Severity: Major
Found in client-web/src/pages/Privacy/AddProfileTabPanel.tsx - About 4 hrs to fix

Function QRCodeGenerator has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const QRCodeGenerator = (props: QRCodeGeneratorProps) => {
  const svg = useRef(null);
  const {apiStore} = useStores();
  const {shareKey, close} = props;

Severity: Major
Found in client-reactnative/src/components/QRCodeGenerator.tsx - About 4 hrs to fix

Function ScanScreen has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ScanScreen = () => {

  //mobx stores
  const {loginStore, chatStore, apiStore} = useStores();
  //mobx stores
Severity: Major
Found in client-reactnative/src/Screens/Actions/ScanScreen.tsx - About 4 hrs to fix

Function ProfileModal has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ProfileModal = (props: ProfileModalProps) => {
  const {
    isVisible,
    onBackdropPress,
    modalType,
Severity: Major
Found in client-reactnative/src/components/Modals/Profile/ProfileModal.tsx - About 4 hrs to fix

File ChatTransferDialog.tsx has 347 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useEffect, useMemo, useState } from "react";

import {
  Dialog,
  DialogContent,
Severity: Minor
Found in client-web/src/components/Chat/ChatTransferDialog.tsx - About 4 hrs to fix

File questions.create.ts has 345 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Client } from '@xmpp/client'
import Web3 from 'web3'
import { Message, Participant, Question } from './types'
import { sendMessage } from './utils'
import * as api from './api'
Severity: Minor
Found in bots/createBot/src/questions.create.ts - About 4 hrs to fix
Severity
Category
Status
Source
Language