dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          {itemTransactions.length ? (
            <NftTransactionListTab
              transactions={itemTransactions}
              walletAddress={userWalletAddress}
              onEndReached={() => {}}
client-reactnative/src/Screens/Profile/NftItemHistoryScreen.tsx on lines 235..259

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 113.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            {itemTransactions.length ? (
              <NftTransactionListTab
                onEndReached={() => {}}
                transactions={itemTransactions}
                walletAddress={userWalletAddress}
client-reactnative/src/Screens/Profile/DocumentHistoryScreen.tsx on lines 215..239

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 113.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

Identical blocks of code found in 5 locations. Consider refactoring.
Open

export const sendTyping = (xmpp, connectData, chat_jid, type) => {
    return xmpp.send(xml('message', {
        to: chat_jid,
        type: 'groupchat',
        id: type
Severity: Major
Found in bots/autoResponder/actions.js and 4 other locations - About 3 hrs to fix
bots/botTemplate/actions.js on lines 46..58
bots/gptBot/actions.js on lines 46..58
bots/raffle/actions.js on lines 46..58
bots/translateBot/actions.js on lines 46..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

export const sendTyping = (xmpp, connectData, chat_jid, type) => {
    return xmpp.send(xml('message', {
        to: chat_jid,
        type: 'groupchat',
        id: type
Severity: Major
Found in bots/translateBot/actions.js and 4 other locations - About 3 hrs to fix
bots/autoResponder/actions.js on lines 46..58
bots/botTemplate/actions.js on lines 46..58
bots/gptBot/actions.js on lines 46..58
bots/raffle/actions.js on lines 46..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

export const sendTyping = (xmpp, connectData, chat_jid, type) => {
    return xmpp.send(xml('message', {
        to: chat_jid,
        type: 'groupchat',
        id: type
Severity: Major
Found in bots/gptBot/actions.js and 4 other locations - About 3 hrs to fix
bots/autoResponder/actions.js on lines 46..58
bots/botTemplate/actions.js on lines 46..58
bots/raffle/actions.js on lines 46..58
bots/translateBot/actions.js on lines 46..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

export const sendTyping = (xmpp, connectData, chat_jid, type) => {
    return xmpp.send(xml('message', {
        to: chat_jid,
        type: 'groupchat',
        id: type
Severity: Major
Found in bots/raffle/actions.js and 4 other locations - About 3 hrs to fix
bots/autoResponder/actions.js on lines 46..58
bots/botTemplate/actions.js on lines 46..58
bots/gptBot/actions.js on lines 46..58
bots/translateBot/actions.js on lines 46..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

export const sendTyping = (xmpp, connectData, chat_jid, type) => {
    return xmpp.send(xml('message', {
        to: chat_jid,
        type: 'groupchat',
        id: type
Severity: Major
Found in bots/botTemplate/actions.js and 4 other locations - About 3 hrs to fix
bots/autoResponder/actions.js on lines 46..58
bots/gptBot/actions.js on lines 46..58
bots/raffle/actions.js on lines 46..58
bots/translateBot/actions.js on lines 46..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export async function onExit(
  p: Participant,
  client: Client,
  walletAddress: string
) {
Severity: Major
Found in bots/createBot/src/questions.create.ts and 1 other location - About 3 hrs to fix
bots/exportToUSDC/src/questions.create.ts on lines 243..265

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

      <TableCell
        style={{
          backgroundColor: !checkDisabled(row?.disabled, "admin")
            ? "white"
            : "lightgrey",
Severity: Major
Found in client-web/src/components/EditAcl.tsx and 3 other locations - About 3 hrs to fix
client-web/src/components/EditAcl.tsx on lines 86..101
client-web/src/components/EditAcl.tsx on lines 102..117
client-web/src/components/EditAcl.tsx on lines 118..133

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

      <TableCell
        style={{
          backgroundColor: !checkDisabled(row?.disabled, "update")
            ? "white"
            : "lightgrey",
Severity: Major
Found in client-web/src/components/EditAcl.tsx and 3 other locations - About 3 hrs to fix
client-web/src/components/EditAcl.tsx on lines 86..101
client-web/src/components/EditAcl.tsx on lines 118..133
client-web/src/components/EditAcl.tsx on lines 134..149

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

      <TableCell
        style={{
          backgroundColor: !checkDisabled(row?.disabled, "delete")
            ? "white"
            : "lightgrey",
Severity: Major
Found in client-web/src/components/EditAcl.tsx and 3 other locations - About 3 hrs to fix
client-web/src/components/EditAcl.tsx on lines 86..101
client-web/src/components/EditAcl.tsx on lines 102..117
client-web/src/components/EditAcl.tsx on lines 134..149

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export async function onExit(
  p: Participant,
  client: Client,
  walletAddress: string
) {
Severity: Major
Found in bots/exportToUSDC/src/questions.create.ts and 1 other location - About 3 hrs to fix
bots/createBot/src/questions.create.ts on lines 346..368

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        <LineChart
          width={500}
          height={300}
          data={userGraphData}
          margin={{
Severity: Major
Found in client-web/src/pages/Dashboard/UsersGraph.tsx and 1 other location - About 3 hrs to fix
client-web/src/pages/Dashboard/TokensGraph.tsx on lines 24..47

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language