dsi-icl/optimise

View on GitHub

Showing 1,390 of 1,390 total issues

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

        dataPromises.push(dbcon()('PATIENTS')
            .select('PATIENTS.uuid as USUBJID', 'PATIENT_DEMOGRAPHIC.DOB as BRTHDTC', 'GENDERS.value as SEX',
                'DOMINANT_HANDS.value as DOMINANT', 'ETHNICITIES.value as ETHNIC', 'COUNTRIES.value as COUNTRY')
            .leftOuterJoin('PATIENT_DEMOGRAPHIC', 'PATIENTS.id', 'PATIENT_DEMOGRAPHIC.patient')
            .leftOuterJoin('GENDERS', 'GENDERS.id', 'PATIENT_DEMOGRAPHIC.gender')
packages/optimise-core/src/controllers/exportDataController.js on lines 631..637

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

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

        dataPromises.push(dbcon()('MEDICAL_HISTORY')
            .select('PATIENTS.uuid as USUBJID', 'RELATIONS.value as SREL', 'CONDITIONS.value as MHTERM',
                'MEDICAL_HISTORY.startDate as MHSTDTC', 'MEDICAL_HISTORY.outcome as MHENRTPT', 'MEDICAL_HISTORY.resolvedYear as MHENDTC')
            .leftOuterJoin('RELATIONS', 'RELATIONS.id', 'MEDICAL_HISTORY.relation')
            .leftOuterJoin('CONDITIONS', 'CONDITIONS.id', 'MEDICAL_HISTORY.conditionName')
packages/optimise-core/src/controllers/exportDataController.js on lines 511..517

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

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 diagnosis = this.props.data.diagnosis.sort((a, b) => parseInt(b.diagnosisDate) - parseInt(a.diagnosisDate))[0];
packages/optimise-ui/src/components/patientProfile/patientProfile.jsx on lines 453..453

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

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

                                    <select defaultValue={'other'} onChange={this._handleResultChange}>
                                        <option value='Result One'>One</option>
                                        <option value='Result Two'>Two</option>
                                        <option value='Other'>Other</option>
                                    </select>
packages/optimise-ui/src/components/pregnancyForms/pregImage.jsx on lines 114..118

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

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

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

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

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

Refactorings

Further Reading

Function searchPatients has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static searchPatients({ query }, res) {  //get all list of patient if no query string; get similar if querystring is provided
        let queryfield = '';
        let queryvalue = '';
        if (Object.keys(query).length > 2) {
            res.status(400).json(ErrorHelper(message.userError.INVALIDQUERY));
Severity: Minor
Found in packages/optimise-core/src/controllers/patientController.js - About 1 hr to fix

    Function _getPregnancyStatus has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static _getPregnancyStatus(date, pregnancies) {
    
            const sortedPregnancies = pregnancies.sort((a, b) => {
                // Sort pregnancies in descending order based on startDate
                return parseFloat(b.startDate) - parseFloat(a.startDate);

      Function initializeComponent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          initializeComponent() {
              const { fields, patientProfile } = this.props;
      
              if (!patientProfile.fetching) {
                  const newPregnancyState = PregnancyEntry._getNewStateFromProps(this.props);

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

            render() {
                return (
                    <>
                        If you have a subscription for MedDRA coding, you can load it so that it can be chosen in adverse events.<br /><br />
                        The coding is provided in multiple files. "mdhier.asc" contains the hierarchy for SOC, HLGT, HLT, and PT codings. "llt.asc" contains the coding for LLT. <br /><br /><br />
        Severity: Minor
        Found in packages/optimise-ui/src/components/admin/meddra.jsx - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                  if ((body.hasOwnProperty('visitId') || body.hasOwnProperty('patient')) && body.hasOwnProperty('dateStartDate') && body.hasOwnProperty('type') &&
                      typeof body.visitId === 'number' && typeof body.dateStartDate === 'string' && typeof body.type === 'number') {
                      const momentStart = moment(body.dateStartDate, moment.ISO_8601);
                      if (!momentStart.isValid()) {
                          const msg = (momentStart.invalidAt() === undefined || momentStart.invalidAt() < 0) ? message.userError.INVALIDDATE : message.dateError[momentStart.invalidAt()];
          Severity: Major
          Found in packages/optimise-core/src/controllers/ceController.js - About 1 hr to fix

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

                componentDidUpdate() {
                    if (this.state.refreshReferences === true) {
                        this.references = null;
                        this.setState({
                            refreshReferences: false
            packages/optimise-ui/src/components/medicalData/testDataPage.jsx on lines 54..61
            packages/optimise-ui/src/components/medicalData/visitDataPage.jsx on lines 56..63

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

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

                componentDidUpdate() {
                    if (this.state.refreshReferences === true) {
                        this.references = null;
                        this.setState({
                            refreshReferences: false
            packages/optimise-ui/src/components/medicalData/ceDataPage.jsx on lines 52..59
            packages/optimise-ui/src/components/medicalData/visitDataPage.jsx on lines 56..63

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

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

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

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

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

            Refactorings

            Further Reading

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

                        <NavLink
                            to={`/patientProfile/${patientId}/visitFrontPage/${visitId}/page/${calcNextPage(currentPage)}${this._nextPageAnsweredYes(currentPage) ? '' : '/yes_or_no'}${searchString}`}
                        >
                            <button>Start</button>
                        </NavLink></div>;
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 53..53
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 57..61
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 78..80
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/yesOrNoQuestion/yesOrNoQuestion.jsx on lines 31..31

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

            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

                    if (!this.state.startDate || !this.state.startDate.isValid()) {
                        return this.setState({
                            error: 'Please indicate the start date of the treatment'
                        });
                    }
            packages/optimise-ui/src/components/createMedicalElements/createCE.jsx on lines 91..95
            packages/optimise-ui/src/components/createMedicalElements/createTreatment.jsx on lines 95..99
            packages/optimise-ui/src/components/patientProfile/patientProfile.jsx on lines 227..231

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

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

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

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

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

            Refactorings

            Further Reading

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

                        return <Redirect to={`/patientProfile/${patientId}/visitFrontPage/${visitId}/page/${calcNextPage(currentPage)}${this._nextPageAnsweredYes(currentPage) ? '' : '/yes_or_no'}${searchString}`} />;
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 57..61
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 78..80
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 85..89
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/yesOrNoQuestion/yesOrNoQuestion.jsx on lines 31..31

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

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

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

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

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

            Refactorings

            Further Reading

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

                                    <NavLink to={`/patientProfile/${patientId}/visitFrontPage/${visitId}/page/${calcNextPage(currentPage)}${this._nextPageAnsweredYes(currentPage) ? '' : '/yes_or_no'}${searchString}`}>
                                        <button onClick={onClickNext}>Continue<b>&gt;&gt;</b></button>
                                    </NavLink>
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 53..53
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 57..61
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 85..89
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/yesOrNoQuestion/yesOrNoQuestion.jsx on lines 31..31

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

            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

                    if (!this.state.startDate || !this.state.startDate.isValid()) {
                        return this.setState({
                            error: 'Please indicate the start date of the treatment'
                        });
                    }
            packages/optimise-ui/src/components/createMedicalElements/createCE.jsx on lines 91..95
            packages/optimise-ui/src/components/editMedicalElements/editMedication.jsx on lines 172..176
            packages/optimise-ui/src/components/patientProfile/patientProfile.jsx on lines 227..231

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

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

                componentDidUpdate() {
                    if (this.state.refreshReferences === true) {
                        this.references = null;
                        this.setState({
                            refreshReferences: false
            packages/optimise-ui/src/components/medicalData/ceDataPage.jsx on lines 52..59
            packages/optimise-ui/src/components/medicalData/testDataPage.jsx on lines 54..61

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

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

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

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

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

            Refactorings

            Further Reading

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

                            <NavLink to={`/patientProfile/${patientId}/visitFrontPage/${visitId}/page/${calcNextPage(currentPage)}${this._nextPageAnsweredYes(currentPage) ? '' : '/yes_or_no'}${searchString}`}><button className={style.no_button}>No; or Continue with missing data</button></NavLink>
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 53..53
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 57..61
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 78..80
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 85..89

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

            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

                    if (!this.state.startDate || !this.state.startDate.isValid()) {
                        return this.setState({
                            error: 'Please indicate the start date of the event'
                        });
                    }
            packages/optimise-ui/src/components/createMedicalElements/createTreatment.jsx on lines 95..99
            packages/optimise-ui/src/components/editMedicalElements/editMedication.jsx on lines 172..176
            packages/optimise-ui/src/components/patientProfile/patientProfile.jsx on lines 227..231

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

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

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

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

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

            Refactorings

            Further Reading

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

                        <NavLink
                            to={`/patientProfile/${patientId}/visitFrontPage/${visitId}/page/${calcLastPage(currentPage)}${this._lastPageAnsweredYes(currentPage) ? '' : '/yes_or_no'}${searchString}`}
                        >
                            <button><b>&lt;&lt;</b>Go back</button>
                        </NavLink>;
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 53..53
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 78..80
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/navigationButtons/navigationButtons.jsx on lines 85..89
            packages/optimise-ui/src/components/createVisitFrontPage/componentWrappers/yesOrNoQuestion/yesOrNoQuestion.jsx on lines 31..31

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

            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