dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

    validate: (values) => {
      const errors: Record<string, string> = {};

      if (!values.firstName) {
        errors.firstName = "Required";
Severity: Major
Found in client-web/src/pages/Profile/EditProfileModal.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Profile/DocumentsCreateModal.tsx on lines 27..39

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

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 gettingCoinsHandler has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const gettingCoinsHandler = (data) => {
    logCurrentHandler('gettingCoinsHandler', data.userJID, data.message);
    const coinAmount = 7;

    if (messageCheck(data.message, botOptions.botData.firstName + ' ' + botOptions.botData.lastName)) {
Severity: Major
Found in bots/raffle/handlers/coins/gettingCoinsHandler.js - About 2 hrs to fix

Function TransactionsTable has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function TransactionsTable(props: TProps) {
  const history = useHistory();

  return (
    <TableContainer style={{ flex: 1, marginTop: "10px" }} component={Paper}>
Severity: Major
Found in client-web/src/pages/Profile/TransactionsTable.tsx - About 2 hrs to fix

Function ManageTabPanel has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ManageTabPanel = (props: ManageTabPanelProps) => {
  const {
    handleChangeTab,
    sharedLinks,
    loading,
Severity: Major
Found in client-web/src/pages/Privacy/ManageProfileTabPanel.tsx - About 2 hrs to fix

File DebugScreen.tsx has 261 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, {useEffect, useState} from 'react';
import {
  ScrollView,
  Text,
  TextInput,
Severity: Minor
Found in client-reactnative/src/Screens/System/DebugScreen.tsx - About 2 hrs to fix

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

    if (
        !process.env.MONGO_USERNAME &&
        !process.env.MONGO_PASSWORD &&
        !process.env.MONGO_HOSTNAME &&
        !process.env.MONGO_PORT &&
Severity: Major
Found in bots/questionnaire/config/connect.js and 3 other locations - About 2 hrs to fix
bots/merchantBot/config/connect.js on lines 9..17
bots/merchantBot/config/connect.js on lines 19..27
bots/questionnaire/config/connect.js on lines 6..14

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

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

    if (
        !process.env.TYPE ||
        !process.env.BOT_ADDRESS ||
        !process.env.CONFERENCE_ADDRESS ||
        !process.env.APP_USERNAME ||
Severity: Major
Found in bots/questionnaire/config/connect.js and 3 other locations - About 2 hrs to fix
bots/merchantBot/config/connect.js on lines 9..17
bots/merchantBot/config/connect.js on lines 19..27
bots/questionnaire/config/connect.js on lines 16..24

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

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

    if (
        !process.env.TYPE ||
        !process.env.BOT_ADDRESS ||
        !process.env.CONFERENCE_ADDRESS ||
        !process.env.APP_USERNAME ||
Severity: Major
Found in bots/merchantBot/config/connect.js and 3 other locations - About 2 hrs to fix
bots/merchantBot/config/connect.js on lines 19..27
bots/questionnaire/config/connect.js on lines 6..14
bots/questionnaire/config/connect.js on lines 16..24

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

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

    if (
        !process.env.MONGO_USERNAME &&
        !process.env.MONGO_PASSWORD &&
        !process.env.MONGO_HOSTNAME &&
        !process.env.MONGO_PORT &&
Severity: Major
Found in bots/merchantBot/config/connect.js and 3 other locations - About 2 hrs to fix
bots/merchantBot/config/connect.js on lines 9..17
bots/questionnaire/config/connect.js on lines 6..14
bots/questionnaire/config/connect.js on lines 16..24

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

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

                    {audioMimetypes[filePickResult.type] ? (
                      <AntIcon
                        name={'playcircleo'}
                        color={commonColors.primaryColor}
                        size={hp('5%')}
Severity: Major
Found in client-reactnative/src/Screens/MintScreen.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Actions/MintScreen.tsx on lines 206..225

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

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

                    {isAudioMimetype(filePickResult.type) ? (
                      <AntIcon
                        name={'playcircleo'}
                        color={commonColors.primaryColor}
                        size={hp('5%')}
Severity: Major
Found in client-reactnative/src/Screens/Actions/MintScreen.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/MintScreen.tsx on lines 242..261

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

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 [uploadedFile, setUploadedFile] = useState({
    _id: "",
    createdAt: "",
    expiresAt: 0,
    filename: "",
Severity: Major
Found in client-web/src/pages/UploadDocument/UploadDocument.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Profile/ProfileScreen.tsx on lines 77..91

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

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 [uploadedAvatar, setUploadedAvatar] = useState({
    _id: '',
    createdAt: '',
    expiresAt: 0,
    filename: '',
Severity: Major
Found in client-reactnative/src/Screens/Profile/ProfileScreen.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/UploadDocument/UploadDocument.tsx on lines 13..27

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

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 BlockDetails has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function BlockDetails(props) {
  const [blockDetails, setBlockDetails] = useState<IBlock | {}>({});
  const [loading, setLoading] = useState(false);
  const params = useParams<{ blockNumber: string }>();
  const getDetails = async () => {
Severity: Major
Found in client-web/src/pages/Explorer/BlockDetails.tsx - About 2 hrs to fix

Function helloMessageHandler has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const helloMessageHandler = (data) => {
    console.log('=> helloMessageHandler || Message received from ', data.userJID, data.message);
    userData('setData', data.userJID, '', 'deleteItem');

    getUserData(data.userJID).then(userData => {
Severity: Major
Found in bots/merchantBot/handlers/helloMessage.js - About 2 hrs to fix

Function transferTokens has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async transferTokens(
    bodyData: any,
    token: string,
    fromWallet: string,
    senderName: string,
Severity: Major
Found in client-reactnative/src/stores/walletStore.ts - About 2 hrs to fix

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

          <View style={classes.section1}>
            <TextInput
              value={itemName}
              onChangeText={setItemName}
              placeholder="Document Name"
Severity: Major
Found in client-reactnative/src/Screens/UploadDocumentsScreen.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Actions/UploadDocumentsScreen.tsx on lines 196..205

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

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

          <View style={classes.section1}>
            <TextInput
              value={itemName}
              onChangeText={setItemName}
              placeholder="Document Name"
client-reactnative/src/Screens/UploadDocumentsScreen.tsx on lines 255..264

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

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

            <Box>
                <Typography
                fontWeight={"bold"}
                >Create a Profile Sharing link</Typography>
                <Typography>
Severity: Major
Found in client-web/src/pages/Privacy/AddProfileTabPanel.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Privacy/AddDocumentTabPanel.tsx on lines 81..97

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

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

            <Box>
                <Typography
                fontWeight={"bold"}
                >Create a Document Sharing link</Typography>
                <Typography>
Severity: Major
Found in client-web/src/pages/Privacy/AddDocumentTabPanel.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Privacy/AddProfileTabPanel.tsx on lines 150..166

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

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