dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

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

            <Box sx={{ borderBottom: 1, borderColor: "divider" }}>
              <TabList
                onChange={handleChange}
                aria-label="lab API tabs example"
              >
Severity: Major
Found in client-web/src/pages/Signon/EmailModal.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Signon/UsernameModal.tsx on lines 45..53

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

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

            <Box sx={{ borderBottom: 1, borderColor: "divider" }}>
              <TabList
                onChange={handleChange}
                aria-label="lab API tabs example"
              >
Severity: Major
Found in client-web/src/pages/Signon/UsernameModal.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Signon/EmailModal.tsx on lines 48..56

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

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

test("renders correctly", () => {

    const tree = renderer.create(
        <NativeBaseProvider>
            <TransferModalButton
client-reactnative/__tests__/Modals/TransactionModal/SendItem-test.tsx on lines 6..18

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

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

test("renders correctly", () => {

    const tree = renderer.create(
        <NativeBaseProvider>
            <SendItem
client-reactnative/__tests__/Modals/TransactionModal/TransferModalButton-test.tsx on lines 6..18

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

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

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

    if (handlerData.receiverData.isSystemMessage && handlerData.receiverData.tokenAmount > 0) {
        if (messageCheck(handlerData.message, botOptions.botData.firstName + ' ' + botOptions.botData.lastName)) {
            return sendMessage(
                handlerData,
                messages.exampleBotMessage.tnxForTransaction,
Severity: Major
Found in bots/botTemplate/router.js and 1 other location - About 2 hrs to fix
bots/autoResponder/router.js on lines 56..66

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

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

    if (handlerData.receiverData.isSystemMessage && handlerData.receiverData.tokenAmount > 0) {
        if (messageCheck(handlerData.message, botOptions.botData.firstName + ' ' + botOptions.botData.lastName)) {
            return sendMessage(
                handlerData,
                messages.exampleBotMessage.tnxForTransaction,
Severity: Major
Found in bots/autoResponder/router.js and 1 other location - About 2 hrs to fix
bots/botTemplate/router.js on lines 22..32

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

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

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

export const botLogin = async (username, password) => {
    try {
        const request = await axios.post(botOptions.apiUrl + 'users/login', {
            username: username,
            password: password
Severity: Major
Found in bots/huthut/api.js and 1 other location - About 2 hrs to fix
bots/questionnaire/api.js on lines 6..17

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

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

export const botLogin = async (username, password) => {
    try {
        const request = await axios.post(botOptions.apiUrl + 'users/login', {
            username: username,
            password: password
Severity: Major
Found in bots/questionnaire/api.js and 1 other location - About 2 hrs to fix
bots/huthut/api.js on lines 22..33

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

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