dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function ProfileScreen has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

export const ProfileScreen = observer(() => {
  const {loginStore, walletStore, chatStore, apiStore} = useStores();

  const navigation = useNavigation();

Severity: Minor
Found in client-reactnative/src/Screens/Profile/ProfileScreen.tsx - About 3 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 Menu has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const Menu: React.FC<IMenu> = ({}) => {
  const { active, deactivate } = useWeb3React();
  const user = useStoreState((state) => state.user);
  const history = useHistory();
  const ACL = useStoreState((state) => state.ACL);
Severity: Major
Found in client-web/src/components/Menu.tsx - About 3 hrs to fix

Function OptionsItem has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function OptionsItem(props:optionsItemProps){
    const {
    handleChange,
    selectedValue,
    title,
Severity: Major
Found in client-web/src/pages/Privacy/AddDocumentTabPanel.tsx - About 3 hrs to fix

Function modalContent has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const modalContent = () => {
    if (modalType === 'description') {
      return isDescriptionEditable ? (
        <View
          justifyContent="space-evenly"
Severity: Major
Found in client-reactnative/src/components/Modals/Profile/ProfileModal.tsx - About 3 hrs to fix

File NftTransactionItem.tsx has 313 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
Copyright 2019-2022 (c) Dappros Ltd, registered in England & Wales, registration number 11455432. All rights reserved.
You may not use this file except in compliance with the License.
You may obtain a copy of the License at https://github.com/dappros/ethora/blob/main/LICENSE.
Note: linked open-source libraries and components may be subject to their own licenses.
Severity: Minor
Found in client-reactnative/src/components/Transactions/NftTransactionItem.tsx - About 3 hrs to fix

File HomeStack.tsx has 310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {observer} from 'mobx-react-lite';
import React, {useEffect} from 'react';
import {appLinkingUrl} from '../../docs/config';
import {MainHeader} from '../components/MainHeader/MainHeader';
Severity: Minor
Found in client-reactnative/src/navigation/HomeStack.tsx - About 3 hrs to fix

Function ReplyComponent has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const ReplyComponent = () => {
    return (
      <Button
        variant="text"
        style={{
Severity: Major
Found in client-web/src/components/Chat/Messages/Message.tsx - About 3 hrs to fix

Function AppTopNavOwner has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AppTopNavOwner = () => {
  const user = useStoreState((state) => state.user);
  const balances = useStoreState((state) => state.balance);
  const clearOwner = useStoreState((state) => state.clearOwner);
  const [anchorElUser, setAnchorElUser] = React.useState<null | HTMLElement>(
Severity: Major
Found in client-web/src/components/AppTopNavOwner.tsx - About 3 hrs to fix

Function RegularSignIn has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const RegularSignIn: React.FC<IRegularSignIn> = ({}) => {
  const [openEmail, setOpenEmail] = useState(false);
  const [openUsername, setOpenUsername] = useState(false);

  const [ownerRegistration, setOwnerRegistration] = useState(false);
Severity: Major
Found in client-web/src/pages/Signon/RegularSignIn.tsx - About 3 hrs to fix

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

const router = (xmpp, message, sender, receiver, requestType, receiverData, stanzaId, connectData) => {
    if (requestType === 'body') {
        let userStep = userSteps('getStep', receiver, null);

        let handlerData = {
Severity: Minor
Found in bots/questionnaire/router.js - About 3 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 MessageText has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

export const MessageText = observer((props: any) => {
  const [youtubeMetaData, setYoutubeMetaData] = useState({});

  const {loginStore, apiStore, chatStore} = useStores();

Severity: Minor
Found in client-reactnative/src/components/Chat/MessageText.tsx - About 3 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 ChatMediaModal has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  ({open, url, type, onClose, messageData}) => {
    //Mobx stores
    const {chatStore, loginStore, apiStore} = useStores();
    //Mobx stores

Severity: Minor
Found in client-reactnative/src/components/Modals/ChatMediaModal.tsx - About 3 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 renderConnected has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderConnected = () => {
    if (account) {
      return (
        <>
          <View>
Severity: Major
Found in client-reactnative/src/Screens/Account/Authentication.tsx - About 3 hrs to fix

Function renderModalContent has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    const renderModalContent = () => {
      if (isImageMimetype(type)) {
        const modalButtonAction = () => {
          const manipulatedWalletAddress = underscoreManipulation(
            loginStore.initialData.walletAddress,
Severity: Major
Found in client-reactnative/src/components/Modals/ChatMediaModal.tsx - About 3 hrs to fix

Function UploadDocumentsScreen has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

const UploadDocumentsScreen = () => {
  const {loginStore, walletStore, debugStore} = useStores();

  const [itemName, setItemName] = useState<string>('');
  // data api
Severity: Minor
Found in client-reactnative/src/Screens/Actions/UploadDocumentsScreen.tsx - About 3 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 renderMedia has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderMedia = (props: any) => {
    const {
      image,
      realImageURL,
      mimetype,
Severity: Major
Found in client-reactnative/src/Screens/Chat/ChatExperimental.tsx - About 3 hrs to fix

Consider simplifying this complex logical expression.
Open

    if (item.name === 'data') {
      message.user.name =
        item.attrs.senderFirstName + ' ' + item.attrs.senderLastName;
      message.user._id = item.attrs.senderJID;
      const isSystem = item.attrs.isSystemMessage === 'true';
Severity: Critical
Found in client-reactnative/src/helpers/chat/createMessageObject.ts - About 3 hrs to fix

Function router has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const router = (xmpp, message, roomJID, userJID, receiverData, receiverMessageId, connectData) => {
    let userStep = userSteps('getStep', receiverData.attrs.senderJID, null);
    let currentButtonType = userData('getData', userJID, null);

    let handlerData = {
Severity: Major
Found in bots/merchantBot/router.js - About 2 hrs to fix

Function OtherProfile has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function OtherProfile(props: TProps) {
  const [loading, setLoading] = useState(true);
  const [profile, setProfile] = useState<TProfile>();
  const [transactions, setTransactions] =
    useState<ExplorerRespose<ITransaction[]>>();
Severity: Major
Found in client-web/src/pages/Profile/OtherProfile.tsx - About 2 hrs to fix

File index.tsx has 289 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import DiamondIcon from "@mui/icons-material/Diamond";
import FacebookIcon from "@mui/icons-material/Facebook";
import GoogleIcon from "@mui/icons-material/Google";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
Severity: Minor
Found in client-web/src/pages/Signon/index.tsx - About 2 hrs to fix
Severity
Category
Status
Source
Language