dsi-icl/optimise

View on GitHub

Showing 1,390 of 1,390 total issues

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

    render() {
        if (this.props.visits) {
            const params = this.props.match.params;

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

        render() {
            if (this.props.data.diagnosis.length === 0) {
                return (
                    <PatientProfileSectionScaffold sectionName='Last Primary MS Diagnosis' actions={
                        <EditButton to={`/patientProfile/${this.props.patientId}/edit/diagnosis/data`} />

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

          render() {
              const { startDate, reasonForVisit, error } = this.state;
              const { params } = this.props.match;
              return (
                  <>

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

            _handleClickDelete = () => {
                store.dispatch(addAlert({ alert: 'Do you want to delete this pregnancy record?', handler: this._deleteFunction(this.props.data.id) }));
            };
        packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 148..155
        packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 141..143
        packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 157..159
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 224..226
        packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 159..161

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

        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

            _handleClickDelete = () => {
                store.dispatch(
                    addAlert({
                        alert: 'Do you want to delete this concomitant medication record?',
                        handler: this._deleteFunction(this.props.data.id)
        packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 141..143
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 211..213
        packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 157..159
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 224..226
        packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 159..161

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

        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

            _handleClickDelete = () => {
                store.dispatch(addAlert({ alert: 'Do you want to delete this diagnosis record?', handler: this._deleteFunction(this.props.data.id) }));
            };
        packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 148..155
        packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 141..143
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 211..213
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 224..226
        packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 159..161

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

        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

            _handleClickDelete = () => {
                store.dispatch(addAlert({ alert: 'Do you want to delete this interruption record?', handler: this._deleteFunction(this.props.data.id) }));
            };
        packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 148..155
        packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 141..143
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 211..213
        packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 157..159
        packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 159..161

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

        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

            _handleClickDelete = () => {
                store.dispatch(addAlert({ alert: 'Do you want to delete this pregnancy image?', handler: this._deleteFunction(this.props.data.id) }));
            };
        packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 148..155
        packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 141..143
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 211..213
        packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 157..159
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 224..226

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

        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

                if (!this.state.startDate || !this.state.startDate.isValid()) {
                    this.setState({
                        error: 'Please select a start date'
                    });
                    return;
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 78..83
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 233..238
        packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 179..184
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 78..83

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

        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

                if (!this.state.startDate || !this.state.startDate.isValid()) {
                    this.setState({
                        error: 'Please select a start date'
                    });
                    return;
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 78..83
        packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 179..184
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 78..83
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 247..252

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

        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

            _handleClickDelete = () => {
                store.dispatch(addAlert({ alert: 'Do you want to delete this comorbidity record?', handler: this._deleteFunction(this.props.data.id) }));
            };
        packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 148..155
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 211..213
        packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 157..159
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 224..226
        packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 159..161

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

        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

                        <Link title='Record event' to={`/patientProfile/${patientId}/create/clinicalEvent`}><Icon symbol='addEvent' /><span>Record event</span></Link>
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 30..30
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 31..31
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 32..32

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

        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

                        <Link title='Record test' to={`/patientProfile/${patientId}/create/test`}><Icon symbol='addTest' /><span>Record test</span></Link>
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 30..30
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 32..32
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 33..33

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        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

                if (!this.state.newStartDate || !this.state.newStartDate.isValid()) {
                    this.setState({
                        error: 'Please select a start date'
                    });
                    return;
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 78..83
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 233..238
        packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 179..184
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 247..252

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

        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

                if (!this.state.newStartDate || !this.state.newStartDate.isValid()) {
                    this.setState({
                        error: 'Please select a start date'
                    });
                    return;
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 233..238
        packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 179..184
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 78..83
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 247..252

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

        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

                if (!this.state.diagnosisDate || !this.state.diagnosisDate.isValid()) {
                    this.setState({
                        error: 'Please select a diagnosis date'
                    });
                    return;
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 78..83
        packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 233..238
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 78..83
        packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 247..252

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

        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

                        <Link title='New visit' to={`/patientProfile/${patientId}/createVisit`} ><Icon symbol='addVisit' /><span>New visit</span></Link>
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 31..31
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 32..32
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 33..33

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        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

                        <Link title='Record treatment' to={`/patientProfile/${patientId}/create/treatment`}><Icon symbol='addTreatment' /><span>Record treatment</span></Link>
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 30..30
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 31..31
        packages/optimise-ui/src/components/patientProfile/sharedComponents.jsx on lines 33..33

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 56.

        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

                                        <select defaultValue={this.state.result} onChange={this._handleResultChange}>
                                            <option value='Result One'>One</option>
                                            <option value='Result Two'>Two</option>
                                            <option value='Other'>Other</option>
                                        </select>
        packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 261..265

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

        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 pregnancy = this.props.data.pregnancy.sort((a, b) => parseInt(b.startDate) - parseInt(a.startDate))[0];
        packages/optimise-ui/src/components/patientProfile/patientProfile.jsx on lines 404..404

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

        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

        Severity
        Category
        Status
        Source
        Language