superdesk/superdesk-client-core

View on GitHub
scripts/apps/contacts/components/Form/ProfileDetail.tsx

Summary

Maintainability
F
1 wk
Test Coverage

Function render has 449 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        const {contact, onChange, readOnly, errors, contactType} = this.props;

        const contactLabel = contactType === 'person' ? gettext('Role') : gettext('Point of contact');
        const isRequired = get(this.state, 'requiredField', false);
Severity: Major
Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx - About 2 days to fix

    File ProfileDetail.tsx has 620 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from 'react';
    import PropTypes from 'prop-types';
    import classNames from 'classnames';
    import {get, set, isEmpty, findKey, orderBy, map} from 'lodash';
    
    
    Severity: Major
    Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx - About 1 day to fix

      Function constructor has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          constructor(props: IProps) {
              super(props);
              const {svc, contact} = props;
              const {metadata} = svc;
      
      
      Severity: Minor
      Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx - About 1 hr to fix

        Function render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            render() {
                const {contact, onChange, readOnly, errors, contactType} = this.props;
        
                const contactLabel = contactType === 'person' ? gettext('Role') : gettext('Point of contact');
                const isRequired = get(this.state, 'requiredField', false);
        Severity: Minor
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx - About 1 hr 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

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

            constructor(props: IProps) {
                super(props);
                const {svc, contact} = props;
                const {metadata} = svc;
        
        
        Severity: Minor
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx - About 35 mins 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 2 locations. Consider refactoring.
        Open

                        <Row>
                            <LineInput readOnly={readOnly} required={isRequired} invalid={showMinFieldsWarning}>
                                <Label text={getMinRequiredFieldLabel('contact_phone')} />
                                {showMinFieldsWarning && (
                                    <div className="sd-line-input__message">
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 7 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 414..432

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

        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

                            <Row>
                                <LineInput readOnly={readOnly} required={isRequired} invalid={showMinFieldsWarning}>
                                    <Label text={getMinRequiredFieldLabel('mobile')} />
                                    {showMinFieldsWarning && (
                                        <div className="sd-line-input__message">
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 7 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 392..410

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

        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

                        <Row>
                            <LineInput
                                readOnly={readOnly}
                                required={contactType === 'person'}
                                invalid={contactType === 'person' && this.isFieldInvalid('last_name')}
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 6 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 308..329

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

        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

                            <Row>
                                <LineInput
                                    readOnly={readOnly}
                                    required={contactType === 'organisation'}
                                    invalid={contactType === 'organisation' && this.isFieldInvalid('organisation')}
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 6 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 287..305

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

        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

                            <Row>
                                <LineInput
                                    readOnly={readOnly}
                                    required={isRequired}
                                    invalid={showMinFieldsWarning}
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 5 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 485..507

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

        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

                            <Row>
                                <LineInput
                                    readOnly={readOnly}
                                    required={isRequired}
                                    invalid={showMinFieldsWarning}
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 5 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 509..531

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

        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

                            <RowItem noGrow={true}>
                                <LineInput readOnly={readOnly}>
                                    <Label text={gettext('Active')} />
                                    <Toggle
                                        value={get(contact, 'is_active', false)}
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 3 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 230..239

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

        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

                            <RowItem noGrow={true}>
                                <LineInput readOnly={readOnly}>
                                    <Label text={gettext('public')} />
                                    <Toggle
                                        value={get(contact, 'public', false)}
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 3 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 240..249

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

        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

                            <Row>
                                <LineInput readOnly={readOnly}>
                                    <Label text={gettext('city')} />
                                    <Input
                                        field="city"
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 3 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 434..445

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

        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

                            <Row>
                                <LineInput readOnly={readOnly}>
                                    <Label text={gettext('fax')} />
                                    <Input
                                        field="fax"
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 3 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 582..593

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

        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

                                <LineInput readOnly={readOnly} hint={gettext('e.g. http://www.website.com')}>
                                    <Label text={gettext('website')} />
                                    <Input
                                        field="website"
                                        value={get(contact, 'website', '')}
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 2 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 560..569

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

        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

                                <LineInput readOnly={readOnly} hint={gettext('e.g. Rhodes, CBD')}>
                                    <Label text={gettext('locality')} />
                                    <Input
                                        field="locality"
                                        value={get(contact, 'locality', '')}
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 2 hrs to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 448..457

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

        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

        ProfileDetail.propTypes = {
            svc: PropTypes.object.isRequired,
            contact: PropTypes.object.isRequired,
            contactType: PropTypes.string,
            onChange: PropTypes.func,
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 1 hr to fix
        scripts/apps/contacts/components/Item.tsx on lines 104..111

        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

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

            onBlur(e) {
                const _touched = this.state.touched;
        
                set(_touched, e.target.name, true);
        
        
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 2 other locations - About 1 hr to fix
        scripts/apps/contacts/components/Form/ContactNumberInput.tsx on lines 23..29
        scripts/apps/contacts/components/Form/MultiTextInput.tsx on lines 24..30

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

        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

                                    <Input
                                        field="contact_address[0]"
                                        value={get(contact, 'contact_address[0]', '')}
                                        onChange={onChange}
                                        type="text"
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 1 hr to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 548..555

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

                                    <Input
                                        field="contact_address[1]"
                                        value={get(contact, 'contact_address[1]', '')}
                                        onChange={onChange}
                                        type="text"
        Severity: Major
        Found in scripts/apps/contacts/components/Form/ProfileDetail.tsx and 1 other location - About 1 hr to fix
        scripts/apps/contacts/components/Form/ProfileDetail.tsx on lines 536..543

        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