dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

      <HomeStack.Screen
        name={'OtherUserProfileScreen'}
        //@ts-ignore
        component={OtherUserProfileScreen}
        options={() => ({
Severity: Major
Found in client-reactnative/src/navigation/HomeStack.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/navigation/HomeStack.tsx on lines 294..301

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

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

      <HomeStack.Screen
        name={'DocumentHistoryScreen'}
        //@ts-ignore
        component={DocumentHistoryScreen}
        options={() => ({
Severity: Major
Found in client-reactnative/src/navigation/HomeStack.tsx and 1 other location - About 1 hr to fix
client-reactnative/src/navigation/HomeStack.tsx on lines 214..221

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

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

              <NativeSelect
                inputProps={{
                  name: "transferAmount",
                  id: "uncontrolled-native",
                }}
Severity: Major
Found in client-web/src/pages/Profile/TransferItemsModal.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Owner/NewUserModal.tsx on lines 125..141

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

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 message = xml(
    'message',
    {
      from: walletAddress + '@' + DOMAIN,
      to: chat_jid,
Severity: Major
Found in client-reactnative/src/xmpp/stanzas.ts and 1 other location - About 1 hr to fix
client-reactnative/src/xmpp/stanzas.ts on lines 611..622

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

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

        <ListItemAvatar>
          <Avatar
            style={{ backgroundColor: theme.palette.primary.main }}
            src={item.imagePreview}
          />
Severity: Major
Found in client-web/src/pages/Profile/ItemsTable.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Profile/ItemsTable.tsx on lines 77..82

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

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

        <ListItemAvatar>
          <Avatar
            style={{ backgroundColor: theme.palette.primary.main }}
            src={item.nftFileUrl}
          />
Severity: Major
Found in client-web/src/pages/Profile/ItemsTable.tsx and 1 other location - About 1 hr to fix
client-web/src/pages/Profile/ItemsTable.tsx on lines 37..42

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

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

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

export const getOneRoom = async (address) => {
    return await Room.findOne({address: address, bot_name: botOptions.botData.firstName}).exec();
}
Severity: Major
Found in bots/raffle/database/controllers/rooms.js and 5 other locations - About 1 hr to fix
bots/autoResponder/database/controllers/rooms.js on lines 15..17
bots/botTemplate/database/controllers/rooms.js on lines 15..17
bots/gptBot/database/controllers/rooms.js on lines 15..17
bots/merchantBot/controllers/rooms.js on lines 16..18
bots/translateBot/database/controllers/rooms.js on lines 15..17

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

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 6 locations. Consider refactoring.
Open

export const getOneRoom = async (address) => {
    return await Room.findOne({address: address, bot_name: botOptions.botData.firstName}).exec();
}
Severity: Major
Found in bots/gptBot/database/controllers/rooms.js and 5 other locations - About 1 hr to fix
bots/autoResponder/database/controllers/rooms.js on lines 15..17
bots/botTemplate/database/controllers/rooms.js on lines 15..17
bots/merchantBot/controllers/rooms.js on lines 16..18
bots/raffle/database/controllers/rooms.js on lines 15..17
bots/translateBot/database/controllers/rooms.js on lines 15..17

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

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 6 locations. Consider refactoring.
Open

export const getOneRoom = async (address) => {
    return await Room.findOne({address: address, bot_name: botOptions.botData.firstName}).exec();
}
Severity: Major
Found in bots/autoResponder/database/controllers/rooms.js and 5 other locations - About 1 hr to fix
bots/botTemplate/database/controllers/rooms.js on lines 15..17
bots/gptBot/database/controllers/rooms.js on lines 15..17
bots/merchantBot/controllers/rooms.js on lines 16..18
bots/raffle/database/controllers/rooms.js on lines 15..17
bots/translateBot/database/controllers/rooms.js on lines 15..17

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

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 6 locations. Consider refactoring.
Open

export const getOneRoom = async (address) => {
    return await Room.findOne({address: address, bot_name: botOptions.botData.firstName}).exec();
}
Severity: Major
Found in bots/translateBot/database/controllers/rooms.js and 5 other locations - About 1 hr to fix
bots/autoResponder/database/controllers/rooms.js on lines 15..17
bots/botTemplate/database/controllers/rooms.js on lines 15..17
bots/gptBot/database/controllers/rooms.js on lines 15..17
bots/merchantBot/controllers/rooms.js on lines 16..18
bots/raffle/database/controllers/rooms.js on lines 15..17

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

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