api/src/__tests__/conversationMutations.test.ts

Summary

Maintainability
F
4 days
Test Coverage

File conversationMutations.test.ts has 963 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as faker from 'faker';
import * as sinon from 'sinon';
import { AUTO_BOT_MESSAGES } from '../data/constants';
import { IntegrationsAPI } from '../data/dataSources';
import utils from '../data/utils';
Severity: Major
Found in api/src/__tests__/conversationMutations.test.ts - About 2 days to fix

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

        try {
          await graphqlRequest(
            mutation,
            'conversationCreateVideoChatRoom',
            { _id: conversation._id },
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 2 other locations - About 1 hr to fix
    api/src/__tests__/conversationQueries.test.ts on lines 405..416
    api/src/__tests__/conversationQueries.test.ts on lines 418..429

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

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

          await graphqlRequest(
            conversationConvertToCardMutation,
            'conversationConvertToCard',
            {
              _id: conversation._id,
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 1 other location - About 1 hr to fix
    api/src/__tests__/conversationMutations.test.ts on lines 1100..1112

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

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

        const itemId = await graphqlRequest(
          conversationConvertToCardMutation,
          'conversationConvertToCard',
          {
            _id: conversation._id,
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 1 other location - About 1 hr to fix
    api/src/__tests__/conversationMutations.test.ts on lines 1065..1077

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

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

        try {
          await graphqlRequest(
            mutation,
            'conversationsSaveVideoRecordingInfo',
            args,
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 2 other locations - About 55 mins to fix
    api/src/__tests__/boardMutations.test.ts on lines 143..147
    api/src/__tests__/integrationMutations.test.ts on lines 394..403

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

    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 mock = sinon
          .stub(dataSources.IntegrationsAPI, 'saveDailyRecordingInfo')
          .callsFake(() => {
            return Promise.resolve({ status: 'ok' });
          });
    Severity: Minor
    Found in api/src/__tests__/conversationMutations.test.ts and 1 other location - About 45 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 797..801

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

    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 mock = sinon
          .stub(dataSources.IntegrationsAPI, 'createDailyVideoChatRoom')
          .callsFake(() => {
            return Promise.resolve({ status: 'ongoing' });
          });
    Severity: Minor
    Found in api/src/__tests__/conversationMutations.test.ts and 1 other location - About 45 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 838..842

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

    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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Minor
    Found in api/src/__tests__/conversationMutations.test.ts and 1 other location - About 35 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 397..403

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

    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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Minor
    Found in api/src/__tests__/conversationMutations.test.ts and 1 other location - About 35 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 408..414

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

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

        try {
          await graphqlRequest(
            mutation,
            'conversationsChangeStatusFacebookComment',
            args,
    Severity: Minor
    Found in api/src/__tests__/conversationMutations.test.ts and 2 other locations - About 35 mins to fix
    api/src/__tests__/calendarMutations.test.ts on lines 122..126
    api/src/__tests__/conversationMutations.test.ts on lines 514..525

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

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

        try {
          await graphqlRequest(
            commentMutation,
            'conversationsReplyFacebookComment',
            args,
    Severity: Minor
    Found in api/src/__tests__/conversationMutations.test.ts and 2 other locations - About 35 mins to fix
    api/src/__tests__/calendarMutations.test.ts on lines 122..126
    api/src/__tests__/conversationMutations.test.ts on lines 570..581

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 316..322
    api/src/__tests__/conversationMutations.test.ts on lines 337..343
    api/src/__tests__/conversationMutations.test.ts on lines 347..353
    api/src/__tests__/conversationMutations.test.ts on lines 357..363
    api/src/__tests__/conversationMutations.test.ts on lines 367..373
    api/src/__tests__/conversationMutations.test.ts on lines 377..383
    api/src/__tests__/conversationMutations.test.ts on lines 387..393
    api/src/__tests__/conversationMutations.test.ts on lines 435..441
    api/src/__tests__/conversationMutations.test.ts on lines 456..462
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 316..322
    api/src/__tests__/conversationMutations.test.ts on lines 327..333
    api/src/__tests__/conversationMutations.test.ts on lines 347..353
    api/src/__tests__/conversationMutations.test.ts on lines 357..363
    api/src/__tests__/conversationMutations.test.ts on lines 367..373
    api/src/__tests__/conversationMutations.test.ts on lines 377..383
    api/src/__tests__/conversationMutations.test.ts on lines 387..393
    api/src/__tests__/conversationMutations.test.ts on lines 435..441
    api/src/__tests__/conversationMutations.test.ts on lines 456..462
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 316..322
    api/src/__tests__/conversationMutations.test.ts on lines 327..333
    api/src/__tests__/conversationMutations.test.ts on lines 337..343
    api/src/__tests__/conversationMutations.test.ts on lines 347..353
    api/src/__tests__/conversationMutations.test.ts on lines 357..363
    api/src/__tests__/conversationMutations.test.ts on lines 377..383
    api/src/__tests__/conversationMutations.test.ts on lines 387..393
    api/src/__tests__/conversationMutations.test.ts on lines 435..441
    api/src/__tests__/conversationMutations.test.ts on lines 456..462
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 316..322
    api/src/__tests__/conversationMutations.test.ts on lines 327..333
    api/src/__tests__/conversationMutations.test.ts on lines 337..343
    api/src/__tests__/conversationMutations.test.ts on lines 347..353
    api/src/__tests__/conversationMutations.test.ts on lines 357..363
    api/src/__tests__/conversationMutations.test.ts on lines 367..373
    api/src/__tests__/conversationMutations.test.ts on lines 377..383
    api/src/__tests__/conversationMutations.test.ts on lines 387..393
    api/src/__tests__/conversationMutations.test.ts on lines 435..441
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 316..322
    api/src/__tests__/conversationMutations.test.ts on lines 327..333
    api/src/__tests__/conversationMutations.test.ts on lines 337..343
    api/src/__tests__/conversationMutations.test.ts on lines 347..353
    api/src/__tests__/conversationMutations.test.ts on lines 357..363
    api/src/__tests__/conversationMutations.test.ts on lines 367..373
    api/src/__tests__/conversationMutations.test.ts on lines 387..393
    api/src/__tests__/conversationMutations.test.ts on lines 435..441
    api/src/__tests__/conversationMutations.test.ts on lines 456..462
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 316..322
    api/src/__tests__/conversationMutations.test.ts on lines 327..333
    api/src/__tests__/conversationMutations.test.ts on lines 337..343
    api/src/__tests__/conversationMutations.test.ts on lines 347..353
    api/src/__tests__/conversationMutations.test.ts on lines 357..363
    api/src/__tests__/conversationMutations.test.ts on lines 367..373
    api/src/__tests__/conversationMutations.test.ts on lines 377..383
    api/src/__tests__/conversationMutations.test.ts on lines 435..441
    api/src/__tests__/conversationMutations.test.ts on lines 456..462
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 327..333
    api/src/__tests__/conversationMutations.test.ts on lines 337..343
    api/src/__tests__/conversationMutations.test.ts on lines 347..353
    api/src/__tests__/conversationMutations.test.ts on lines 357..363
    api/src/__tests__/conversationMutations.test.ts on lines 367..373
    api/src/__tests__/conversationMutations.test.ts on lines 377..383
    api/src/__tests__/conversationMutations.test.ts on lines 387..393
    api/src/__tests__/conversationMutations.test.ts on lines 435..441
    api/src/__tests__/conversationMutations.test.ts on lines 456..462
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 316..322
    api/src/__tests__/conversationMutations.test.ts on lines 327..333
    api/src/__tests__/conversationMutations.test.ts on lines 337..343
    api/src/__tests__/conversationMutations.test.ts on lines 347..353
    api/src/__tests__/conversationMutations.test.ts on lines 367..373
    api/src/__tests__/conversationMutations.test.ts on lines 377..383
    api/src/__tests__/conversationMutations.test.ts on lines 387..393
    api/src/__tests__/conversationMutations.test.ts on lines 435..441
    api/src/__tests__/conversationMutations.test.ts on lines 456..462
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 316..322
    api/src/__tests__/conversationMutations.test.ts on lines 327..333
    api/src/__tests__/conversationMutations.test.ts on lines 337..343
    api/src/__tests__/conversationMutations.test.ts on lines 357..363
    api/src/__tests__/conversationMutations.test.ts on lines 367..373
    api/src/__tests__/conversationMutations.test.ts on lines 377..383
    api/src/__tests__/conversationMutations.test.ts on lines 387..393
    api/src/__tests__/conversationMutations.test.ts on lines 435..441
    api/src/__tests__/conversationMutations.test.ts on lines 456..462
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

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

        try {
          await graphqlRequest(addMutation, 'conversationMessageAdd', args, {
            dataSources
          });
        } catch (e) {
    Severity: Major
    Found in api/src/__tests__/conversationMutations.test.ts and 10 other locations - About 30 mins to fix
    api/src/__tests__/conversationMutations.test.ts on lines 316..322
    api/src/__tests__/conversationMutations.test.ts on lines 327..333
    api/src/__tests__/conversationMutations.test.ts on lines 337..343
    api/src/__tests__/conversationMutations.test.ts on lines 347..353
    api/src/__tests__/conversationMutations.test.ts on lines 357..363
    api/src/__tests__/conversationMutations.test.ts on lines 367..373
    api/src/__tests__/conversationMutations.test.ts on lines 377..383
    api/src/__tests__/conversationMutations.test.ts on lines 387..393
    api/src/__tests__/conversationMutations.test.ts on lines 456..462
    api/src/__tests__/integrationMutations.test.ts on lines 907..913

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

    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

    There are no issues that match your filters.

    Category
    Status