dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

File inputUtils.ts has 374 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {diffChars} from 'diff';
import {StyleProp, TextStyle} from 'react-native';
// @ts-ignore the lib do not have TS declarations yet
import matchAll from 'string.prototype.matchall';
import {
Severity: Minor
Found in client-reactnative/src/helpers/chat/inputUtils.ts - About 5 hrs to fix

Function onEnd has 124 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export async function onEnd(
  p: Participant,
  client: Client,
  walletAddress: string
) {
Severity: Major
Found in bots/createBot/src/questions.create.ts - About 4 hrs to fix

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

          <TouchableOpacity
            disabled={loading}
            onPress={onUploadClick}
            accessibilityLabel={'Create document'}
            style={classes.createButton}>
Severity: Major
Found in client-reactnative/src/Screens/UploadDocumentsScreen.tsx and 1 other location - About 4 hrs to fix
client-reactnative/src/Screens/MintScreen.tsx on lines 331..351

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

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

          <TouchableOpacity
            disabled={loading}
            onPress={onMintClick}
            accessibilityLabel={'Mint Item'}
            style={classes.createButton}>
Severity: Major
Found in client-reactnative/src/Screens/MintScreen.tsx and 1 other location - About 4 hrs to fix
client-reactnative/src/Screens/UploadDocumentsScreen.tsx on lines 346..366

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

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 _useStore has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

      immer((set, get) => {
        return {
          user: {
            firstName: "",
            lastName: "",
Severity: Minor
Found in client-web/src/store/index.ts - About 4 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 MintScreen.tsx has 371 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, {Fragment, useState} from 'react';
import {
  Text,
  View,
  StyleSheet,
Severity: Minor
Found in client-reactnative/src/Screens/Actions/MintScreen.tsx - About 4 hrs to fix

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

  const onUploadPress = async () => {
    if (isOwnerOrModerator) {
      try {
        const res = await DocumentPicker.pickSingle({
          type: [DocumentPicker.types.images],
client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx on lines 309..326

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

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 onImagePress = async () => {
    if (isOwnerOrModerator) {
      try {
        const res = await DocumentPicker.pickSingle({
          type: [DocumentPicker.types.images],
Severity: Major
Found in client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx and 1 other location - About 4 hrs to fix
client-reactnative/src/Screens/Chat/ChangeBackgroundScreen.tsx on lines 111..128

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

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

export const ProfileShareAdd: React.FC<IProfileShareAdd> = ({}) => {
  const [memo, setMemo] = useState('');
  const [expiration, setExpiration] = useState('-1');
  const [createdLink, setCreatedLink] = useState<ISharedLink>({
    _id: '',
Severity: Major
Found in client-reactnative/src/Screens/Privacy/ProfileShareAdd.tsx - About 4 hrs to fix

Function ChatDetailMemebersList has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ChatDetailMemebersList:React.FC<ChatDetailMemebersListProps> = (props: ChatDetailMemebersListProps) => {

    //component props
    const {
        handleMemberLongTap,

Function BasicTable has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function BasicTable() {
  const apps = useStoreState((state) => state.apps)
  const [open, setOpen] = React.useState(false)
  const [showDelete, setShowDelete] = React.useState(false)
  const [showEdit, setShowEdit] = React.useState(false)
Severity: Major
Found in client-web/src/pages/Owner/Apps.tsx - About 4 hrs to fix

Function ManageData has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ManageData = (props: ManageDataProps) => {
  const [deleteDialogOpen, setDeleteDialogOpen] = React.useState(false);
  const [loading, setLoading] = React.useState(false);
  const { showSnackbar } = useSnackbar();
  const clearUser = useStoreState((state) => state.clearUser);
Severity: Major
Found in client-web/src/pages/Privacy/ManageData.tsx - About 4 hrs to fix

Function ChatDetailHeader has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ChatDetailHeader: React.FunctionComponent<ChatDetailHeaderProps> = (
  props: ChatDetailHeaderProps,
) => {
  //component props
  const {deleteRoomDialog, toggleFavourite, currentRoomDetail} = props;

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

export const botLogin = async (username, password) => {
    try {
        const request = await http.post('users/login', {
            username: username,
            password: password
Severity: Major
Found in bots/autoResponder/api.js and 5 other locations - About 4 hrs to fix
bots/botTemplate/api.js on lines 10..27
bots/gptBot/api.js on lines 10..27
bots/merchantBot/api.js on lines 10..27
bots/raffle/api.js on lines 10..27
bots/translateBot/api.js on lines 10..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 131.

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

export const botLogin = async (username, password) => {
    try {
        const request = await http.post('users/login', {
            username: username,
            password: password
Severity: Major
Found in bots/raffle/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 10..27
bots/botTemplate/api.js on lines 10..27
bots/gptBot/api.js on lines 10..27
bots/merchantBot/api.js on lines 10..27
bots/translateBot/api.js on lines 10..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 131.

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

export const botLogin = async (username, password) => {
    try {
        const request = await http.post('users/login', {
            username: username,
            password: password
Severity: Major
Found in bots/gptBot/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 10..27
bots/botTemplate/api.js on lines 10..27
bots/merchantBot/api.js on lines 10..27
bots/raffle/api.js on lines 10..27
bots/translateBot/api.js on lines 10..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 131.

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

export const botLogin = async (username, password) => {
    try {
        const request = await http.post('users/login', {
            username: username,
            password: password
Severity: Major
Found in bots/botTemplate/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 10..27
bots/gptBot/api.js on lines 10..27
bots/merchantBot/api.js on lines 10..27
bots/raffle/api.js on lines 10..27
bots/translateBot/api.js on lines 10..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 131.

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

export const botLogin = async (username, password) => {
    try {
        const request = await http.post('users/login', {
            username: username,
            password: password
Severity: Major
Found in bots/merchantBot/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 10..27
bots/botTemplate/api.js on lines 10..27
bots/gptBot/api.js on lines 10..27
bots/raffle/api.js on lines 10..27
bots/translateBot/api.js on lines 10..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 131.

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

export const botLogin = async (username, password) => {
    try {
        const request = await http.post('users/login', {
            username: username,
            password: password
Severity: Major
Found in bots/translateBot/api.js and 5 other locations - About 4 hrs to fix
bots/autoResponder/api.js on lines 10..27
bots/botTemplate/api.js on lines 10..27
bots/gptBot/api.js on lines 10..27
bots/merchantBot/api.js on lines 10..27
bots/raffle/api.js on lines 10..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 131.

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 renderTabBar = (props: any) => {
  return (
    <TabBar
      renderLabel={({route, focused}) => (
        <Text
Severity: Major
Found in client-reactnative/src/Screens/Privacy/ProfileShare.tsx and 1 other location - About 4 hrs to fix
client-reactnative/src/Screens/Privacy/DocumentShares.tsx on lines 11..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 131.

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