dsi-icl/optimise

View on GitHub

Showing 1,390 of 1,390 total issues

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

    render() {
        const { countryOfOriginRef, dominantHandRef, ethnicityRef, genderRef } = this.state;
        const { fields, fetching } = this.props;
        if (fetching || !this.props.pii) {
            return null;

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

                        <NavLink to={`/patientProfile/${this.props.data.patientId}/edit/communication/${this.props.visitId}`} activeClassName={style.activeNavLink}>
                            <button>Edit or export the visit report</button>
                        </NavLink>
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 478..480
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 501..503
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 528..530
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 557..559
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 598..600
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 725..727
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 731..733

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

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

                            <NavLink to={`/patientProfile/${this.props.data.patientId}/edit/comorbidity/${this.props.visitId}`} activeClassName={style.activeNavLink}>
                                <button>Edit comorbidities</button>
                            </NavLink>
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 478..480
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 501..503
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 557..559
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 598..600
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 725..727
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 731..733
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 747..749

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

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

                            <NavLink to={`/patientProfile/${this.props.data.patientId}/edit/msPerfMeas/${this.props.visitId}`} activeClassName={style.activeNavLink}>
                                <button>Edit performance measures data for this visit</button>
                            </NavLink>
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 478..480
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 501..503
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 528..530
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 557..559
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 725..727
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 731..733
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 747..749

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

    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

                        <div className={style.ariane}>
                            <h2>Primary MS Diagnoses</h2>
                            <BackButton to={`/patientProfile/${this.props.match.params.patientId}`} />
                        </div>
    packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 42..45
    packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 76..79
    packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 127..130
    packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 132..135

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            if (pregnancySubStudyConsent && this.props.data.demographicData.gender !== 1) {
                Object.assign(pageToTitleMap, {
                    10: 'Pregnancy',
                    11: 'Communication and notes'
                });
    packages/optimise-ui/src/components/createVisitFrontPage/templates/baselineVisitFrontPage.jsx on lines 64..73

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    @withRouter
    @connect(state => ({
        fetching: state.patientProfile.fetching,
        data: state.patientProfile.data,
        typeHash: state.availableFields.clinicalEventTypes_Hash[0],
    packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/ce/otherSAEWrapper.jsx on lines 10..49

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 76.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            if (pregnancySubStudyConsent && this.props.data.demographicData.gender !== 1) {
                Object.assign(pageToTitleMap, {
                    10: 'Pregnancy',
                    11: 'Communication and notes'
                });
    packages/optimise-ui/src/components/createVisitFrontPage/templates/followupVisitFrontPage.jsx on lines 76..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 76.

    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

                        <div className={_style.ariane}>
                            <h2>Comorbidities</h2>
                            <BackButton to={`/patientProfile/${this.props.match.params.patientId}`} />
                        </div>
    packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 42..45
    packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 127..130
    packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 91..94
    packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 132..135

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

    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

                                <div className={style.ariane}>
                                    <h2>Pregnancies</h2>
                                    <BackButton to={`/patientProfile/${this.props.match.params.patientId}`} />
                                </div>
    packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 42..45
    packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 76..79
    packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 91..94
    packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 132..135

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    @withRouter
    @connect(state => ({
        fetching: state.patientProfile.fetching,
        data: state.patientProfile.data,
        typeHash: state.availableFields.clinicalEventTypes_Hash[0],
    packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/ce/relapseWrapper.jsx on lines 10..49

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 76.

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

                            <NavLink to={`/patientProfile/${this.props.data.patientId}/data/visit/${this.props.visitId}/symptoms`} activeClassName={style.activeNavLink}>
                                <button>Edit symptoms data for this visit</button>
                            </NavLink>
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 501..503
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 528..530
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 557..559
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 598..600
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 725..727
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 731..733
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 747..749

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

    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

                        <div className={_style.ariane}>
                            <h2>Concomitant Medication</h2>
                            <BackButton to={`/patientProfile/${this.props.match.params.patientId}`} />
                        </div>
    packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 76..79
    packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 127..130
    packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 91..94
    packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 132..135

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

    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

                        if (result.medicalHistory.length >= 1)
                            for (let i = 0; i < result.medicalHistory.length; i++)
                                promiseContainer.push(ActionCore.eraseIdOnRoute('/demographics/MedicalCondition', result.medicalHistory[i].id));
    Severity: Major
    Found in packages/optimise-core/src/controllers/patientController.js and 2 other locations - About 2 hrs to fix
    packages/optimise-core/src/controllers/patientController.js on lines 156..158
    packages/optimise-core/src/controllers/patientController.js on lines 167..169

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

    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

            if ((body.hasOwnProperty('treatmentId') && body.hasOwnProperty('terminationDate')) && body.hasOwnProperty('terminatedReason') &&
                typeof body.treatmentId === 'number' && typeof body.terminatedDate === 'string' && typeof body.terminatedReason === 'number') {
                const momentTerminated = moment(body.terminatedDate, moment.ISO_8601);
                if (!momentTerminated.isValid() && body.terminatedDate !== null) {
                    res.status(400).json(ErrorHelper(message.dateError[momentTerminated.invalidAt()], new Error(message.userError.INVALIDDATE)));
    packages/optimise-core/src/controllers/demographicDataController.js on lines 54..82
    packages/optimise-core/src/controllers/patientDiagnosisController.js on lines 31..56

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

    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

                        <div className={_style.ariane}>
                            <h2>Treatment Interruptions</h2>
                            <BackButton to={`/patientProfile/${this.props.match.params.patientId}`} />
                        </div>
    packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 42..45
    packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 76..79
    packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 127..130
    packages/optimise-ui/src/components/editMedicalElements/editPrimaryDiagnosis.jsx on lines 91..94

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

    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

            if (body.hasOwnProperty('patient') && body.hasOwnProperty('immunisationDate') && body.hasOwnProperty('vaccineName') &&
                typeof body.patient === 'number' && typeof body.immunisationDate === 'string' && typeof body.vaccineName === 'string') {
                const momentImmun = moment(body.immunisationDate, moment.ISO_8601);
                if (!momentImmun.isValid() && body.immunisationDate !== null) {
                    const msg = message.dateError[momentImmun.invalidAt()] !== undefined ? message.dateError[momentImmun.invalidAt()] : message.userError.INVALIDDATE;
    packages/optimise-core/src/controllers/patientDiagnosisController.js on lines 31..56
    packages/optimise-core/src/controllers/treatmentController.js on lines 74..95

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

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

                            <NavLink to={`/patientProfile/${this.props.data.patientId}/edit/concomitantMed/${this.props.visitId}`} activeClassName={style.activeNavLink}>
                                <button>Edit concomitant medications</button>
                            </NavLink>
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 478..480
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 501..503
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 528..530
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 598..600
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 725..727
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 731..733
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 747..749

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

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

                            <NavLink to={`/patientProfile/${this.props.data.patientId}/data/visit/${this.props.visitId}/pregnancy?add`} activeClassName={style.activeNavLink}>
                                <button>Add pregnancy entry</button>
                            </NavLink>
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 478..480
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 501..503
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 528..530
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 557..559
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 598..600
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 725..727
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 747..749

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

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

                            <NavLink to={`/patientProfile/${this.props.data.patientId}/data/visit/${this.props.visitId}/signs`} activeClassName={style.activeNavLink}>
                                <button>Edit signs data for this visit</button>
                            </NavLink>
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 478..480
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 528..530
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 557..559
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 598..600
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 725..727
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 731..733
    packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 747..749

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

    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