dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Avoid too many return statements within this function.
Open

            return helpHandler(handlerData);
Severity: Major
Found in bots/questionnaire/router.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return helpHandler(handlerData);
Severity: Major
Found in bots/autoResponder/router.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return searchItemsHandler(handlerData)
Severity: Major
Found in bots/huthut/router.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return sendMessage(
                handlerData,
                messages.exampleBotMessage.tnxForTransaction,
                'message',
                false,
Severity: Major
Found in bots/autoResponder/router.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return
Severity: Major
Found in bots/createBot/src/index.create.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return
Severity: Major
Found in bots/createBot/src/index.create.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return;
Severity: Major
Found in bots/exportToUSDC/src/index.exportToUSDC.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return;
Severity: Major
Found in bots/exportToUSDC/src/index.exportToUSDC.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return;
Severity: Major
Found in client-reactnative/src/helpers/chat/inputUtils.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return (
        <PdfMessage
          url={preview || pdfImage}
          size={size}
          onPress={() => onMediaMessagePress(mimetype, image, mediaProps)}
Severity: Major
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return (
      <ParsedText
        style={[
          styles[props.position].text,
          props.textStyle && props.textStyle[props.position],
Severity: Major
Found in client-reactnative/src/components/Chat/MessageText.tsx - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return (
        <FileMessage
          url={image as string}
          size={size as string}
          onPress={() => downloadFile(image as string, originalName as string)}
Severity: Major
Found in client-reactnative/src/components/Chat/ChatContainer.tsx - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return (
        <FileMessage
          url={image}
          size={size}
          onPress={() => downloadFile(image, originalName)}
Severity: Major
Found in client-reactnative/src/Screens/Chat/ChatExperimental.tsx - About 30 mins to fix

Function getRandomNFT has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const getRandomNFT = (itemsList) => {
    if (itemsList.success && itemsList.balance.length > 0) {
        const filteredItems = itemsList.balance.filter(item => item.tokenType === 'NFT' && item.balance > 0);
        if (filteredItems.length <= 0) {
            return [];
Severity: Minor
Found in bots/raffle/handlers/helpers/getRandomNFT.js - About 25 mins 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 messagingTimeout has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const messagingTimeout = (data, timeToAdd) => {
    console.log("START TIMEOUT ", timeToAdd)
    const timeData = timeToAdd.split(":");
    const addedTime = addingTime(data, timeData);

Severity: Minor
Found in bots/raffle/handlers/helpers/messagingTimeout.js - About 25 mins 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 xmppSender has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const xmppSender = (data, message, type, isSystemMessage, tokenAmount, buttons) => {
    sendTyping(data.xmpp, data.connectData, data.roomJID, 'pausedComposing').then(() => {
        data.xmpp.send(xml('message', {
            to: data.roomJID,
            type: data.receiverData ? 'groupchat' : type,
Severity: Minor
Found in bots/gptBot/actions.js - About 25 mins 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 xmppSender has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const xmppSender = (data, message, type, isSystemMessage, tokenAmount, buttons) => {
    sendTyping(data.xmpp, data.connectData, data.roomJID, 'pausedComposing').then(() => {
        data.xmpp.send(xml('message', {
            to: data.roomJID,
            type: data.receiverData ? 'groupchat' : type,
Severity: Minor
Found in bots/translateBot/actions.js - About 25 mins 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 getWritingTime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const getWritingTime = (message) => {
    if (message.length <= 120) {
        return 2000
    }
    if (message.length <= 250 && message.length > 120) {
Severity: Minor
Found in bots/merchantBot/actions.js - About 25 mins 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 xmppSender has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const xmppSender = (data, message, type, isSystemMessage, tokenAmount, buttons) => {
    sendTyping(data.xmpp, data.connectData, data.roomJID, 'pausedComposing').then(() => {
        data.xmpp.send(xml('message', {
            to: data.roomJID,
            type: data.receiverData ? 'groupchat' : type,
Severity: Minor
Found in bots/botTemplate/actions.js - About 25 mins 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 xmppSender has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const xmppSender = (data, message, type, isSystemMessage, tokenAmount, buttons, noName) => {
    sendTyping(data.xmpp, data.connectData, data.roomJID, 'pausedComposing').then(() => {
        data.xmpp.send(xml('message', {
            to: data.roomJID,
            type: data.receiverData ? 'groupchat' : type,
Severity: Minor
Found in bots/raffle/actions.js - About 25 mins 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