dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

const messages = () => {
    return {
        general: {
            welcomeMessage: '',
            youHaveQuestions: 'You have an unfinished in-take form to complete.',
Severity: Major
Found in bots/merchantBot/config/messages.js - About 6 hrs to fix

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

      <View>
        <Text style={styles.title}>Memo</Text>
        <Text>
          Add an optional note so that you remember who you shared this with.
        </Text>
Severity: Major
Found in client-reactnative/src/Screens/Privacy/ProfileShareAdd.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/Screens/Privacy/DocumentShareAdd.tsx on lines 152..171

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

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>
        <Text style={styles.title}>Memo</Text>
        <Text>
          Add an optional note so that you remember who you shared this with.
        </Text>
Severity: Major
Found in client-reactnative/src/Screens/Privacy/DocumentShareAdd.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/Screens/Privacy/ProfileShareAdd.tsx on lines 104..123

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

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 main has a Cognitive Complexity of 40 (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/createBot/src/index.create.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

      <ParsedText
        style={[
          styles[props.position].text,
          props.textStyle && props.textStyle[props.position],
          props.customTextStyle,
Severity: Major
Found in client-reactnative/src/components/Chat/MessageText.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/components/Chat/MessageText.tsx on lines 136..150

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

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

        <ParsedText
          style={[
            styles[props.position].text,
            props.textStyle && props.textStyle[props.position],
            props.customTextStyle,
Severity: Major
Found in client-reactnative/src/components/Chat/MessageText.tsx and 1 other location - About 6 hrs to fix
client-reactnative/src/components/Chat/MessageText.tsx on lines 338..352

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

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

const UploadDocument: React.FC<IUploadDocument> = ({}) => {
  const [loading, setLoading] = useState(false);
  const fileRef = useRef<HTMLInputElement>(null);
  const { showSnackbar } = useSnackbar();
  const [uploadedFile, setUploadedFile] = useState({
Severity: Major
Found in client-web/src/pages/UploadDocument/UploadDocument.tsx - About 6 hrs to fix

File OtherUserProfileScreen.tsx has 414 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/Profile/OtherUserProfileScreen.tsx - About 5 hrs to fix

Function CreateApp has 148 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function CreateApp() {
  const [loading, setLoading] = React.useState(false);
  const fileRef = React.useRef<HTMLInputElement>(null);

  const formik = useFormik({
Severity: Major
Found in client-web/src/pages/CreateApp/index.tsx - About 5 hrs to fix

Function ChatDetailsScreen has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

const ChatDetailsScreen = observer(({route}: any) => {
  const {chatStore, loginStore, apiStore} = useStores();
  const currentRoomDetail = chatStore.getRoomDetails(
    route.params.roomJID,
  ) as roomListProps;
Severity: Minor
Found in client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx - About 5 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 AccountScreen has 147 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AccountScreen = observer(() => {
  const {loginStore, accountStore} = useStores();

  const {userAvatar, initialData, userDescription, userToken} = loginStore;

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

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

        <VStack>
          <Text style={styles.linkName}>{item.memo}</Text>
          <Text style={styles.linkDate}>
            Created at: {moment(item.createdAt).format('MMMM DD YYYY, hh:mm')}
          </Text>
client-reactnative/src/Screens/Privacy/ProfileShareManage.tsx on lines 93..104

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

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

        <VStack>
          <Text style={styles.linkName}>{item.memo}</Text>
          <Text style={styles.linkDate}>
            Created at: {moment(item.createdAt).format('MMMM DD YYYY, hh:mm')}
          </Text>
client-reactnative/src/Screens/Privacy/DocumentShareManage.tsx on lines 87..98

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

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

const NewChat: React.FC<INewChat> = ({}) => {
  const theme = useTheme();
  const user = useStoreState((state) => state.user);
  const { showSnackbar } = useSnackbar();
  const [loading, setLoading] = useState(false);
Severity: Major
Found in client-web/src/pages/NewChat/NewChat.tsx - About 5 hrs to fix

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

const generateMessage = (data, message, isSystemMessage) => {
    let userName;
    let finalMessage;

    //Getting username
Severity: Major
Found in bots/translateBot/actions.js and 3 other locations - About 5 hrs to fix
bots/autoResponder/actions.js on lines 61..86
bots/botTemplate/actions.js on lines 61..86
bots/gptBot/actions.js on lines 61..86

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

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 generateMessage = (data, message, isSystemMessage) => {
    let userName;
    let finalMessage;

    //Getting username
Severity: Major
Found in bots/botTemplate/actions.js and 3 other locations - About 5 hrs to fix
bots/autoResponder/actions.js on lines 61..86
bots/gptBot/actions.js on lines 61..86
bots/translateBot/actions.js on lines 61..86

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

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 generateMessage = (data, message, isSystemMessage) => {
    let userName;
    let finalMessage;

    //Getting username
Severity: Major
Found in bots/gptBot/actions.js and 3 other locations - About 5 hrs to fix
bots/autoResponder/actions.js on lines 61..86
bots/botTemplate/actions.js on lines 61..86
bots/translateBot/actions.js on lines 61..86

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

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 generateMessage = (data, message, isSystemMessage) => {
    let userName;
    let finalMessage;

    //Getting username
Severity: Major
Found in bots/autoResponder/actions.js and 3 other locations - About 5 hrs to fix
bots/botTemplate/actions.js on lines 61..86
bots/gptBot/actions.js on lines 61..86
bots/translateBot/actions.js on lines 61..86

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

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

      <View style={{marginTop: 10}}>
        {loading && (
          <ActivityIndicator size={40} color={commonColors.primaryDarkColor} />
        )}
        {sharedLinks.length ? (
client-reactnative/src/Screens/Privacy/DocumentShareManage.tsx on lines 147..164

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

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

      <View style={{marginTop: 10}}>
        {loading && (
          <ActivityIndicator size={40} color={commonColors.primaryDarkColor} />
        )}
        {sharedLinks.length ? (
client-reactnative/src/Screens/Privacy/ProfileShareManage.tsx on lines 151..168

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

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