dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function init has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  init(walletAddress: string, password: string) {
    if (!password) {
      return;
    }

Severity: Major
Found in client-web/src/xmpp.ts - About 2 hrs to fix

Function parseValue has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const parseValue = (
  value: string,
  partTypes: PartType[],
  positionOffset = 0,
): {plainText: string; parts: Part[]} => {
Severity: Major
Found in client-reactnative/src/helpers/chat/inputUtils.ts - About 2 hrs to fix

Function router has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

const router = (xmpp, message, roomJID, userJID, receiverData, receiverMessageId, connectData) => {
    let userStep = userSteps('getStep', receiverData.attrs.senderJID, null);
    let currentButtonType = userData('getData', userJID, null);

    let handlerData = {
Severity: Minor
Found in bots/merchantBot/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 MintNft has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export const MintNft: React.FC<IMintNft> = ({}) => {
  const [preview, setPreview] = React.useState<any>(null);
  const [fileError, setFileError] = React.useState("");
  const [file, setFile] = React.useState<File | null>(null);
  const [loading, setLoading] = React.useState(false);
Severity: Minor
Found in client-web/src/pages/MintNft/MintNft.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

File Provenance.tsx has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  Avatar,
  Collapse,
  List,
  ListItem,
Severity: Minor
Found in client-web/src/pages/Transactions/Provenance.tsx - About 2 hrs to fix

File RegisterScreen.tsx has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
Copyright 2019-2021 (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.
*/
Severity: Minor
Found in client-reactnative/src/Screens/Login/RegisterScreen.tsx - About 2 hrs to fix

Function AssetItem has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AssetItem = (props: AssetItemProps) => {
  const {
    itemTransferFunc,
    selectedItem,
    nftId,

Function CoinPurchaseScreen has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const CoinPurchaseScreen: React.FC<ICoinPurchaseScreen> = ({}) => {
  const {loginStore, walletStore} = useStores();
  const {
    connected,

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

Function messages has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const messages = () => {
    return {
        general: {
            welcomeMessage: 'Raffle bot launched!',
        },
Severity: Major
Found in bots/raffle/config/messages.js - About 2 hrs to fix

Function ProfileShareTab has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ProfileShareTab = (props: ProfileShareTabProps) => {

    const [tab, setTab] = React.useState(0);
    const [loading, setLoading] = React.useState(false);
    const [sharedLinks, setSharedLinks] = React.useState<ISharedLink[]>([]);
Severity: Major
Found in client-web/src/pages/Privacy/ProfileShareTab.tsx - About 2 hrs to fix

File ThreadContainer.tsx has 283 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useState } from "react";
import {
  ChatContainer,
  ConversationHeader,
  MessageInput,
Severity: Minor
Found in client-web/src/components/Chat/Threads/ThreadContainer.tsx - About 2 hrs to fix

File NftListItem.tsx has 283 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/Transactions/NftListItem.tsx - About 2 hrs to fix

File MetaNavigation.tsx has 282 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

import { CompassItem } from "./CompassItem";
import {
  Box,
Severity: Minor
Found in client-web/src/components/MetaNavigation/MetaNavigation.tsx - About 2 hrs to fix

Function ChatTransferDialog has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

export function ChatTransferDialog({
  open,
  onClose,
  loading,
  message,
Severity: Minor
Found in client-web/src/components/Chat/ChatTransferDialog.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 NewItemModal has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

export default function NewItemModal(props: Props) {
  const [preview, setPreview] = React.useState<any>(null);
  const [fileError, setFileError] = React.useState("");
  const [file, setFile] = React.useState<File | null>(null);
  const [loading, setLoading] = React.useState(false);
Severity: Minor
Found in client-web/src/pages/Profile/NewItemModal.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 TokensOrItemsTransfer has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

export const TokensOrItemsTransfer: React.FC<ITransferModal> = ({
  dataForTransfer,
  closeModal,
  hideUserActions,
}) => {

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 20 (exceeds 5 allowed). Consider refactoring.
Open

const MintScreen = () => {

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

  const renderMedia = (mediaProps: IMessage | any) => {
    if (!mediaProps) {
      return null;
    }
    const {
Severity: Major
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 2 hrs to fix

Function getPushToken has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getPushToken = async (
  walletAddress: string,
  DOMAIN: string,
  defaultUrl: string,
  navigation: HomeStackNavigationProp,
Severity: Major
Found in client-reactnative/src/helpers/pushNotifications.ts - About 2 hrs to fix

Function renderTokenTypeName has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderTokenTypeName = () => {
    if (type === tokenTypes.mint) {
      const allTotals = nftTotal ? nftTotal.split(',') : [];

      const currentTotal = allTotals[+parseInt(contractId as string) - 1];
Severity: Major
Found in client-reactnative/src/components/Transactions/NftTransactionItem.tsx - About 2 hrs to fix
Severity
Category
Status
Source
Language