dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

Function questionHandler has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const questionHandler = (data) => {
    let currentButtonType = userData('getData', data.userJID, null, 'buttonType');

    getQuestionsInGroup(currentButtonType).then(result => {
        console.log('QUESTION LIST IN GROUP ===========> ', result)
Severity: Major
Found in bots/merchantBot/handlers/question.js - About 2 hrs to fix

Function Provenance has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Provenance: React.FC<IProvenance> = ({}) => {
  const location = useLocation<{
    nftItem: TBalance & IDocument;
    walletAddress: string;
  }>();
Severity: Major
Found in client-web/src/pages/Transactions/Provenance.tsx - About 2 hrs to fix

Function handleAppleLogin has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const handleAppleLogin = async (
  defaultToken: string,
  loginUser: any,
  registerSocialUser: any,
  type: string,
Severity: Major
Found in client-reactnative/src/helpers/login/socialLoginHandle.ts - About 2 hrs to fix

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

                <Input
                  testID='firstnameInput'
                  maxLength={15}
                  marginBottom={2}
                  fontFamily={textStyles.lightFont}
Severity: Major
Found in client-reactnative/src/Screens/Login/RegisterScreen.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Login/RegisterScreen.tsx on lines 183..194

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

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

    if (type === 0) {
      if (longTapUser.ban_status === 'clear') {
        banUserr(
          manipulatedWalletAddress,
          longTapUser.jid,
Severity: Major
Found in client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx on lines 241..259

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

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

                <Input
                  testID='lastnameInput'
                  maxLength={15}
                  marginBottom={2}
                  fontFamily={textStyles.lightFont}
Severity: Major
Found in client-reactnative/src/Screens/Login/RegisterScreen.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Login/RegisterScreen.tsx on lines 170..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 85.

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 handleKick = () => {
    if (kickUserItem.ban_status === 'clear') {
      banUserr(
        manipulatedWalletAddress,
        kickUserItem.jid,
Severity: Major
Found in client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx and 1 other location - About 2 hrs to fix
client-reactnative/src/Screens/Chat/ChatDetailsScreen.tsx on lines 199..217

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

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 router has 62 lines of code (exceeds 25 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: Major
Found in bots/huthut/router.js - About 2 hrs to fix

File Users.tsx has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as React from "react";
import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell";
import TableContainer from "@mui/material/TableContainer";
Severity: Minor
Found in client-web/src/pages/Owner/Users.tsx - About 2 hrs to fix

Function OptionsItem has 62 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/AddProfileTabPanel.tsx - About 2 hrs to fix

Function ActionItems has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const ActionItems = (type: ActionItemType) => {
    type TIconName =
      | 'delete'
      | 'edit'
      | 'text-snippet'
Severity: Major
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 2 hrs to fix

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

            <Tabs style={{display:'flex'}} value={tab} onChange={handleChangeTab} aria-label="basic tabs example">
                <Tab label="Manage" {...a11yProps(0)} />
                <Tab label="Add" {...a11yProps(1)} />
            </Tabs>
Severity: Major
Found in client-web/src/pages/Privacy/ProfileShareTab.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Privacy/DocumentsShareTab.tsx on lines 65..73

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

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

  itemNameInput: {
    color: 'black',
    borderWidth: 1,
    borderColor: commonColors.primaryColor,
    borderRadius: 5,
client-reactnative/src/Screens/UploadDocumentsScreen.tsx on lines 475..487

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

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

  itemNameInput: {
    color: 'black',
    borderWidth: 1,
    borderColor: commonColors.primaryColor,
    borderRadius: 5,
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 333..345

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

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

      <Tabs
        style={{ display: "flex" }}
        value={tab}
        onChange={handleChangeTab}
        aria-label="basic tabs example"
Severity: Major
Found in client-web/src/pages/Privacy/DocumentsShareTab.tsx and 1 other location - About 2 hrs to fix
client-web/src/pages/Privacy/ProfileShareTab.tsx on lines 87..90

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

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

export const DocumentsShare = (props: DocumentsShareProps) => {
  const [tab, setTab] = React.useState(0);
  const [openModal, setOpenModal] = React.useState(false);
  const [loading, setLoading] = React.useState(false);
  const [sharedLinks, setSharedLinks] = React.useState<ISharedLink[]>([]);
Severity: Major
Found in client-web/src/pages/Privacy/DocumentsShareTab.tsx - About 2 hrs to fix

Function Dashboard has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Dashboard() {
  const apps = useStoreState((state) => state.apps);
  const [currentAppIndex, setCurrentAppIndex] = useState(0);

  const [blockchain, setBlockchain] = useState<IBlockChain>({
Severity: Major
Found in client-web/src/pages/Dashboard/index.tsx - About 2 hrs to fix

Function RoomsTabBar has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const RoomsTabBar = observer(() => {
  const {chatStore} = useStores();
  const privateRooms = chatStore.roomList?.filter((item: any) => {
    const splitedJid = item?.jid?.split('@')[0];

Severity: Major
Found in client-reactnative/src/components/RoomList/RoomsTabBar.tsx - About 2 hrs to fix

Function EnterInviteCode has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const EnterInviteCode = observer(() => {
  const [code, setCode] = useState('');
  const [loading, setLoading] = useState(false);
  const {loginStore, apiStore} = useStores();

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

Function Message has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const Message: React.FC<IMessage> = ({
  message,
  position,
  onMessageButtonClick,
  toggleTransferDialog,
Severity: Minor
Found in client-web/src/components/Chat/Messages/Message.tsx - About 2 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

Severity
Category
Status
Source
Language