dappros/ethora

View on GitHub

Showing 502 of 8,855 total issues

Function fetchOtherUserWalletBalance has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async fetchOtherUserWalletBalance(
    walletAddress: string,
    token: string,
    linkToken?: string,
  ) {
Severity: Minor
Found in client-reactnative/src/stores/walletStore.ts - About 1 hr to fix

Function RightActions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const RightActions = (props: RightActionsProps) => {
  const {jid, leaveChat, swipeRef} = props;
  const jidWithoutConference = jid?.split('@')[0];
  const isDefaultChat = checkIsDefaultChat(jidWithoutConference);
  const {loginStore} = useStores();

Function TransactionsScreen has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const TransactionsScreen = observer(() => {
  const {walletStore, loginStore} = useStores();
  useEffect(() => {
    walletStore.fetchOwnTransactions(
      loginStore.initialData.walletAddress,
Severity: Minor
Found in client-reactnative/src/Screens/Profile/TransactionsScreen.tsx - About 1 hr to fix

Function connectData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const connectData = () => {
    console.log('=> Running a bot on a ' + process.env.TYPE + ' server')
    let data = {
        botName: process.env.BOT_NAME,
        botAddress: process.env.BOT_ADDRESS,
Severity: Minor
Found in bots/huthut/config/connect.js - About 1 hr to fix

Function sendThreadMessage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const sendThreadMessage = (button: any) => {
    if (myThreadMessage.trim().length > 0) {
      let userAvatar = "";
      if (profile?.profileImage) {
        userAvatar = profile?.profileImage;
Severity: Minor
Found in client-web/src/components/Chat/Threads/ThreadContainer.tsx - About 1 hr to fix

Function createPrivateChat has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const createPrivateChat = async (
    myWalletAddress: string,
    otherUserWalletAddress: string,
    myFirstName: string,
    otherFirstName: string,
Severity: Minor
Found in client-web/src/helpers/chat/createPrivateChat.ts - About 1 hr to fix

Function produceNfmtItems has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const produceNfmtItems = (array = []) => {
  const result = [];
  const rareTotal = 20;
  const uniqueTotal = 1;

Severity: Minor
Found in client-web/src/utils/index.ts - About 1 hr to fix

Function onSubmit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    onSubmit: (values) => {
      setDisable(true);
      loginEmail(values.email, values.password)
        .then((resp) => {
          const user = resp.data.user;
Severity: Minor
Found in client-web/src/pages/Signon/EmailSignInForm.tsx - About 1 hr to fix

Function onSubmit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    onSubmit: async (values) => {
      if (!file) {
        setFileError("required");
        return;
      }
Severity: Minor
Found in client-web/src/pages/MintNft/MintNft.tsx - About 1 hr to fix

Function getVcard has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getVcard(username: string) {
    if (username !== this.client.jid?.getLocal()) {
      // get other vcard
      const message = xml(
        "iq",
Severity: Minor
Found in client-web/src/xmpp.ts - About 1 hr to fix

Function getGraph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const getGraph = async () => {
    const sessionGraphResp = await http.httpWithAuth()({
      url: `${baseUrl}/analysis/sessions-graph?startDate=${startDate}&endDate=${endDate}`,
    });
    // /analysis/apis-graph?startDate=${startDate}&endDate=${endDate}
Severity: Minor
Found in client-web/src/pages/Statistics/index.tsx - About 1 hr to fix

Function onGetCollectionPress has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onGetCollectionPress = async () => {
    const bot = defaultBotsList.find(
      defaultBot => defaultBot.name === 'Merchant Bot',
    );
    const {roomJid, roomName} = await createPrivateChat(
Severity: Minor
Found in client-reactnative/src/components/Transactions/NftListItem.tsx - About 1 hr to fix

Function fetchTransaction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async fetchTransaction(
    walletAddress: string,

    limit: number,
    offset: number,
Severity: Minor
Found in client-reactnative/src/stores/walletStore.ts - About 1 hr to fix

Method initializeFlipper has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private static void initializeFlipper(
      Context context, ReactInstanceManager reactInstanceManager) {
    if (BuildConfig.DEBUG) {
      try {
        /*

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

const router = (handlerData) => {
    handlerData.userStep = userSteps('getStep', handlerData.userJID);

    if (messageCheck(handlerData.message, 'close') || messageCheck(handlerData.message, 'leave')) {
        return leaveHandler(handlerData);
Severity: Minor
Found in bots/gptBot/router.js - About 55 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 generateMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

    //Getting username
Severity: Minor
Found in bots/gptBot/actions.js - About 55 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 generateMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

    //Getting username
Severity: Minor
Found in bots/merchantBot/actions.js - About 55 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 generateMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

    //Getting username
Severity: Minor
Found in bots/autoResponder/actions.js - About 55 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 generateMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

    //Getting username
Severity: Minor
Found in bots/translateBot/actions.js - About 55 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 generateMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

    //Getting username
Severity: Minor
Found in bots/botTemplate/actions.js - About 55 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