dsi-icl/optimise

View on GitHub
packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx

Summary

Maintainability
F
5 days
Test Coverage

File fullTimeline.jsx has 438 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Component, Fragment } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import moment from 'moment';
Severity: Minor
Found in packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx - About 6 hrs to fix

    Function getDerivedStateFromProps has 135 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static getDerivedStateFromProps(props, state) {
    
            let items = [];
            let edssPoints = {};
            let maxTimeStart = state.defaultTimeStart;
    Severity: Major
    Found in packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx - About 5 hrs to fix

      Function itemRenderer has 126 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          itemRenderer({ item, getItemProps, timelineContext }) {
      
              let itemProps = getItemProps(item.itemProps);
              const itemPropsStyle = {
                  ...itemProps.style,
      Severity: Major
      Found in packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx - About 5 hrs to fix

        Function itemRenderer has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            itemRenderer({ item, getItemProps, timelineContext }) {
        
                let itemProps = getItemProps(item.itemProps);
                const itemPropsStyle = {
                    ...itemProps.style,
        Severity: Minor
        Found in packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            render() {
                const {
                    groups,
                    items,
                    defaultTimeStart,
        Severity: Major
        Found in packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx - About 2 hrs to fix

          Function constructor has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              constructor(props) {
                  super(props);
          
                  this.timeBoudary = this.timeBoudary.bind(this);
                  this.groupRenderer = this.groupRenderer.bind(this);
          Severity: Minor
          Found in packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx - About 1 hr to fix

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

                    items.push({
                        id: 'edss_plotter_padding',
                        group: 5,
                        start: moment(maxTimeStart).subtract(1, 'day').valueOf(),
                        end: moment().add(1, 'day').valueOf(),
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 215..223

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

            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

                    items.push({
                        id: 'edss_plotter',
                        group: 5,
                        start: moment(maxTimeStart).subtract(1, 'day').valueOf(),
                        end: moment().add(1, 'day').valueOf(),
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 225..233

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

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

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

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

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

            Refactorings

            Further Reading

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

                                    'data-tip': `${props.availableFields.drugs_Hash[0][t.drug].name} (${props.availableFields.drugs_Hash[0][t.drug].module})`
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 112..112

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

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

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

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

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

            Refactorings

            Further Reading

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

                                title: `${props.availableFields.drugs_Hash[0][t.drug].name} (${props.availableFields.drugs_Hash[0][t.drug].module})`,
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 119..119

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

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

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

                        if (parseFloat(item.start) > timelineContext.visibleTimeStart)
                            x2 = x2 + ((timelineContext.visibleTimeStart - parseFloat(item.start)) * timelineContext.timelineWidth / unit);
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 378..379

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

            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

                        if (parseFloat(item.start) > timelineContext.visibleTimeStart)
                            x2i = x2i + ((timelineContext.visibleTimeStart - parseFloat(item.start)) * timelineContext.timelineWidth / unit);
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 312..313

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

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

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

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

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

            Refactorings

            Further Reading

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

                            if (maxTimeStart.valueOf() > moment(t.expectedOccurDate, 'x').valueOf())
                                maxTimeStart = moment(t.expectedOccurDate, 'x').toDate();
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 106..107
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 139..140
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 173..174
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 193..194
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 195..196

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

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

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

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

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

            Refactorings

            Further Reading

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

                            if (maxTimeStart.valueOf() > moment(t.actualOccurredDate, 'x').valueOf())
                                maxTimeStart = moment(t.actualOccurredDate, 'x').toDate();
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 106..107
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 139..140
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 175..176
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 193..194
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 195..196

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

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

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

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

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

            Refactorings

            Further Reading

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

                            if (maxTimeStart.valueOf() > moment(v.visitDate, 'x').valueOf())
                                maxTimeStart = moment(v.visitDate, 'x').toDate();
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 106..107
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 173..174
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 175..176
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 193..194
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 195..196

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

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

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

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

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

            Refactorings

            Further Reading

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

                            if (maxTimeStart.valueOf() > moment(c.endDate, 'x').valueOf())
                                maxTimeStart = moment(c.endDate, 'x').toDate();
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 106..107
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 139..140
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 173..174
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 175..176
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 193..194

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

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

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

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

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

            Refactorings

            Further Reading

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

                            if (maxTimeStart.valueOf() > moment(t.startDate, 'x').valueOf())
                                maxTimeStart = moment(t.startDate, 'x').toDate();
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 139..140
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 173..174
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 175..176
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 193..194
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 195..196

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

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

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

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

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

            Refactorings

            Further Reading

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

                            if (maxTimeStart.valueOf() > moment(c.dateStartDate, 'x').valueOf())
                                maxTimeStart = moment(c.dateStartDate, 'x').toDate();
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 106..107
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 139..140
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 173..174
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 175..176
            packages/optimise-ui/src/components/patientProfile/fullTimeline.jsx on lines 195..196

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

            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

            let keys = {
                groupIdKey: 'id',
                groupTitleKey: 'title',
                groupRightTitleKey: 'rightTitle',
                itemIdKey: 'id',
            packages/optimise-core/src/utils/selector-utils.js on lines 64..64

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

            There are no issues that match your filters.

            Category
            Status