CLOSER-Cohorts/archivist

View on GitHub
react/src/reducers/index.js

Summary

Maintainability
F
2 wks
Test Coverage

File index.js has 447 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { combineReducers } from "redux";
import { get } from 'lodash'

const serializeSearchesArrayToObject = (array) =>
  array.reduce((obj, item) => {
Severity: Minor
Found in react/src/reducers/index.js - About 6 hrs to fix

Function statuses has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

const statuses = (state = {}, action) => {

  var key;

  switch (action.type) {
Severity: Minor
Found in react/src/reducers/index.js - About 55 mins 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

Avoid too many return statements within this function.
Open

          return { ...state, ...{ [key]: { error: true, errors: action.payload.error, errorMessage: '' } } }
Severity: Major
Found in react/src/reducers/index.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

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

const codeLists = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_CODE_LISTS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.codeLists)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 1 day to fix
react/src/reducers/index.js on lines 213..233
react/src/reducers/index.js on lines 235..255
react/src/reducers/index.js on lines 331..351
react/src/reducers/index.js on lines 363..383
react/src/reducers/index.js on lines 385..405

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

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

const responseDomainTexts = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_RESPONSE_DOMAIN_TEXTS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.responseDomainTexts)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 1 day to fix
react/src/reducers/index.js on lines 213..233
react/src/reducers/index.js on lines 235..255
react/src/reducers/index.js on lines 309..329
react/src/reducers/index.js on lines 331..351
react/src/reducers/index.js on lines 385..405

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

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

const questionItems = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_QUESTION_ITEMS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.questions)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 1 day to fix
react/src/reducers/index.js on lines 235..255
react/src/reducers/index.js on lines 309..329
react/src/reducers/index.js on lines 331..351
react/src/reducers/index.js on lines 363..383
react/src/reducers/index.js on lines 385..405

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

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

const questionGrids = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_QUESTION_GRIDS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.questions)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 1 day to fix
react/src/reducers/index.js on lines 213..233
react/src/reducers/index.js on lines 309..329
react/src/reducers/index.js on lines 331..351
react/src/reducers/index.js on lines 363..383
react/src/reducers/index.js on lines 385..405

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

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

const responseDomainNumerics = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_RESPONSE_DOMAIN_NUMERICS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.responseDomainNumerics)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 1 day to fix
react/src/reducers/index.js on lines 213..233
react/src/reducers/index.js on lines 235..255
react/src/reducers/index.js on lines 309..329
react/src/reducers/index.js on lines 363..383
react/src/reducers/index.js on lines 385..405

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

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

const responseDomainDatetimes = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_RESPONSE_DOMAIN_DATETIMES':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.responseDomainDatetimes)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 1 day to fix
react/src/reducers/index.js on lines 213..233
react/src/reducers/index.js on lines 235..255
react/src/reducers/index.js on lines 309..329
react/src/reducers/index.js on lines 331..351
react/src/reducers/index.js on lines 363..383

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

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

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

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

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

Refactorings

Further Reading

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

const datasetImportMappings = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_DATASET_IMPORT_MAPPINGS':
      return {...state, ...{[action.payload.id]: serializeArrayToObject(action.payload.importMappings)}}
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 6 hrs to fix
react/src/reducers/index.js on lines 267..279
react/src/reducers/index.js on lines 295..307

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

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

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

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

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

Refactorings

Further Reading

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

const datasetVariables = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_DATASET_VARIABLES':
      return {...state, ...{[action.payload.datasetId]: serializeArrayToObject(action.payload.variables)}}
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 6 hrs to fix
react/src/reducers/index.js on lines 281..293
react/src/reducers/index.js on lines 295..307

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

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

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

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

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

Refactorings

Further Reading

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

const instrumentImportMappings = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_IMPORT_MAPPINGS':
      return {...state, ...{[action.payload.id]: serializeArrayToObject(action.payload.importMappings)}}
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 6 hrs to fix
react/src/reducers/index.js on lines 267..279
react/src/reducers/index.js on lines 281..293

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

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

const cc_sequences = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_SEQUENCES':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.sequences)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 5 hrs to fix
react/src/reducers/index.js on lines 142..154
react/src/reducers/index.js on lines 156..168
react/src/reducers/index.js on lines 171..183
react/src/reducers/index.js on lines 185..197
react/src/reducers/index.js on lines 199..211

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

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

const cc_conditions = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_CONDITIONS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.conditions)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 5 hrs to fix
react/src/reducers/index.js on lines 128..140
react/src/reducers/index.js on lines 142..154
react/src/reducers/index.js on lines 171..183
react/src/reducers/index.js on lines 185..197
react/src/reducers/index.js on lines 199..211

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

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

const cc_loops = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_LOOPS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.loops)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 5 hrs to fix
react/src/reducers/index.js on lines 128..140
react/src/reducers/index.js on lines 142..154
react/src/reducers/index.js on lines 156..168
react/src/reducers/index.js on lines 185..197
react/src/reducers/index.js on lines 199..211

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

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

const cc_questions = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_QUESTIONS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.questions)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 5 hrs to fix
react/src/reducers/index.js on lines 128..140
react/src/reducers/index.js on lines 142..154
react/src/reducers/index.js on lines 156..168
react/src/reducers/index.js on lines 171..183
react/src/reducers/index.js on lines 185..197

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

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

const cc_statements = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_STATEMENTS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.statements)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 5 hrs to fix
react/src/reducers/index.js on lines 128..140
react/src/reducers/index.js on lines 156..168
react/src/reducers/index.js on lines 171..183
react/src/reducers/index.js on lines 185..197
react/src/reducers/index.js on lines 199..211

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

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

const response_units = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_RESPONSE_UNITS':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.responseUnits)}}
Severity: Major
Found in react/src/reducers/index.js and 5 other locations - About 5 hrs to fix
react/src/reducers/index.js on lines 128..140
react/src/reducers/index.js on lines 142..154
react/src/reducers/index.js on lines 156..168
react/src/reducers/index.js on lines 171..183
react/src/reducers/index.js on lines 199..211

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

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

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

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

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

Refactorings

Further Reading

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

const datasets = (state = [], action) => {
  switch (action.type) {
    case 'LOAD_DATASETS':
      return serializeArrayToObject(action.payload.datasets)
    case 'LOAD_DATASET':
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 4 hrs to fix
react/src/reducers/index.js on lines 43..56
react/src/reducers/index.js on lines 84..96

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

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

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

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

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

Refactorings

Further Reading

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

const users = (state = [], action) => {
  switch (action.type) {
    case 'LOAD_USERS':
      return serializeArrayToObject(action.payload.users)
    case 'LOAD_USER':
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 4 hrs to fix
react/src/reducers/index.js on lines 43..56
react/src/reducers/index.js on lines 70..82

Duplicated Code

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

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

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

Tuning

This issue has a mass of 131.

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

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

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

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

Refactorings

Further Reading

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

const instruments = (state = [], action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENTS':
      return serializeSearchesArrayToObject(action.payload.instruments)
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 4 hrs to fix
react/src/reducers/index.js on lines 70..82
react/src/reducers/index.js on lines 84..96

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

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

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

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

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

Refactorings

Further Reading

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

const responseDomainCodes = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_RESPONSE_DOMAIN_CODES':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.responseDomainCodes)}}
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 1 hr to fix
react/src/reducers/index.js on lines 257..265
react/src/reducers/index.js on lines 407..415

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

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

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

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

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

Refactorings

Further Reading

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

const variables = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_VARIABLES':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.variables)}}
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 1 hr to fix
react/src/reducers/index.js on lines 353..361
react/src/reducers/index.js on lines 407..415

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

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

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

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

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

Refactorings

Further Reading

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

const categories = (state = {}, action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_CATEGORIES':
      return {...state, ...{[action.payload.instrumentId]: serializeArrayToObject(action.payload.categories)}}
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 1 hr to fix
react/src/reducers/index.js on lines 257..265
react/src/reducers/index.js on lines 353..361

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

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

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

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

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

Refactorings

Further Reading

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

const instrumentMappingStats = (state = [], action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_MAPPING_STATS':
      return {...state, ...{[action.payload.instrumentId]: action.payload.mapping_stats}}
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 1 hr to fix
react/src/reducers/index.js on lines 98..106
react/src/reducers/index.js on lines 118..126

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

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

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

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

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

Refactorings

Further Reading

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

const datasetMappingStats = (state = [], action) => {

  switch (action.type) {
    case 'LOAD_DATASET_MAPPING_STATS':
      return {...state, ...{[action.payload.datasetId]: action.payload.mapping_stats}}
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 1 hr to fix
react/src/reducers/index.js on lines 98..106
react/src/reducers/index.js on lines 108..116

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

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

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

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

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

Refactorings

Further Reading

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

const instrumentStats = (state = [], action) => {

  switch (action.type) {
    case 'LOAD_INSTRUMENT_STATS':
      return {...state, ...{[action.payload.instrumentId]: action.payload.stats}}
Severity: Major
Found in react/src/reducers/index.js and 2 other locations - About 1 hr to fix
react/src/reducers/index.js on lines 108..116
react/src/reducers/index.js on lines 118..126

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

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

    case 'SAVING':
      key = action.payload.type + ':' + action.payload.id
      return {...state, ...{[key]: {saving: true}}}
Severity: Major
Found in react/src/reducers/index.js and 1 other location - About 1 hr to fix
react/src/reducers/index.js on lines 449..451

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

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

    case 'SAVED':
      key = action.payload.type + ':' + action.payload.id
      return {...state, ...{[key]: {saved: true}}}
Severity: Major
Found in react/src/reducers/index.js and 1 other location - About 1 hr to fix
react/src/reducers/index.js on lines 446..448

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

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 serializeArrayToObject = (array) =>
  array.reduce((obj, item) => {
    obj[item.id] = item
   return obj
  }, {})
Severity: Minor
Found in react/src/reducers/index.js and 1 other location - About 35 mins to fix
react/src/reducers/index.js on lines 4..8

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

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 serializeSearchesArrayToObject = (array) =>
  array.reduce((obj, item) => {
    obj[item.prefix] = item
   return obj
  }, {})
Severity: Minor
Found in react/src/reducers/index.js and 1 other location - About 35 mins to fix
react/src/reducers/index.js on lines 10..14

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

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

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
Open

import { combineReducers } from "redux";
Severity: Minor
Found in react/src/reducers/index.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

There are no issues that match your filters.

Category
Status