RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx

Summary

Maintainability
F
1 wk
Test Coverage

Function OutgoingWebhookForm has 462 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const OutgoingWebhookForm = () => {
    const t = useTranslation();

    const {
        control,

    File OutgoingWebhookForm.tsx has 515 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import type { IOutgoingIntegration } from '@rocket.chat/core-typings';
    import type { SelectOption } from '@rocket.chat/fuselage';
    import {
        FieldError,
        AccordionItem,

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

                                      <Field>
                                          <FieldRow>
                                              <FieldLabel htmlFor={triggerWordAnywhereField}>{t('Integration_Word_Trigger_Placement')}</FieldLabel>
                                              <Controller
                                                  name='triggerWordAnywhere'
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 445..462
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 507..519

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

      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

                              <Field>
                                  <FieldRow>
                                      <FieldLabel htmlFor={retryFailedCallsField}>{t('Integration_Retry_Failed_Url_Calls')}</FieldLabel>
                                      <Controller
                                          name='retryFailedCalls'
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 489..506
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 507..519

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

      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

                                      <Field>
                                          <FieldRow>
                                              <FieldLabel htmlFor={runOnEditsField}>{t('Integration_Run_When_Message_Is_Edited')}</FieldLabel>
                                              <Controller
                                                  name='runOnEdits'
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 445..462
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 489..506

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

      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

                              <Field>
                                  <FieldLabel htmlFor={scriptEngineField}>{t('Script_Engine')}</FieldLabel>
                                  <FieldRow>
                                      <Controller
                                          name='scriptEngine'
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 133..145

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

      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

                              <Field>
                                  <FieldLabel htmlFor={eventField}>{t('Event_Trigger')}</FieldLabel>
                                  <FieldRow>
                                      <Controller
                                          name='event'
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 399..416

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

      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

                                  <FieldRow>
                                      <Controller
                                          name='username'
                                          control={control}
                                          rules={{ required: t('The_field_is_required', t('Post_as')) }}
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 166..182
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 200..216

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

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

                              <Field>
                                  <FieldLabel htmlFor={nameField}>{t('Name')}</FieldLabel>
                                  <FieldRow>
                                      <Controller
                                          name='name'
      apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 273..283
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 151..161
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 463..473

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

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

                              <Field>
                                  <FieldLabel htmlFor={retryCountField}>{t('Retry_Count')}</FieldLabel>
                                  <FieldRow>
                                      <Controller
                                          name='retryCount'
      apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 273..283
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 151..161
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 156..166

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

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

                              <Field>
                                  <FieldRow>
                                      <FieldLabel htmlFor={impersonateUserField}>{t('Impersonate_user')}</FieldLabel>
                                      <Controller
                                          name='impersonateUser'
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 141..150
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 276..287
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 288..297
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 146..155
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 389..398
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 168..179
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 198..207
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 208..217
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 223..232
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 298..307
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 308..319
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 320..331
      apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx on lines 172..181
      apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx on lines 182..191

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

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

                              <Field>
                                  <FieldRow>
                                      <FieldLabel htmlFor={scriptEnabledField}>{t('Script_Enabled')}</FieldLabel>
                                      <Controller
                                          name='scriptEnabled'
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 141..150
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 276..287
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 288..297
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 146..155
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 265..274
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 168..179
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 198..207
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 208..217
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 223..232
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 298..307
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 308..319
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 320..331
      apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx on lines 172..181
      apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx on lines 182..191

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

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

                              <Field>
                                  <FieldRow>
                                      <FieldLabel htmlFor={enabledField}>{t('Enabled')}</FieldLabel>
                                      <Controller
                                          name='enabled'
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 141..150
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 276..287
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 288..297
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 265..274
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 389..398
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 168..179
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 198..207
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 208..217
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 223..232
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 298..307
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 308..319
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 320..331
      apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx on lines 172..181
      apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx on lines 182..191

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

      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

                                  <FieldRow>
                                      <Controller
                                          name='avatar'
                                          control={control}
                                          render={({ field }) => (
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 344..358

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

      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

                                  <FieldRow>
                                      <Controller
                                          name='emoji'
                                          control={control}
                                          render={({ field }) => (
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 319..338

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

      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

                                      <FieldRow>
                                          <Controller
                                              name='triggerWords'
                                              control={control}
                                              render={({ field }) => (
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 219..227

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

      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

                                      <FieldRow>
                                          <Controller
                                              name='targetRoom'
                                              control={control}
                                              render={({ field }) => (
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 197..209

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

      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

                                  <FieldRow>
                                      <Box fontScale='p2' withRichContent flexGrow={1}>
                                          <pre>
                                              <code dangerouslySetInnerHTML={{ __html: hilightedExampleJson }}></code>
                                          </pre>
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 116..122

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

      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

      type EditOutgoingWebhookPayload = Pick<
          IOutgoingIntegration,
          | 'enabled'
          | 'impersonateUser'
          | 'event'
      apps/meteor/client/lib/userData.ts on lines 10..33

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

      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 additionalFields = useMemo(
              () => ({
                  ...(alias && { alias }),
                  ...(emoji && { emoji }),
                  ...(avatar && { avatar }),
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 42..49

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

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

                                  {errors?.username && (
                                      <FieldError aria-live='assertive' id={`${usernameField}-error`}>
                                          {errors?.username.message}
                                      </FieldError>
                                  )}
      apps/meteor/client/omnichannel/tags/TagEdit.tsx on lines 95..99
      apps/meteor/client/omnichannel/units/UnitEdit.tsx on lines 184..188
      apps/meteor/client/omnichannel/units/UnitEdit.tsx on lines 256..260
      apps/meteor/client/omnichannel/units/UnitEdit.tsx on lines 299..303
      apps/meteor/client/views/account/profile/AccountProfileForm.tsx on lines 254..258
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 190..194
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 259..263
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 383..387

      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

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

                                  {errors?.urls && (
                                      <FieldError aria-live='assertive' id={`${urlsField}-error`}>
                                          {errors?.urls.message}
                                      </FieldError>
                                  )}
      apps/meteor/client/omnichannel/tags/TagEdit.tsx on lines 95..99
      apps/meteor/client/omnichannel/units/UnitEdit.tsx on lines 184..188
      apps/meteor/client/omnichannel/units/UnitEdit.tsx on lines 256..260
      apps/meteor/client/omnichannel/units/UnitEdit.tsx on lines 299..303
      apps/meteor/client/views/account/profile/AccountProfileForm.tsx on lines 254..258
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 190..194
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 298..302
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 383..387

      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

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

                                  {errors?.token && (
                                      <FieldError aria-live='assertive' id={`${tokenField}-error`}>
                                          {errors?.token.message}
                                      </FieldError>
                                  )}
      apps/meteor/client/omnichannel/tags/TagEdit.tsx on lines 95..99
      apps/meteor/client/omnichannel/units/UnitEdit.tsx on lines 184..188
      apps/meteor/client/omnichannel/units/UnitEdit.tsx on lines 256..260
      apps/meteor/client/omnichannel/units/UnitEdit.tsx on lines 299..303
      apps/meteor/client/views/account/profile/AccountProfileForm.tsx on lines 254..258
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 190..194
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 259..263
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 298..302

      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

      There are no issues that match your filters.

      Category
      Status