RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx

Summary

Maintainability
F
2 wks
Test Coverage

File EmailInboxForm.tsx has 581 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type { IEmailInboxPayload } from '@rocket.chat/core-typings';
import {
    Accordion,
    Button,
    ButtonGroup,
Severity: Major
Found in apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx - About 1 day to fix

    Function EmailInboxForm has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): ReactElement => {
        const t = useTranslation();
        const dispatchToastMessage = useToastMessageDispatch();
        const setModal = useSetModal();
        const router = useRoute('admin-email-inboxes');
    Severity: Minor
    Found in apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx - About 2 hrs to fix

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

                                <Field>
                                    <FieldLabel htmlFor={imapServerField} required>
                                        {t('Server')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 362..388
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 389..415
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 457..483
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 484..510
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 511..537
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 538..564

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

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

                                <Field>
                                    <FieldLabel htmlFor={imapRetriesField} required>
                                        {t('Max_Retry')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 362..388
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 389..415
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 430..456
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 457..483
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 484..510
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 511..537

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

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

                                <Field>
                                    <FieldLabel htmlFor={smtpUsernameField} required>
                                        {t('Username')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 389..415
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 430..456
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 457..483
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 484..510
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 511..537
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 538..564

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

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

                                <Field>
                                    <FieldLabel htmlFor={imapPortField} required>
                                        {t('Port')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 362..388
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 389..415
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 430..456
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 484..510
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 511..537
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 538..564

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

    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>
                                    <FieldLabel htmlFor={smtpServerField} required>
                                        {t('Server')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 206..232
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 335..361

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

    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>
                                    <FieldLabel htmlFor={smtpPortField} required>
                                        {t('Port')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 206..232
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 308..334

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

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

                                <Field>
                                    <FieldLabel htmlFor={smtpPasswordField} required>
                                        {t('Password')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 362..388
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 430..456
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 457..483
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 484..510
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 511..537
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 538..564

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

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

                                <Field>
                                    <FieldLabel htmlFor={imapUsernameField} required>
                                        {t('Username')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 362..388
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 389..415
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 430..456
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 457..483
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 511..537
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 538..564

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

    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>
                                    <FieldLabel htmlFor={nameField} required>
                                        {t('Name')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 308..334
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 335..361

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

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

                                <Field>
                                    <FieldLabel htmlFor={imapPasswordField} required>
                                        {t('Password')}
                                    </FieldLabel>
                                    <FieldRow>
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 362..388
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 389..415
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 430..456
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 457..483
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 484..510
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 538..564

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

    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={senderInfoField}>{t('Sender_Info')}</FieldLabel>
                                    <FieldRow>
                                        <Controller
                                            name='senderInfo'
    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
    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 6 locations. Consider refactoring.
    Open

                                <Field>
                                    <FieldRow>
                                        <FieldLabel htmlFor={smtpSecureField}>{t('Connect_SSL_TLS')}</FieldLabel>
                                        <Controller
                                            control={control}
    apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx on lines 143..152
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 565..574
    apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx on lines 359..368
    apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx on lines 407..418
    apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx on lines 419..430

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

                                <Field>
                                    <FieldRow>
                                        <FieldLabel htmlFor={imapSecureField}>{t('Connect_SSL_TLS')}</FieldLabel>
                                        <Controller
                                            control={control}
    apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx on lines 143..152
    apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx on lines 416..425
    apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx on lines 359..368
    apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx on lines 407..418
    apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx on lines 419..430

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

                                <Field>
                                    <FieldLabel htmlFor={descriptionField}>{t('Description')}</FieldLabel>
                                    <FieldRow>
                                        <Controller
                                            name='description'
    apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 233..242
    apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 243..252
    apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx on lines 283..292
    apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx on lines 200..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 111.

    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

            async ({
                active,
                name,
                email,
                description,
    Severity: Major
    Found in apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx and 1 other location - About 2 hrs to fix
    apps/meteor/app/integrations/server/lib/updateHistory.ts on lines 7..45

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

    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

            setModal(
                <GenericModal variant='danger' onConfirm={deleteInbox} onCancel={(): void => setModal(null)} confirmText={t('Delete')}>
                    {t('You_will_not_be_able_to_recover_email_inbox')}
                </GenericModal>,
            );
    apps/meteor/client/views/hooks/roomActions/useDeleteRoom.tsx on lines 81..85

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

    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