dsi-icl/optimise

View on GitHub

Showing 1,390 of 1,390 total issues

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

                <Route exact path='/administration/update' render={({ match }) => <Update match={match} />} />
Severity: Major
Found in packages/optimise-ui/src/components/admin/router.jsx and 9 other locations - About 30 mins to fix
packages/optimise-ui/src/components/admin/router.jsx on lines 15..15
packages/optimise-ui/src/components/admin/router.jsx on lines 17..17
packages/optimise-ui/src/components/admin/router.jsx on lines 18..18
packages/optimise-ui/src/components/admin/router.jsx on lines 20..20
packages/optimise-ui/src/components/admin/router.jsx on lines 21..21
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 28..28
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 31..31
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 32..32
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 33..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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

                <Route exact path='/administration/patientMappings' render={({ match }) => <PatientMappings match={match} />} />
Severity: Major
Found in packages/optimise-ui/src/components/admin/router.jsx and 9 other locations - About 30 mins to fix
packages/optimise-ui/src/components/admin/router.jsx on lines 15..15
packages/optimise-ui/src/components/admin/router.jsx on lines 17..17
packages/optimise-ui/src/components/admin/router.jsx on lines 18..18
packages/optimise-ui/src/components/admin/router.jsx on lines 19..19
packages/optimise-ui/src/components/admin/router.jsx on lines 20..20
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 28..28
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 31..31
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 32..32
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 33..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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

                <Route exact path='/administration/sync' render={({ match }) => <Sync match={match} />} />
Severity: Major
Found in packages/optimise-ui/src/components/admin/router.jsx and 9 other locations - About 30 mins to fix
packages/optimise-ui/src/components/admin/router.jsx on lines 15..15
packages/optimise-ui/src/components/admin/router.jsx on lines 17..17
packages/optimise-ui/src/components/admin/router.jsx on lines 18..18
packages/optimise-ui/src/components/admin/router.jsx on lines 19..19
packages/optimise-ui/src/components/admin/router.jsx on lines 21..21
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 28..28
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 31..31
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 32..32
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 33..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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

                    <Route exact path='/createPatient/:patientIdCreated' render={({ match }) => <CreatePatient match={match} />} />
Severity: Major
Found in packages/optimise-ui/src/components/scaffold/farRightPanel.jsx and 9 other locations - About 30 mins to fix
packages/optimise-ui/src/components/admin/router.jsx on lines 15..15
packages/optimise-ui/src/components/admin/router.jsx on lines 17..17
packages/optimise-ui/src/components/admin/router.jsx on lines 18..18
packages/optimise-ui/src/components/admin/router.jsx on lines 19..19
packages/optimise-ui/src/components/admin/router.jsx on lines 20..20
packages/optimise-ui/src/components/admin/router.jsx on lines 21..21
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 31..31
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 32..32
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 33..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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

                    <Route exact path='/administration/users' render={({ match }) => <UserActions match={match} />} />
Severity: Major
Found in packages/optimise-ui/src/components/scaffold/farRightPanel.jsx and 9 other locations - About 30 mins to fix
packages/optimise-ui/src/components/admin/router.jsx on lines 15..15
packages/optimise-ui/src/components/admin/router.jsx on lines 17..17
packages/optimise-ui/src/components/admin/router.jsx on lines 18..18
packages/optimise-ui/src/components/admin/router.jsx on lines 19..19
packages/optimise-ui/src/components/admin/router.jsx on lines 20..20
packages/optimise-ui/src/components/admin/router.jsx on lines 21..21
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 28..28
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 31..31
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 32..32

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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

                <Route exact path='/administration/log' render={({ match }) => <Log match={match} />} />
Severity: Major
Found in packages/optimise-ui/src/components/admin/router.jsx and 9 other locations - About 30 mins to fix
packages/optimise-ui/src/components/admin/router.jsx on lines 17..17
packages/optimise-ui/src/components/admin/router.jsx on lines 18..18
packages/optimise-ui/src/components/admin/router.jsx on lines 19..19
packages/optimise-ui/src/components/admin/router.jsx on lines 20..20
packages/optimise-ui/src/components/admin/router.jsx on lines 21..21
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 28..28
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 31..31
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 32..32
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 33..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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

                    <Route exact path='/administration/users/create' render={({ match }) => <UserCreate match={match} />} />
Severity: Major
Found in packages/optimise-ui/src/components/scaffold/farRightPanel.jsx and 9 other locations - About 30 mins to fix
packages/optimise-ui/src/components/admin/router.jsx on lines 15..15
packages/optimise-ui/src/components/admin/router.jsx on lines 17..17
packages/optimise-ui/src/components/admin/router.jsx on lines 18..18
packages/optimise-ui/src/components/admin/router.jsx on lines 19..19
packages/optimise-ui/src/components/admin/router.jsx on lines 20..20
packages/optimise-ui/src/components/admin/router.jsx on lines 21..21
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 28..28
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 32..32
packages/optimise-ui/src/components/scaffold/farRightPanel.jsx on lines 33..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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

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

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

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

Refactorings

Further Reading

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

                <Link to={`/patientProfile/${this.props.match.params.patientId}/${item.id}`}>
                    <div className={style.timelineBackground}></div>
                    <div className={style.timelineTextContent}>{item.title}</div>
                </Link>
packages/optimise-ui/src/components/EDSScalculator/calculator.jsx on lines 235..235
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 318..340
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 382..389

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

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

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

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

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

Refactorings

Further Reading

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

                    <Link to={`/patientProfile/${this.props.match.params.patientId}/${item.id}`}>
                        <div className={style.timelineBackground} style={{ width: (x2i - x1i), maxWidth: timelineContext.timelineWidth }}>
                            <svg height={40} width={timelineContext.timelineWidth}>
                                {overlays}
                            </svg>
packages/optimise-ui/src/components/EDSScalculator/calculator.jsx on lines 235..235
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 318..340
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 416..419

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

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

    _handleExportAllCDISC(e) {
        e.preventDefault();

        let opener = window.ipcOpen || window.open;
        opener('/api/export/?cdisc');
Severity: Minor
Found in packages/optimise-ui/src/components/exportCDSIC/exportSet.jsx and 2 other locations - About 30 mins to fix
packages/optimise-ui/src/components/admin/patientMappings.jsx on lines 10..15
packages/optimise-ui/src/components/exportCDSIC/exportSet.jsx on lines 19..24

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

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

    _handleExportPatientMappings(e) {
        e.preventDefault();

        let opener = window.ipcOpen || window.open;
        opener('/api/export?patientMappings');
Severity: Minor
Found in packages/optimise-ui/src/components/admin/patientMappings.jsx and 2 other locations - About 30 mins to fix
packages/optimise-ui/src/components/exportCDSIC/exportSet.jsx on lines 19..24
packages/optimise-ui/src/components/exportCDSIC/exportSet.jsx on lines 33..38

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

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

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

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

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

Refactorings

Further Reading

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

                    <Link to={`/patientProfile/${this.props.match.params.patientId}/${item.id}`}>
                        <div className={style.timelineBackground} style={{ width: timelineContext.timelineWidth }}>
                            <svg height={40} width={timelineContext.timelineWidth}>
                                {x2 - x1 > 5 ?
                                    (
packages/optimise-ui/src/components/EDSScalculator/calculator.jsx on lines 235..235
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 382..389
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 416..419

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

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

                            {wannaUpdate ? <UpdateMedEntry location={this.props.location} renderedInFrontPage={this.props.renderedInFrontPage} data={treatment} /> : null}
packages/optimise-ui/src/components/createVisitFrontPage/templates/template.jsx on lines 28..37

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

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

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

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

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

Refactorings

Further Reading

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

                    <BackButton to={`/patientProfile/${this.props.match.params.patientId}/edit/msPerfMeas/${params.visitId}`} />
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 318..340
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 382..389
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 416..419

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

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 visitDataTransformed = visitData.reduce((a, e) => { a[e.field] = e.value; return a; }, {});
Severity: Minor
Found in packages/optimise-core/src/controllers/exportDataController.js and 1 other location - About 30 mins to fix
packages/optimise-ui/src/components/patientProfile/patientChart.jsx on lines 266..266

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

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

                            <label htmlFor='country_of_origin'>Country of origin:</label><br /> <SelectField name='country_of_origin' value={this.state['country_of_origin']} options={countries} handler={this._handleChange} /> <br /><br />
packages/optimise-ui/src/components/createPatient/createPatient.jsx on lines 246..246

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

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

    _handleExportAll(e) {
        e.preventDefault();

        let opener = window.ipcOpen || window.open;
        opener('/api/export');
Severity: Minor
Found in packages/optimise-ui/src/components/exportCDSIC/exportSet.jsx and 2 other locations - About 30 mins to fix
packages/optimise-ui/src/components/admin/patientMappings.jsx on lines 10..15
packages/optimise-ui/src/components/exportCDSIC/exportSet.jsx on lines 33..38

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

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

                    {visitFiltered.length === 1 ?
                        <RenderCurrentPage
                            match={this.props.match}
                            location={this.props.location}
                            pageNumberToElementMap={pageNumberToElementMap}
packages/optimise-ui/src/components/editMedicalElements/editMedication.jsx on lines 82..82

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

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

                            <label htmlFor='ethnicity'>Ethnicity:</label><br /> <SelectField name='ethnicity' value={this.state['ethnicity']} options={ethnicities} handler={this._handleChange} /> <br /><br />
packages/optimise-ui/src/components/createPatient/createPatient.jsx on lines 247..247

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

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 VSHashTable = VS.reduce((map, field) => { map[field.field] = field.value; return map; }, {});
packages/optimise-core/src/controllers/exportDataController.js on lines 356..356

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

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