dappros/ethora

View on GitHub

Showing 8,855 of 8,855 total issues

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

http.interceptors.response.use(undefined, error => {
    if (!error.response || error.response.status !== 401) {
        return Promise.reject(error)
    }

Severity: Major
Found in bots/gptBot/api.js and 5 other locations - About 1 day to fix
bots/autoResponder/api.js on lines 43..66
bots/botTemplate/api.js on lines 43..66
bots/merchantBot/api.js on lines 43..66
bots/raffle/api.js on lines 43..66
bots/translateBot/api.js on lines 43..66

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

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

http.interceptors.response.use(undefined, error => {
    if (!error.response || error.response.status !== 401) {
        return Promise.reject(error)
    }

Severity: Major
Found in bots/raffle/api.js and 5 other locations - About 1 day to fix
bots/autoResponder/api.js on lines 43..66
bots/botTemplate/api.js on lines 43..66
bots/gptBot/api.js on lines 43..66
bots/merchantBot/api.js on lines 43..66
bots/translateBot/api.js on lines 43..66

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

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

http.interceptors.response.use(undefined, error => {
    if (!error.response || error.response.status !== 401) {
        return Promise.reject(error)
    }

Severity: Major
Found in bots/botTemplate/api.js and 5 other locations - About 1 day to fix
bots/autoResponder/api.js on lines 43..66
bots/gptBot/api.js on lines 43..66
bots/merchantBot/api.js on lines 43..66
bots/raffle/api.js on lines 43..66
bots/translateBot/api.js on lines 43..66

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

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

http.interceptors.response.use(undefined, error => {
    if (!error.response || error.response.status !== 401) {
        return Promise.reject(error)
    }

Severity: Major
Found in bots/merchantBot/api.js and 5 other locations - About 1 day to fix
bots/autoResponder/api.js on lines 43..66
bots/botTemplate/api.js on lines 43..66
bots/gptBot/api.js on lines 43..66
bots/raffle/api.js on lines 43..66
bots/translateBot/api.js on lines 43..66

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

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

http.interceptors.response.use(undefined, error => {
    if (!error.response || error.response.status !== 401) {
        return Promise.reject(error)
    }

Severity: Major
Found in bots/autoResponder/api.js and 5 other locations - About 1 day to fix
bots/botTemplate/api.js on lines 43..66
bots/gptBot/api.js on lines 43..66
bots/merchantBot/api.js on lines 43..66
bots/raffle/api.js on lines 43..66
bots/translateBot/api.js on lines 43..66

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

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

http.interceptors.response.use(undefined, error => {
    if (!error.response || error.response.status !== 401) {
        return Promise.reject(error)
    }

Severity: Major
Found in bots/translateBot/api.js and 5 other locations - About 1 day to fix
bots/autoResponder/api.js on lines 43..66
bots/botTemplate/api.js on lines 43..66
bots/gptBot/api.js on lines 43..66
bots/merchantBot/api.js on lines 43..66
bots/raffle/api.js on lines 43..66

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

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

http.interceptors.response.use(undefined, (error) => {
  if (!error.response || error.response.status !== 401) {
    return Promise.reject(error);
  }

Severity: Major
Found in bots/exportToUSDC/src/api.ts and 1 other location - About 1 day to fix
bots/createBot/src/api.ts on lines 59..80

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

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

http.interceptors.response.use(undefined, (error) => {
  if (!error.response || error.response.status !== 401) {
    return Promise.reject(error)
  }

Severity: Major
Found in bots/createBot/src/api.ts and 1 other location - About 1 day to fix
bots/exportToUSDC/src/api.ts on lines 76..97

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

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

let botOptions = {
    botData: {
        firstName: process.env.FIRST_NAME ? process.env.FIRST_NAME : process.env.APP_USERNAME,
        lastName: process.env.LAST_NAME ? process.env.LAST_NAME : 'Bot',
        photoURL: process.env.PHOTO_URL ? process.env.PHOTO_URL : 'https://ethora.com/resources/assets/wikiethora.png',
Severity: Major
Found in bots/translateBot/config/config.js and 4 other locations - About 1 day to fix
bots/autoResponder/config/config.js on lines 1..12
bots/botTemplate/config/config.js on lines 1..12
bots/gptBot/config/config.js on lines 1..12
bots/raffle/config/config.js on lines 1..12

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

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

let botOptions = {
    botData: {
        firstName: process.env.FIRST_NAME ? process.env.FIRST_NAME : process.env.APP_USERNAME,
        lastName: process.env.LAST_NAME ? process.env.LAST_NAME : 'Bot',
        photoURL: process.env.PHOTO_URL ? process.env.PHOTO_URL : 'https://ethora.com/resources/assets/wikiethora.png',
Severity: Major
Found in bots/gptBot/config/config.js and 4 other locations - About 1 day to fix
bots/autoResponder/config/config.js on lines 1..12
bots/botTemplate/config/config.js on lines 1..12
bots/raffle/config/config.js on lines 1..12
bots/translateBot/config/config.js on lines 1..12

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

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

let botOptions = {
    botData: {
        firstName: process.env.FIRST_NAME ? process.env.FIRST_NAME : process.env.APP_USERNAME,
        lastName: process.env.LAST_NAME ? process.env.LAST_NAME : 'Bot',
        photoURL: process.env.PHOTO_URL ? process.env.PHOTO_URL : 'https://ethora.com/resources/assets/wikiethora.png',
Severity: Major
Found in bots/botTemplate/config/config.js and 4 other locations - About 1 day to fix
bots/autoResponder/config/config.js on lines 1..12
bots/gptBot/config/config.js on lines 1..12
bots/raffle/config/config.js on lines 1..12
bots/translateBot/config/config.js on lines 1..12

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

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

let botOptions = {
    botData: {
        firstName: process.env.FIRST_NAME ? process.env.FIRST_NAME : process.env.APP_USERNAME,
        lastName: process.env.LAST_NAME ? process.env.LAST_NAME : 'Bot',
        photoURL: process.env.PHOTO_URL ? process.env.PHOTO_URL : 'https://ethora.com/resources/assets/wikiethora.png',
Severity: Major
Found in bots/autoResponder/config/config.js and 4 other locations - About 1 day to fix
bots/botTemplate/config/config.js on lines 1..12
bots/gptBot/config/config.js on lines 1..12
bots/raffle/config/config.js on lines 1..12
bots/translateBot/config/config.js on lines 1..12

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

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

let botOptions = {
    botData: {
        firstName: process.env.FIRST_NAME ? process.env.FIRST_NAME : process.env.APP_USERNAME,
        lastName: process.env.LAST_NAME ? process.env.LAST_NAME : 'Bot',
        photoURL: process.env.PHOTO_URL ? process.env.PHOTO_URL : 'https://ethora.com/resources/assets/wikiethora.png',
Severity: Major
Found in bots/raffle/config/config.js and 4 other locations - About 1 day to fix
bots/autoResponder/config/config.js on lines 1..12
bots/botTemplate/config/config.js on lines 1..12
bots/gptBot/config/config.js on lines 1..12
bots/translateBot/config/config.js on lines 1..12

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

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 mainMessage: IMainMessage = {
            text: parsedMessage.text || '',
            id: parsedMessage?.id,
            userName: parsedMessage.userName || '',
            createdAt: parsedMessage.createdAt,
Severity: Major
Found in client-reactnative/src/helpers/chat/createMessageObject.ts and 1 other location - About 7 hrs to fix
client-web/src/utils/createMessage.ts on lines 43..62

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

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 mainMessage: IMainMessage = {
        text: parsedMessage.text || "",
        id: parsedMessage?.id,
        userName: parsedMessage.userName || "",
        createdAt: parsedMessage.createdAt,
Severity: Major
Found in client-web/src/utils/createMessage.ts and 1 other location - About 7 hrs to fix
client-reactnative/src/helpers/chat/createMessageObject.ts on lines 176..195

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

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 connectingToNewRoom = (xmpp, roomJID, connectData) => {
    console.log('=> Received an invitation to join the chat room', roomJID)
    getOneRoom(roomJID).then(result => {
        if (!result) {
            saveRoomData(roomJID).then(() => {
Severity: Major
Found in bots/merchantBot/config/connect.js and 5 other locations - About 7 hrs to fix
bots/autoResponder/config/connect.js on lines 64..86
bots/botTemplate/config/connect.js on lines 66..88
bots/gptBot/config/connect.js on lines 64..86
bots/raffle/config/connect.js on lines 66..88
bots/translateBot/config/connect.js on lines 66..88

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

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 connectingToNewRoom = (xmpp, roomJID, connectData) => {
    console.log('=> Received an invitation to join the chat room', roomJID)
    getOneRoom(roomJID).then(result => {
        if (!result) {
            saveRoomData(roomJID).then(() => {
Severity: Major
Found in bots/autoResponder/config/connect.js and 5 other locations - About 7 hrs to fix
bots/botTemplate/config/connect.js on lines 66..88
bots/gptBot/config/connect.js on lines 64..86
bots/merchantBot/config/connect.js on lines 59..81
bots/raffle/config/connect.js on lines 66..88
bots/translateBot/config/connect.js on lines 66..88

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

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 connectingToNewRoom = (xmpp, roomJID, connectData) => {
    console.log('=> Received an invitation to join the chat room', roomJID)
    getOneRoom(roomJID).then(result => {
        if (!result) {
            saveRoomData(roomJID).then(() => {
Severity: Major
Found in bots/botTemplate/config/connect.js and 5 other locations - About 7 hrs to fix
bots/autoResponder/config/connect.js on lines 64..86
bots/gptBot/config/connect.js on lines 64..86
bots/merchantBot/config/connect.js on lines 59..81
bots/raffle/config/connect.js on lines 66..88
bots/translateBot/config/connect.js on lines 66..88

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

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 connectingToNewRoom = (xmpp, roomJID, connectData) => {
    console.log('=> Received an invitation to join the chat room', roomJID)
    getOneRoom(roomJID).then(result => {
        if (!result) {
            saveRoomData(roomJID).then(() => {
Severity: Major
Found in bots/translateBot/config/connect.js and 5 other locations - About 7 hrs to fix
bots/autoResponder/config/connect.js on lines 64..86
bots/botTemplate/config/connect.js on lines 66..88
bots/gptBot/config/connect.js on lines 64..86
bots/merchantBot/config/connect.js on lines 59..81
bots/raffle/config/connect.js on lines 66..88

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

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 connectingToNewRoom = (xmpp, roomJID, connectData) => {
    console.log('=> Received an invitation to join the chat room', roomJID)
    getOneRoom(roomJID).then(result => {
        if (!result) {
            saveRoomData(roomJID).then(() => {
Severity: Major
Found in bots/gptBot/config/connect.js and 5 other locations - About 7 hrs to fix
bots/autoResponder/config/connect.js on lines 64..86
bots/botTemplate/config/connect.js on lines 66..88
bots/merchantBot/config/connect.js on lines 59..81
bots/raffle/config/connect.js on lines 66..88
bots/translateBot/config/connect.js on lines 66..88

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

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