dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

File LoginScreen.tsx has 344 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  Box,
  HStack,
  Icon,
  Image,
Severity: Minor
Found in client-reactnative/src/Screens/Login/LoginScreen.tsx - About 4 hrs to fix

Function processParticipant has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async function processParticipant(participant: Participant) {
    const { questionIndex } = participant;
    // on start
    if (questionIndex == -1) {
      await nextMessage(
Severity: Major
Found in bots/exportToUSDC/src/index.exportToUSDC.ts - About 4 hrs to fix

Function DocumentsCreateModal has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function DocumentsCreateModal(props: TProps) {
  const [loading, setLoading] = React.useState(false);

  const formik = useFormik({
    initialValues: {
Severity: Major
Found in client-web/src/pages/Profile/DocumentsCreateModal.tsx - About 4 hrs to fix

Function sendMessage has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

export async function sendMessage(p: Participant, message: Message, client: Client, walletAddress: string, repeat = false): Promise<void> {
  if (repeat === true) {
    for (const [index, msg] of message.messages.entries()) {
      await sleep(100)
      if (msg.repeat === true) {
Severity: Minor
Found in bots/exportToUSDC/src/utils.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 sendMessage has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

export async function sendMessage(p: Participant, message: Message, client: Client, walletAddress: string, repeat = false): Promise<void> {
  if (repeat === true) {
    for (const [index, msg] of message.messages.entries()) {
      await sleep(100)
      if (msg.repeat === true) {
Severity: Minor
Found in bots/createBot/src/utils.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 ScanScreen has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

const ScanScreen = () => {

  //mobx stores
  const {loginStore, chatStore, apiStore} = useStores();
  //mobx stores
Severity: Minor
Found in client-reactnative/src/Screens/Actions/ScanScreen.tsx - 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 processParticipant has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async function processParticipant(participant: Participant) {
    const { questionIndex } = participant
    // on start
    if (questionIndex == -1) {
      await nextMessage(
Severity: Major
Found in bots/createBot/src/index.create.ts - About 3 hrs to fix

File UploadDocumentsScreen.tsx has 331 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

Function RoomDetailsCard has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RoomDetailsCard = (props: RoomDetailsCardProps) => {
  //component props
  const {
    onImagePress,
    room,

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

export const ManageData: React.FC<IManageData> = ({}) => {
  const {loginStore} = useStores();
  const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
  const [loading, setLoading] = useState(false);

Severity: Major
Found in client-reactnative/src/Screens/Privacy/ManageData.tsx - About 3 hrs to fix

File EditAcl.tsx has 328 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useEffect, useState } 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/components/EditAcl.tsx - About 3 hrs to fix

Function answerHandler has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const answerHandler = (data) => {
    console.log('=> answerHandler | Message received from ', data.userJID, data.message);
    let currentButtonType = userData('getData', data.userJID, null, 'buttonType');

    const userMessage = data.message;
Severity: Major
Found in bots/merchantBot/handlers/answer.js - About 3 hrs to fix

File DocumentHistoryScreen.tsx has 324 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, {Fragment, useEffect, useState} from 'react';
import {ActivityIndicator, StyleSheet, TouchableOpacity} from 'react-native';
import {HStack, Image, Text, View, VStack} from 'native-base';
import SecondaryHeader from '../../components/SecondaryHeader/SecondaryHeader';
import AntIcon from 'react-native-vector-icons/AntDesign';
Severity: Minor
Found in client-reactnative/src/Screens/Profile/DocumentHistoryScreen.tsx - About 3 hrs to fix

Function UploadDocumentsScreen has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

const UploadDocumentsScreen = (props: MintScreenProps) => {
  const {loginStore, walletStore, apiStore, debugStore} = useStores();
  const navigation = useNavigation();

  const [itemName, setItemName] = useState<string>('');
Severity: Minor
Found in client-reactnative/src/Screens/UploadDocumentsScreen.tsx - About 3 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 MintScreen has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

const MintScreen = (props: MintScreenProps) => {
  const {loginStore, walletStore, apiStore} = useStores();
  const navigation = useNavigation();

  const [itemName, setItemName] = useState<string>('');
Severity: Minor
Found in client-reactnative/src/Screens/MintScreen.tsx - About 3 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 EmailSingInForm has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function EmailSingInForm(props: TProps) {
  const history = useHistory();
  const setUser = useStoreState((state) => state.setUser);
  const [disable, setDisable] = useState(false);
  const [showPassword, setShowPassword] = useState(false);
Severity: Major
Found in client-web/src/pages/Signon/EmailSignInForm.tsx - About 3 hrs to fix

File TokensOrItemsTransfer.tsx has 318 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {VStack, Input, View, Text} from 'native-base';
import React, {useState} from 'react';
import {ActivityIndicator, FlatList, StyleSheet} from 'react-native';
import {
  commonColors,

File MessageText.tsx has 318 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import {Button, Image, Text, View} from 'native-base';
import Ionicons from 'react-native-vector-icons/Ionicons';
import {
  widthPercentageToDP as wp,
Severity: Minor
Found in client-reactnative/src/components/Chat/MessageText.tsx - About 3 hrs to fix

Function Routes has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const Routes = () => {
  const userId = useStoreState((state) => state.user._id);
  const user = useStoreState((state) => state.user);

  const setACL = useStoreState((state) => state.setACL);
Severity: Major
Found in client-web/src/pages/Routes.tsx - About 3 hrs to fix

Function MyProfile has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function MyProfile() {
  const [loading, setLoading] = useState(false);
  const [transactions, setTransactions] =
    useState<ExplorerRespose<ITransaction[]>>();
  const user = useStoreState((store) => store.user);
Severity: Major
Found in client-web/src/pages/Profile/MyProfile.tsx - About 3 hrs to fix
Severity
Category
Status
Source
Language