dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

          <form style={{ flex: "1" }} onSubmit={formik.handleSubmit}>
            <TextField
              margin="dense"
              inputProps={{
                autoComplete: "off",
Severity: Major
Found in client-web/src/pages/Profile/NewItemModal.tsx and 1 other location - About 2 days to fix
client-web/src/pages/MintNft/MintNft.tsx on lines 142..194

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 423.

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

          <form style={{ flex: "1" }} onSubmit={formik.handleSubmit}>
            <TextField
              margin="dense"
              inputProps={{
                autoComplete: "off",
Severity: Major
Found in client-web/src/pages/MintNft/MintNft.tsx and 1 other location - About 2 days to fix
client-web/src/pages/Profile/NewItemModal.tsx on lines 150..202

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 423.

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 stanzas.ts has 935 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {xml} from '@xmpp/client';
import {ApiStore} from '../stores/apiStore';
import {XMPP_TYPES} from './xmppConstants';
const store = new ApiStore();

Severity: Major
Found in client-reactnative/src/xmpp/stanzas.ts - About 2 days to fix

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

const styles = StyleSheet.create({
  tokenIconStyle: {
    height: hp('3%'),
    width: hp('3%'),
  },
client-reactnative/src/components/Transactions/NftTransactionItem.tsx on lines 267..332

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 352.

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

const styles = StyleSheet.create({
  tokenIconStyle: {
    height: hp('3%'),
    width: hp('3%'),
  },
client-reactnative/src/components/Transactions/TransactionsListItem.tsx on lines 173..238

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 352.

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 xmpp.ts has 798 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import xmpp, { xml } from "@xmpp/client";
import { Client } from "@xmpp/client";
import { CONFERENCEDOMAIN, DOMAIN, SERVICE } from "./constants";
import { useStoreState } from "./store";
import { walletToUsername } from "./utils/walletManipulation";
Severity: Major
Found in client-web/src/xmpp.ts - About 1 day to fix

File Chat.tsx has 794 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, {
  useCallback,
  useEffect,
  useMemo,
  useRef,
Severity: Major
Found in client-web/src/pages/ChatInRoom/Chat.tsx - About 1 day to fix

Function UploadDocumentsScreen has 374 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

  const [itemName, setItemName] = useState<string>('');
Severity: Major
Found in client-reactnative/src/Screens/UploadDocumentsScreen.tsx - About 1 day to fix

Function MintScreen has 368 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

  const [itemName, setItemName] = useState<string>('');
Severity: Major
Found in client-reactnative/src/Screens/MintScreen.tsx - About 1 day to fix

Function ProfileScreen has 367 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ProfileScreen = observer(() => {
  const {loginStore, walletStore, chatStore, apiStore} = useStores();

  const navigation = useNavigation();

Severity: Major
Found in client-reactnative/src/Screens/Profile/ProfileScreen.tsx - About 1 day to fix

File OwnerRegistrationModal.tsx has 769 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useState } from "react";
import Dialog from "@mui/material/Dialog";
import DialogTitle from "@mui/material/DialogTitle";
import Box from "@mui/material/Box";
import IconButton from "@mui/material/IconButton";
Severity: Major
Found in client-web/src/pages/Signon/OwnerRegistrationModal.tsx - About 1 day to fix

Function _useStore has 356 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      immer((set, get) => {
        return {
          user: {
            firstName: "",
            lastName: "",
Severity: Major
Found in client-web/src/store/index.ts - About 1 day to fix

Function Bubble has 351 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Bubble = observer((props: BubbleProps) => {
  const {chatStore} = useStores();
  const [width, setWidth] = useState(0);
  const initialAnimationValue = new Animated.Value(0);

Severity: Major
Found in client-reactnative/src/components/Chat/MessageBubble.tsx - About 1 day to fix

Function ChatScreen has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
Open

const ChatScreen = observer(({route, navigation}: any) => {
  const {loginStore, chatStore, walletStore, apiStore, debugStore} =
    useStores();

  const {firstName, lastName, walletAddress} = loginStore.initialData;
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatExperimental.tsx - About 1 day 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

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

  return (
    <Modal onBackdropPress={closeModal} isVisible={modalVisible}>
      <View style={styles.modal}>
        <Input
          maxLength={15}
client-reactnative/src/components/Modals/Login/UserNameModal.tsx on lines 46..82

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 299.

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

  return (
    <Modal onBackdropPress={closeModal} isVisible={modalVisible}>
      <View style={styles.modal}>
        <Input
          maxLength={15}
client-reactnative/src/components/Login/RegisterExternalWalletModal.tsx on lines 50..86

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 299.

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

Function StatisticsPage has 329 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function StatisticsPage() {
  const [value, setValue] = React.useState(0);
  const [apiCount, setApiCount] = React.useState();
  const [sessionsCount, setSessionsCount] = React.useState();
  const [transactionCount, setTransactionCount] = React.useState();
Severity: Major
Found in client-web/src/pages/Statistics/index.tsx - About 1 day to fix

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

      <View>
        <Text style={styles.title}>Expiration</Text>

        <Text marginBottom={1}>
          If you set this, this link will only be valid for the given period of
Severity: Major
Found in client-reactnative/src/Screens/Privacy/DocumentShareAdd.tsx and 1 other location - About 1 day to fix
client-reactnative/src/Screens/Privacy/ProfileShareAdd.tsx on lines 81..103

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 292.

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

      <View>
        <Text style={styles.title}>Expiration</Text>

        <Text marginBottom={1}>
          If you set this, this link will only be valid for the given period of
Severity: Major
Found in client-reactnative/src/Screens/Privacy/ProfileShareAdd.tsx and 1 other location - About 1 day to fix
client-reactnative/src/Screens/Privacy/DocumentShareAdd.tsx on lines 102..124

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 292.

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 4 locations. Consider refactoring.
Open

const xmppSender = (data, message, type, isSystemMessage, tokenAmount, buttons) => {
    sendTyping(data.xmpp, data.connectData, data.roomJID, 'pausedComposing').then(() => {
        data.xmpp.send(xml('message', {
            to: data.roomJID,
            type: data.receiverData ? 'groupchat' : type,
Severity: Major
Found in bots/botTemplate/actions.js and 3 other locations - About 1 day to fix
bots/autoResponder/actions.js on lines 20..40
bots/gptBot/actions.js on lines 20..40
bots/translateBot/actions.js on lines 20..40

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 289.

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