dsi-icl/optimise

View on GitHub

Showing 1,390 of 1,390 total issues

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

                end_date: !this.state.noEndDate && this.state.newEndDate ? this.state.newEndDate.toISOString() : null,
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 257..257
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 271..271

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

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

    apiHelper('/demographics/Demographic', { method: 'PUT', body: JSON.stringify(body.demoData) })
        .then(() => {
            dispatch(getPatientProfileByIdRequest());
            return apiHelper('/patientPii', { method: 'PUT', body: JSON.stringify(body.PIIData) });
        })
Severity: Minor
Found in packages/optimise-ui/src/redux/actions/createPatient.js and 2 other locations - About 40 mins to fix
packages/optimise-ui/src/redux/actions/createPatient.js on lines 10..22
packages/optimise-ui/src/redux/actions/createPatient.js on lines 10..26

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

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

@connect(state => ({
    data: state.patientProfile.data,
    historyFilter: state.patientProfile.historyFilter,
    availableFields: state.availableFields
}))
packages/optimise-ui/src/components/editMedicalElements/editCommunication.jsx on lines 14..60
packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 19..86

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

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

                end_date: !this.state.noEndDate && this.state.endDate ? this.state.endDate.toISOString() : null,
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 257..257
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 102..102

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

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

                outcomeDate: !this.state.noEndDate && this.state.outcomeDate ? this.state.outcomeDate.toISOString() : null,
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 102..102
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 271..271

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

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

@connect(state => ({
    fetching: state.patientProfile.fetching,
    data: state.patientProfile.data,
    availableFields: state.availableFields
}))
packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 19..86
packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 757..902

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

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

        this.setState({
            lastSubmit: (new Date()).getTime()
        }, () => {
            store.dispatch(updateVisitAPICall(body));
        });
packages/optimise-ui/src/components/editMedicalElements/editDemographic.jsx on lines 111..115

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

                            {endDate_original ? <><label>End date: </label> {endDate_original._d.toDateString()}<br /></> : null}
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 346..346

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

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

@connect(state => ({
    fetching: state.patientProfile.fetching,
    data: state.patientProfile.data,
    patientProfile: state.availableFields
}))
packages/optimise-ui/src/components/editMedicalElements/editCommunication.jsx on lines 14..60
packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 757..902

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

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

                            {outcomeDate_original ? <><label>End date: </label> {outcomeDate_original._d.toDateString()}<br /></> : null}
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 361..361

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

        this.setState({
            lastSubmit: (new Date()).getTime()
        }, () => {
            store.dispatch(updatePatientCall(body));
        });
packages/optimise-ui/src/components/editMedicalElements/editCommunication.jsx on lines 226..230

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

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

Function updateEntry has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

export const updateEntry = function (tablename, { id }, originObj, whereObj, newObj) {
Severity: Minor
Found in packages/optimise-core/src/utils/controller-utils.js - About 35 mins to fix

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

    treatment.route('/interrupt')
        .post(TreatmentController.addInterruption)
        .put(TreatmentController.editInterruption)
        .delete(TreatmentController.deleteInterruption);
    Severity: Major
    Found in packages/optimise-core/src/routes/treatmentRoute.js and 9 other locations - About 35 mins to fix
    packages/optimise-core/src/routes/clinicalEventRoute.js on lines 12..15
    packages/optimise-core/src/routes/comorbidityRoute.js on lines 12..15
    packages/optimise-core/src/routes/concomitantMedRoute.js on lines 12..15
    packages/optimise-core/src/routes/demographicRoute.js on lines 19..22
    packages/optimise-core/src/routes/demographicRoute.js on lines 24..27
    packages/optimise-core/src/routes/demographicRoute.js on lines 29..32
    packages/optimise-core/src/routes/demographicRoute.js on lines 34..37
    packages/optimise-core/src/routes/demographicRoute.js on lines 39..42
    packages/optimise-core/src/routes/testRoute.js on lines 12..15

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

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

    concomitantMed.route('/')
        .post(ConcomitantMedController.createConcomitantMed)
        .put(ConcomitantMedController.editConcomitantMed)
        .delete(ConcomitantMedController.deleteConcomitantMed);
    Severity: Major
    Found in packages/optimise-core/src/routes/concomitantMedRoute.js and 9 other locations - About 35 mins to fix
    packages/optimise-core/src/routes/clinicalEventRoute.js on lines 12..15
    packages/optimise-core/src/routes/comorbidityRoute.js on lines 12..15
    packages/optimise-core/src/routes/demographicRoute.js on lines 19..22
    packages/optimise-core/src/routes/demographicRoute.js on lines 24..27
    packages/optimise-core/src/routes/demographicRoute.js on lines 29..32
    packages/optimise-core/src/routes/demographicRoute.js on lines 34..37
    packages/optimise-core/src/routes/demographicRoute.js on lines 39..42
    packages/optimise-core/src/routes/testRoute.js on lines 12..15
    packages/optimise-core/src/routes/treatmentRoute.js on lines 18..21

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

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

    demogdata.route('/PregnancyEntry')
        .post(DemographicController.createPregnancyEntry)
        .put(DemographicController.editPregnancyEntry)
        .delete(DemographicController.deletePregnancyEntry);
    Severity: Major
    Found in packages/optimise-core/src/routes/demographicRoute.js and 9 other locations - About 35 mins to fix
    packages/optimise-core/src/routes/clinicalEventRoute.js on lines 12..15
    packages/optimise-core/src/routes/comorbidityRoute.js on lines 12..15
    packages/optimise-core/src/routes/concomitantMedRoute.js on lines 12..15
    packages/optimise-core/src/routes/demographicRoute.js on lines 19..22
    packages/optimise-core/src/routes/demographicRoute.js on lines 24..27
    packages/optimise-core/src/routes/demographicRoute.js on lines 29..32
    packages/optimise-core/src/routes/demographicRoute.js on lines 34..37
    packages/optimise-core/src/routes/testRoute.js on lines 12..15
    packages/optimise-core/src/routes/treatmentRoute.js on lines 18..21

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

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

    ce.route('/')
        .post(CeController.createCe)
        .put(CeController.updateCe)
        .delete(CeController.deleteCe);
    Severity: Major
    Found in packages/optimise-core/src/routes/clinicalEventRoute.js and 9 other locations - About 35 mins to fix
    packages/optimise-core/src/routes/comorbidityRoute.js on lines 12..15
    packages/optimise-core/src/routes/concomitantMedRoute.js on lines 12..15
    packages/optimise-core/src/routes/demographicRoute.js on lines 19..22
    packages/optimise-core/src/routes/demographicRoute.js on lines 24..27
    packages/optimise-core/src/routes/demographicRoute.js on lines 29..32
    packages/optimise-core/src/routes/demographicRoute.js on lines 34..37
    packages/optimise-core/src/routes/demographicRoute.js on lines 39..42
    packages/optimise-core/src/routes/testRoute.js on lines 12..15
    packages/optimise-core/src/routes/treatmentRoute.js on lines 18..21

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

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

    demogdata.route('/Immunisation')
        .post(DemographicController.createImmunisation)
        .put(DemographicController.editImmunisation)
        .delete(DemographicController.deleteImmunisation);
    Severity: Major
    Found in packages/optimise-core/src/routes/demographicRoute.js and 9 other locations - About 35 mins to fix
    packages/optimise-core/src/routes/clinicalEventRoute.js on lines 12..15
    packages/optimise-core/src/routes/comorbidityRoute.js on lines 12..15
    packages/optimise-core/src/routes/concomitantMedRoute.js on lines 12..15
    packages/optimise-core/src/routes/demographicRoute.js on lines 24..27
    packages/optimise-core/src/routes/demographicRoute.js on lines 29..32
    packages/optimise-core/src/routes/demographicRoute.js on lines 34..37
    packages/optimise-core/src/routes/demographicRoute.js on lines 39..42
    packages/optimise-core/src/routes/testRoute.js on lines 12..15
    packages/optimise-core/src/routes/treatmentRoute.js on lines 18..21

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

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

    comorbidity.route('/')
        .post(ComorbidityController.createComorbidity)
        .put(ComorbidityController.editComorbidity)
        .delete(ComorbidityController.deleteComorbidity);
    Severity: Major
    Found in packages/optimise-core/src/routes/comorbidityRoute.js and 9 other locations - About 35 mins to fix
    packages/optimise-core/src/routes/clinicalEventRoute.js on lines 12..15
    packages/optimise-core/src/routes/concomitantMedRoute.js on lines 12..15
    packages/optimise-core/src/routes/demographicRoute.js on lines 19..22
    packages/optimise-core/src/routes/demographicRoute.js on lines 24..27
    packages/optimise-core/src/routes/demographicRoute.js on lines 29..32
    packages/optimise-core/src/routes/demographicRoute.js on lines 34..37
    packages/optimise-core/src/routes/demographicRoute.js on lines 39..42
    packages/optimise-core/src/routes/testRoute.js on lines 12..15
    packages/optimise-core/src/routes/treatmentRoute.js on lines 18..21

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

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

    demogdata.route('/MedicalCondition')
        .post(DemographicController.createMedicalCondition)
        .put(DemographicController.editMedicalCondition)
        .delete(DemographicController.deleteMedicalCondition);
    Severity: Major
    Found in packages/optimise-core/src/routes/demographicRoute.js and 9 other locations - About 35 mins to fix
    packages/optimise-core/src/routes/clinicalEventRoute.js on lines 12..15
    packages/optimise-core/src/routes/comorbidityRoute.js on lines 12..15
    packages/optimise-core/src/routes/concomitantMedRoute.js on lines 12..15
    packages/optimise-core/src/routes/demographicRoute.js on lines 19..22
    packages/optimise-core/src/routes/demographicRoute.js on lines 29..32
    packages/optimise-core/src/routes/demographicRoute.js on lines 34..37
    packages/optimise-core/src/routes/demographicRoute.js on lines 39..42
    packages/optimise-core/src/routes/testRoute.js on lines 12..15
    packages/optimise-core/src/routes/treatmentRoute.js on lines 18..21

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

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

    demogdata.route('/Pregnancy')
        .post(DemographicController.createPregnancy)
        .put(DemographicController.editPregnancy)
        .delete(DemographicController.deletePregnancy);
    Severity: Major
    Found in packages/optimise-core/src/routes/demographicRoute.js and 9 other locations - About 35 mins to fix
    packages/optimise-core/src/routes/clinicalEventRoute.js on lines 12..15
    packages/optimise-core/src/routes/comorbidityRoute.js on lines 12..15
    packages/optimise-core/src/routes/concomitantMedRoute.js on lines 12..15
    packages/optimise-core/src/routes/demographicRoute.js on lines 19..22
    packages/optimise-core/src/routes/demographicRoute.js on lines 24..27
    packages/optimise-core/src/routes/demographicRoute.js on lines 34..37
    packages/optimise-core/src/routes/demographicRoute.js on lines 39..42
    packages/optimise-core/src/routes/testRoute.js on lines 12..15
    packages/optimise-core/src/routes/treatmentRoute.js on lines 18..21

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

    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