RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx

Summary

Maintainability
F
6 days
Test Coverage

File IncomingWebhookForm.tsx has 323 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type { IIncomingIntegration, Serialized } from '@rocket.chat/core-typings';
import type { SelectOption } from '@rocket.chat/fuselage';
import {
    FieldError,
    IconButton,

    Function IncomingWebhookForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    const IncomingWebhookForm = ({ webhookData }: { webhookData?: Serialized<IIncomingIntegration> }) => {
        const t = useTranslation();
        const absoluteUrl = useAbsoluteUrl();
    
        const {

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

                                <FieldRow>
                                    <Controller
                                        name='channel'
                                        control={control}
                                        rules={{ required: t('The_field_is_required', t('Post_to_Channel')) }}
    apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 200..216
    apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 279..295

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

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

    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/outgoing/OutgoingWebhookForm.tsx on lines 156..166
    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 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/outgoing/OutgoingWebhookForm.tsx on lines 146..155
    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 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 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/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={overrideDestinationChannelEnabledField}>{t('Override_Destination_Channel')}</FieldLabel>
                                    <Controller
                                        name='overrideDestinationChannelEnabled'
    apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 141..150
    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/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/incoming/IncomingWebhookForm.tsx on lines 259..272

    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/incoming/IncomingWebhookForm.tsx on lines 240..253

    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

    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/outgoing/OutgoingWebhookForm.tsx on lines 432..438

    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

        const additionalFields = useMemo(
            () => ({
                ...(alias && { alias }),
                ...(emoji && { emoji }),
                ...(avatar && { avatar }),
    apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx on lines 90..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 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 20 locations. Consider refactoring.
    Open

                                {errors?.username && (
                                    <FieldError aria-live='assertive' id={`${usernameField}-error`}>
                                        {errors.username.message}
                                    </FieldError>
                                )}
    apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx on lines 187..191
    apps/meteor/client/views/account/profile/AccountProfileForm.tsx on lines 216..220
    apps/meteor/client/views/account/profile/AccountProfileForm.tsx on lines 294..298
    apps/meteor/client/views/account/security/ChangePassword.tsx on lines 74..78
    apps/meteor/client/views/admin/rooms/EditRoom.tsx on lines 173..177
    apps/meteor/client/views/admin/users/AdminUserForm.tsx on lines 204..208
    apps/meteor/client/views/admin/users/AdminUserForm.tsx on lines 230..234
    apps/meteor/client/views/admin/users/AdminUserForm.tsx on lines 259..263
    apps/meteor/client/views/admin/users/AdminUserForm.tsx on lines 295..299
    apps/meteor/client/views/admin/users/AdminUserForm.tsx on lines 322..326
    apps/meteor/client/views/admin/users/AdminUserForm.tsx on lines 363..367
    apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx on lines 130..134
    apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx on lines 156..160
    apps/meteor/client/views/room/contextualBar/ExportMessages/MailExportForm.tsx on lines 190..194
    apps/meteor/ee/client/omnichannel/additionalForms/BusinessHoursMultiple.tsx on lines 51..55
    apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx on lines 58..62
    apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx on lines 94..98
    packages/web-ui-registration/src/RegisterForm.tsx on lines 228..232
    packages/web-ui-registration/src/ResetPassword/ResetPasswordPage.tsx on lines 111..115

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

                                        addon={webhookData?._id ? <IconButton mini onClick={() => copyWebhookUrl()} title={t('Copy')} icon='copy' /> : undefined}
    apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 110..110
    apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 132..132

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

                                        addon={webhookData?._id ? <IconButton mini onClick={() => copyToken()} title={t('Copy')} icon='copy' /> : undefined}
    apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 97..97
    apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 132..132

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

                                            addon={webhookData?._id ? <IconButton mini onClick={() => copyCurlData()} title={t('Copy')} icon='copy' /> : undefined}
    apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 97..97
    apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx on lines 110..110

    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