dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

Function main has 175 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const main = async () => {
  const loginResponse = await login(USERNAME, PASSWORD)

  if (!loginResponse) {
    throw new Error('Bad creads for login')
Severity: Major
Found in bots/createBot/src/index.create.ts - About 7 hrs to fix

Function NewItemModal has 174 lines of code (exceeds 25 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: Major
Found in client-web/src/pages/Profile/NewItemModal.tsx - About 6 hrs to fix

Function main has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

const main = async () => {
  const loginResponse = await login(USERNAME, PASSWORD);

  if (!loginResponse) {
    throw new Error("Bad creads for login");
Severity: Minor
Found in bots/exportToUSDC/src/index.exportToUSDC.ts - About 6 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

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

  const setNftFile = async () => {
    try {
      const res = await DocumentPicker.pick({
        type: [
          DocumentPicker.types.images,
Severity: Major
Found in client-reactnative/src/Screens/Actions/MintScreen.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/Screens/MintScreen.tsx on lines 174..198

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

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

    } else {
      try {
        const res = await DocumentPicker.pick({
          type: [
            DocumentPicker.types.images,
Severity: Major
Found in client-reactnative/src/Screens/MintScreen.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/Screens/Actions/MintScreen.tsx on lines 152..176

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

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 MintNft has 169 lines of code (exceeds 25 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: Major
Found in client-web/src/pages/MintNft/MintNft.tsx - About 6 hrs to fix

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

const router = (xmpp, message, sender, receiver, requestType, receiverData, stanzaId) => {
    if (requestType === 'x' && message.match(/\binvite\S*\b/g)) {
        console.log('=> The bot was invited to the chat room ', receiver);
        connectRoom(xmpp, sender, receiver);
    }
Severity: Minor
Found in bots/huthut/router.js - About 6 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 NftListItem has 166 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const NftListItem = (props: NftListItemProps) => {
  const {
    assetUrl,
    assetsYouHave,
    totalAssets,
Severity: Major
Found in client-reactnative/src/components/Transactions/NftListItem.tsx - About 6 hrs to fix

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

import {useNavigation} from '@react-navigation/native';
import {HStack, Image} from 'native-base';
import React, {useEffect, useState} from 'react';
import {
  ActivityIndicator,
Severity: Minor
Found in client-reactnative/src/components/Chat/MetaNavigation.tsx - About 6 hrs to fix

Function MembersList has 160 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function MembersList() {
  const { roomJID }: any = useParams();
  const userChatRooms = useStoreState((store) => store.userChatRooms);
  const membersList = useStoreState((store) =>
    store.roomMemberInfo.filter((item) => item.name !== "none")
Severity: Major
Found in client-web/src/pages/ChatRoomDetails/MembersList.tsx - About 6 hrs to fix

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

        {activeAssetTab === 2 && (
          <FlatList
            data={collections}
            renderItem={e => (
              <RenderAssetItem
Severity: Major
Found in client-reactnative/src/components/Profile/ProfileTabs.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/components/Profile/ProfileTabs.tsx on lines 157..181

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

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

        {activeAssetTab === 1 && (
          <FlatList
            data={nftItems}
            renderItem={e => (
              <RenderAssetItem
Severity: Major
Found in client-reactnative/src/components/Profile/ProfileTabs.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/components/Profile/ProfileTabs.tsx on lines 182..206

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

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 const ProfileShare = () => {
  const [routeIndex, setRouteIndex] = useState(0);
  const scene = useMemo(() => {
    return SceneMap({
      manage: () => <ProfileShareManage onAddPress={setRouteIndex} />,
Severity: Major
Found in client-reactnative/src/Screens/Privacy/ProfileShare.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/Screens/Privacy/DocumentShares.tsx on lines 33..55

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

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 const DocumentShares = () => {
  const [routeIndex, setRouteIndex] = useState(0);
  const scene = useMemo(() => {
    return SceneMap({
      manage: () => <DocumentShareManage onAddPress={setRouteIndex} />,
Severity: Major
Found in client-reactnative/src/Screens/Privacy/DocumentShares.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/Screens/Privacy/ProfileShare.tsx on lines 33..55

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

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

export const DocumentShareAdd: React.FC<IDocumentShareAdd> = observer(({}) => {
  const [memo, setMemo] = useState('');
  const [expiration, setExpiration] = useState('-1');
  const [documentId, setDocumentId] = useState('');

Severity: Major
Found in client-reactnative/src/Screens/Privacy/DocumentShareAdd.tsx - About 6 hrs to fix

File ChatDetailsScreen.tsx has 426 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  Actionsheet,
  AlertDialog,
  Button,
  Text,
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx - About 6 hrs to fix

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

const connectRoom = (xmpp, address, roomJID, connectData, welcomeMessage) => {
    let myRoomAddress = roomJID + '/' + connectData.botName;

    console.log('=> Connecting to the room: ', roomJID);

Severity: Major
Found in bots/raffle/actions.js and 3 other locations - About 6 hrs to fix
bots/autoResponder/actions.js on lines 104..125
bots/botTemplate/actions.js on lines 104..125
bots/translateBot/actions.js on lines 104..125

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

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 connectRoom = (xmpp, address, roomJID, connectData, welcomeMessage) => {
    let myRoomAddress = roomJID + '/' + connectData.botName;

    console.log('=> Connecting to the room: ', roomJID);

Severity: Major
Found in bots/translateBot/actions.js and 3 other locations - About 6 hrs to fix
bots/autoResponder/actions.js on lines 104..125
bots/botTemplate/actions.js on lines 104..125
bots/raffle/actions.js on lines 104..125

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

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 connectRoom = (xmpp, address, roomJID, connectData, welcomeMessage) => {
    let myRoomAddress = roomJID + '/' + connectData.botName;

    console.log('=> Connecting to the room: ', roomJID);

Severity: Major
Found in bots/autoResponder/actions.js and 3 other locations - About 6 hrs to fix
bots/botTemplate/actions.js on lines 104..125
bots/raffle/actions.js on lines 104..125
bots/translateBot/actions.js on lines 104..125

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

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 connectRoom = (xmpp, address, roomJID, connectData, welcomeMessage) => {
    let myRoomAddress = roomJID + '/' + connectData.botName;

    console.log('=> Connecting to the room: ', roomJID);

Severity: Major
Found in bots/botTemplate/actions.js and 3 other locations - About 6 hrs to fix
bots/autoResponder/actions.js on lines 104..125
bots/raffle/actions.js on lines 104..125
bots/translateBot/actions.js on lines 104..125

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

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