dsi-icl/optimise

View on GitHub

Showing 1,390 of 1,390 total issues

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

                            {this.state.error ? <><div className={style.error}>{this.state.error}</div><br /></> : null}
packages/optimise-ui/src/components/admin/sync.jsx on lines 89..89
packages/optimise-ui/src/components/createMedicalElements/createCE.jsx on lines 153..153
packages/optimise-ui/src/components/createMedicalElements/createTest.jsx on lines 124..124
packages/optimise-ui/src/components/createMedicalElements/createTreatment.jsx on lines 203..203
packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 245..245
packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 376..376
packages/optimise-ui/src/components/editMedicalElements/editClinicalEvent.jsx on lines 217..217
packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 108..108
packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 214..214
packages/optimise-ui/src/components/editMedicalElements/editMedication.jsx on lines 274..274
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 167..167
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 339..339
packages/optimise-ui/src/components/editMedicalElements/editTest.jsx on lines 203..203
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 176..176
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 354..354
packages/optimise-ui/src/components/patientProfile/patientProfile.jsx on lines 281..281
packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 269..269
packages/optimise-ui/src/components/pregnancyForms/pregnancyEntry.jsx on lines 865..865

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

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

                {this.state.error ? <><div className={style.error}>{this.state.error}</div><br /></> : null}
packages/optimise-ui/src/components/admin/sync.jsx on lines 89..89
packages/optimise-ui/src/components/createMedicalElements/createCE.jsx on lines 153..153
packages/optimise-ui/src/components/createMedicalElements/createTest.jsx on lines 124..124
packages/optimise-ui/src/components/createMedicalElements/createTreatment.jsx on lines 203..203
packages/optimise-ui/src/components/createPatient/createPatient.jsx on lines 252..252
packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 245..245
packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 376..376
packages/optimise-ui/src/components/editMedicalElements/editClinicalEvent.jsx on lines 217..217
packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 108..108
packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 214..214
packages/optimise-ui/src/components/editMedicalElements/editMedication.jsx on lines 274..274
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 167..167
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 339..339
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 176..176
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 354..354
packages/optimise-ui/src/components/patientProfile/patientProfile.jsx on lines 281..281
packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 269..269
packages/optimise-ui/src/components/pregnancyForms/pregnancyEntry.jsx on lines 865..865

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

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

                            { this.state.saved ? <><button disabled style={{ cursor: 'default', backgroundColor: 'green' }}>Successfully saved!</button><br/></> : null }
packages/optimise-ui/src/components/EDSScalculator/calculator.jsx on lines 274..274
packages/optimise-ui/src/components/medicalData/ceDataPage.jsx on lines 172..172
packages/optimise-ui/src/components/medicalData/testDataPage.jsx on lines 167..167
packages/optimise-ui/src/components/pregnancyForms/pregnancyEntry.jsx on lines 864..864

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

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

                        {this.state.error ? <><div className={style.error}>{this.state.error}</div><br /></> : null}
packages/optimise-ui/src/components/admin/sync.jsx on lines 89..89
packages/optimise-ui/src/components/createMedicalElements/createCE.jsx on lines 153..153
packages/optimise-ui/src/components/createMedicalElements/createTreatment.jsx on lines 203..203
packages/optimise-ui/src/components/createPatient/createPatient.jsx on lines 252..252
packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 245..245
packages/optimise-ui/src/components/editMedicalElements/createConmitantMeds.jsx on lines 376..376
packages/optimise-ui/src/components/editMedicalElements/editClinicalEvent.jsx on lines 217..217
packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 108..108
packages/optimise-ui/src/components/editMedicalElements/editComorbidity.jsx on lines 214..214
packages/optimise-ui/src/components/editMedicalElements/editMedication.jsx on lines 274..274
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 167..167
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 339..339
packages/optimise-ui/src/components/editMedicalElements/editTest.jsx on lines 203..203
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 176..176
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 354..354
packages/optimise-ui/src/components/patientProfile/patientProfile.jsx on lines 281..281
packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 269..269
packages/optimise-ui/src/components/pregnancyForms/pregnancyEntry.jsx on lines 865..865

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

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

    static deletePregnancyOutcomes(user, whereObj) {
        return new Promise((resolve, reject) => deleteEntry('PREGNANCY_OUTCOMES', user, whereObj).then((result) => resolve(result)).catch((error) => reject(error)));
    }
Severity: Major
Found in packages/optimise-core/src/core/demographic.js and 2 other locations - About 1 hr to fix
packages/optimise-core/src/core/demographic.js on lines 145..147
packages/optimise-core/src/core/demographic.js on lines 175..177

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

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

                        <button name='testBlock' onClick={this._queryInterval} title='Tests' className={this.state.nextType === 'testBlock' ? style.selectedHop : ''}>Tests</button>
packages/optimise-ui/src/components/editMedicalElements/editCommunication.jsx on lines 245..245
packages/optimise-ui/src/components/editMedicalElements/editCommunication.jsx on lines 252..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 62.

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

    static deletePregnancy(user, whereObj) {
        return new Promise((resolve, reject) => deleteEntry('PATIENT_PREGNANCY', user, whereObj).then((result) => resolve(result)).catch((error) => reject(error)));
    }
Severity: Major
Found in packages/optimise-core/src/core/demographic.js and 2 other locations - About 1 hr to fix
packages/optimise-core/src/core/demographic.js on lines 158..160
packages/optimise-core/src/core/demographic.js on lines 175..177

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

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

    static deletePregnancyImage(user, whereObj) {
        return new Promise((resolve, reject) => deleteEntry('PATIENT_PREGNANCY_IMAGING', user, whereObj).then((result) => resolve(result)).catch((error) => reject(error)));
    }
Severity: Major
Found in packages/optimise-core/src/core/demographic.js and 2 other locations - About 1 hr to fix
packages/optimise-core/src/core/demographic.js on lines 145..147
packages/optimise-core/src/core/demographic.js on lines 158..160

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

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

                        <button name='ceBlock' onClick={this._queryInterval} title='Clinical Events' className={this.state.nextType === 'ceBlock' ? style.selectedHop : ''}>Clinical Events</button>
packages/optimise-ui/src/components/editMedicalElements/editCommunication.jsx on lines 251..251
packages/optimise-ui/src/components/editMedicalElements/editCommunication.jsx on lines 252..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 62.

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

                                            <line x1={x1 - 4} y1={15 + 4} x2={x1 + 4} y2={15 - 4} className={style.cross} />
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 331..331

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

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

                        <button name='medBlock' onClick={this._queryInterval} title='Treatments' className={this.state.nextType === 'medBlock' ? style.selectedHop : ''}>Treatments</button>
packages/optimise-ui/src/components/editMedicalElements/editCommunication.jsx on lines 245..245
packages/optimise-ui/src/components/editMedicalElements/editCommunication.jsx on lines 251..251

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

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 { editing, startDate, outcomeDate, noEndDate, outcome, meddra, startDate_original, outcomeDate_original, outcome_original, meddra_original } = this.state;
packages/optimise-ui/src/components/medicalData/treatmentInterruptions.jsx on lines 329..329

Duplicated Code

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

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

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

Tuning

This issue has a mass of 62.

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 { editing, startDate, endDate, noEndDate, reason, meddra, startDate_original, endDate_original, reason_original, meddra_original } = this.state;
packages/optimise-ui/src/components/editMedicalElements/editPregnancy.jsx on lines 315..315

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

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

                                            <line x1={x1 - 4} y1={15 - 4} x2={x1 + 4} y2={15 + 4} className={style.cross} />
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 332..332

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

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

Consider simplifying this complex logical expression.
Open

        if (body.hasOwnProperty('treatmentInterId') && typeof body.treatmentInterId === 'number' &&
            body.hasOwnProperty('start_date') && typeof body.start_date === 'string') {
            const momentStart = body.hasOwnProperty('start_date') && body.start_date !== null ? moment(body.start_date, moment.ISO_8601) : null;
            const momentEnd = body.hasOwnProperty('end_date') && body.end_date !== null ? moment(body.end_date, moment.ISO_8601) : null;
            if (momentStart !== null && !momentStart.isValid()) {
Severity: Critical
Found in packages/optimise-core/src/controllers/treatmentController.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (body.hasOwnProperty('id') && typeof body.id === 'number' &&
                ((body.hasOwnProperty('outcome') && typeof body.outcome === 'string') || !body.hasOwnProperty('outcome')) &&
                ((body.hasOwnProperty('resolvedYear') && typeof body.resolvedYear === 'number') || !body.hasOwnProperty('resolvedYear'))) {
                MedicalHistoryCore.editMedicalHistory(user, body).then((result) => {
                    res.status(200).json(formatToJSON(result));
    Severity: Critical
    Found in packages/optimise-core/src/controllers/demographicDataController.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                  if ((this.props.filter.visits && this.props.visitType === 1) ||
                      (this.props.filter.tests && visitHasTests) ||
                      (this.props.filter.treatments && visitHasMedications) ||
                      (this.props.filter.events && visitHasClinicalEvents))
                      shouldRender = true;
      Severity: Critical
      Found in packages/optimise-ui/src/components/patientProfile/patientChart.jsx - About 1 hr to fix

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

            static createDemographic({ body, user }, res) {
                if ((!body.hasOwnProperty('patient') || !body.hasOwnProperty('DOB') || !body.hasOwnProperty('gender') || !body.hasOwnProperty('dominant_hand')
                    || !body.hasOwnProperty('ethnicity') || !body.hasOwnProperty('country_of_origin'))) {
                    res.status(400).json(ErrorHelper(message.userError.MISSINGARGUMENT));
                    return;
        Severity: Minor
        Found in packages/optimise-core/src/controllers/demographicDataController.js - About 1 hr to fix

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

              render() {
          
                  if (this.props.data.demographicData) {
                      if (this.props.data.demographicData.gender === 1)
                          return null;

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

                render() {
                    const { data, searchString } = this.props;
                    const ind = data.aliasId.toLowerCase().indexOf(searchString.toLowerCase());
                    const styledName = (
                        <span>
            Severity: Minor
            Found in packages/optimise-ui/src/components/searchPatient/searchPatient.jsx - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language