CLOSER-Cohorts/archivist

View on GitHub

Showing 2,591 of 2,591 total issues

Avoid too many return statements within this function.
Open

  return <Route {...props} />;
Severity: Major
Found in react/src/AuthRoute.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return {...state, ...{[key]: {error: true, errorMessage: action.payload.error}}}
Severity: Major
Found in react/src/reducers/index.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

  return (
    <Button variant='outlined'>
      <Link to={to}>{label}</Link>
    </Button>    
  );
Severity: Major
Found in react/src/components/AuthButton.js - About 30 mins to fix

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

            <AuthRoute type="editor" exact path={routes.instruments.instrument.build.show} component={InstrumentBuild} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

            <AuthRoute type="admin" exact path={routes.admin.instruments.instrument.edit} component={AdminInstrumentEdit} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

            <AuthRoute type="admin" exact path={routes.admin.datasets.dataset.show} component={AdminDatasetView} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

            <AuthRoute type="editor" exact path={routes.instruments.instrument.build.ccLoops} component={InstrumentCcLoops} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

            <AuthRoute type="editor" exact path={routes.instruments.instrument.build.ccSequences} component={InstrumentCcSequences} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

            <AuthRoute type="admin" exact path={routes.admin.instruments.instrument.show} component={AdminInstrumentView} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

            <AuthRoute type="admin" exact path={routes.admin.users.user.edit} component={AdminUserEdit} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 138..138

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

            <AuthRoute type="admin" exact path={routes.admin.instruments.instrument.datasets} component={AdminInstrumentDatasetLink} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135

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

            <AuthRoute type="editor" exact path={routes.instruments.instrument.build.ccConditions} component={InstrumentCcConditions} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

    if (status.error) {
      errorMessage = status.errorMessage
    } else if (row.errors) {
      errorMessage = row.errors
    }
Severity: Major
Found in react/src/pages/DatasetView.js and 4 other locations - About 30 mins to fix
react/src/pages/DatasetView.js on lines 155..159
react/src/pages/DatasetView.js on lines 541..545
react/src/pages/InstrumentMap.js on lines 174..178
react/src/pages/InstrumentMap.js on lines 232..236

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

            <AuthRoute type="editor" exact path={routes.instruments.instrument.build.ccQuestions} component={InstrumentCcQuestions} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

            <AuthRoute type="editor" exact path={routes.instruments.instrument.map.show} component={InstrumentMap} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 122..122
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

            <AuthRoute type="editor" exact path={routes.instruments.instrument.build.ccStatements} component={InstrumentCcStatements} />
Severity: Major
Found in react/src/App.js and 11 other locations - About 30 mins to fix
react/src/App.js on lines 100..100
react/src/App.js on lines 101..101
react/src/App.js on lines 118..118
react/src/App.js on lines 119..119
react/src/App.js on lines 120..120
react/src/App.js on lines 121..121
react/src/App.js on lines 128..128
react/src/App.js on lines 132..132
react/src/App.js on lines 133..133
react/src/App.js on lines 135..135
react/src/App.js on lines 138..138

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

                  if(status.error){
                    errorMessage = status.errorMessage
                  }else if(row.errors){
                    errorMessage = row.errors
                  }
Severity: Major
Found in react/src/pages/DatasetView.js and 4 other locations - About 30 mins to fix
react/src/pages/DatasetView.js on lines 155..159
react/src/pages/DatasetView.js on lines 194..198
react/src/pages/InstrumentMap.js on lines 174..178
react/src/pages/InstrumentMap.js on lines 232..236

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

    if (status.error) {
      errorMessage = status.errorMessage
    } else if (row.errors) {
      errorMessage = row.errors
    }
Severity: Major
Found in react/src/pages/DatasetView.js and 4 other locations - About 30 mins to fix
react/src/pages/DatasetView.js on lines 194..198
react/src/pages/DatasetView.js on lines 541..545
react/src/pages/InstrumentMap.js on lines 174..178
react/src/pages/InstrumentMap.js on lines 232..236

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

  if (status.error) {
    errorMessage = status.errorMessage
  } else if (item.errors) {
    errorMessage = item.errors
  }
Severity: Major
Found in react/src/pages/InstrumentMap.js and 4 other locations - About 30 mins to fix
react/src/pages/DatasetView.js on lines 155..159
react/src/pages/DatasetView.js on lines 194..198
react/src/pages/DatasetView.js on lines 541..545
react/src/pages/InstrumentMap.js on lines 174..178

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

  if(status.error){
    errorMessage = status.errorMessage
  }else if(item.errors){
    errorMessage = item.errors
  }
Severity: Major
Found in react/src/pages/InstrumentMap.js and 4 other locations - About 30 mins to fix
react/src/pages/DatasetView.js on lines 155..159
react/src/pages/DatasetView.js on lines 194..198
react/src/pages/DatasetView.js on lines 541..545
react/src/pages/InstrumentMap.js on lines 232..236

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