af83/chouette-core

View on GitHub
app/packs/src/vehicle_journeys/reducers/modal.js

Summary

Maintainability
F
1 wk
Test Coverage

Function modal has 279 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function modal(state = {}, action) {
  switch (action.type) {
    case 'OPEN_CONFIRM_MODAL':
      $('#ConfirmModal').modal('show')
      return _.assign({}, state, {
Severity: Major
Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 1 day to fix

    Function modal has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function modal(state = {}, action) {
      switch (action.type) {
        case 'OPEN_CONFIRM_MODAL':
          $('#ConfirmModal').modal('show')
          return _.assign({}, state, {
    Severity: Minor
    Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 4 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    File modal.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import _ from 'lodash'
    
    let vehicleJourneysModal, newModalProps, vehicleJourney, alreadyPresent, notAlreadyPresent, newReferentialCodesArray, selectedConstraintZones, selectedStopAreasConstraints
    
    export default function modal(state = {}, action) {
    Severity: Minor
    Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 2 hrs to fix

      Avoid too many return statements within this function.
      Open

              return _.assign({}, state, {modalProps: newModalProps})
      Severity: Major
      Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return _.assign({}, state, {modalProps: newModalProps})
        Severity: Major
        Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return _.assign({}, state, {modalProps: newModalProps})
          Severity: Major
          Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return {
                    ...state,
                    modalProps: {
                      ...state.modalProps,
                      vehicleJourney: {
            Severity: Major
            Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return _.assign({}, state, {modalProps: newModalProps})
              Severity: Major
              Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return _.assign({}, state, {modalProps: newModalProps})
                Severity: Major
                Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return _.assign({}, state, {modalProps: newModalProps})
                  Severity: Major
                  Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return {
                            ...state,
                            modalProps: {
                              ...state.modalProps,
                              vehicleJourney: {
                    Severity: Major
                    Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return _.assign({}, state, {modalProps: newModalProps})
                      Severity: Major
                      Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              if(alreadyPresent){ return state }
                        Severity: Major
                        Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return {
                                  type: 'constraint_exclusions_edit',
                                  modalProps: {
                                    vehicleJourneys: vehicleJourneys,
                                    selectedConstraintZones: uniqExclusions,
                          Severity: Major
                          Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return _.assign({}, state, {modalProps: newModalProps})
                            Severity: Major
                            Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return _.assign({}, state, {modalProps: newModalProps})
                              Severity: Major
                              Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return {
                                        type: 'create',
                                        modalProps: window.jpOrigin ? {selectedJPModal: selectedJP} : {},
                                        confirmModal: {}
                                      }
                                Severity: Major
                                Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return _.assign({}, state, {modalProps: newModalProps})
                                  Severity: Major
                                  Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          if(alreadyPresent){ return state }
                                    Severity: Major
                                    Found in app/packs/src/vehicle_journeys/reducers/modal.js - About 30 mins to fix

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

                                          case 'SELECT_STOPAREAS_CONSTRAINT_MODAL':
                                            selectedStopAreasConstraints = state.modalProps.selectedStopAreasConstraints
                                            alreadyPresent = false
                                            selectedStopAreasConstraints.map((zone_id, i)=>{
                                              if(zone_id == parseInt(action.selectedZone.id)){
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 6 hrs to fix
                                      app/packs/src/vehicle_journeys/reducers/modal.js on lines 169..180

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

                                      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 'SELECT_CONSTRAINT_ZONE_MODAL':
                                            selectedConstraintZones = state.modalProps.selectedConstraintZones
                                            alreadyPresent = false
                                            selectedConstraintZones.map((zone_id, i)=>{
                                              if(zone_id == parseInt(action.selectedZone.id)){
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 6 hrs to fix
                                      app/packs/src/vehicle_journeys/reducers/modal.js on lines 191..202

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

                                      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 'DELETE_STOPAREAS_CONSTRAINT_MODAL':
                                              newModalProps = JSON.parse(JSON.stringify(state.modalProps))
                                              selectedStopAreasConstraints = state.modalProps.selectedStopAreasConstraints.slice(0)
                                              selectedStopAreasConstraints.map((zone_id, i) =>{
                                                if(zone_id == parseInt(action.constraintZone.id)){
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 5 hrs to fix
                                      app/packs/src/vehicle_journeys/reducers/modal.js on lines 181..190

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

                                      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 'DELETE_CONSTRAINT_ZONE_MODAL':
                                              newModalProps = JSON.parse(JSON.stringify(state.modalProps))
                                              selectedConstraintZones = state.modalProps.selectedConstraintZones.slice(0)
                                              selectedConstraintZones.map((zone_id, i) =>{
                                                if(zone_id == parseInt(action.constraintZone.id)){
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 5 hrs to fix
                                      app/packs/src/vehicle_journeys/reducers/modal.js on lines 203..212

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

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                              if(vj.ignored_stop_area_routing_constraint_ids){
                                                vj.ignored_stop_area_routing_constraint_ids.map((exclusion, j) =>{
                                                  let found = false
                                                  uniqStopAreasExclusions.map((id, i)=>{
                                                    if(id == parseInt(exclusion)){
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 3 hrs to fix
                                      app/packs/src/vehicle_journeys/reducers/modal.js on lines 83..95

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

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                              if(vj.ignored_routing_contraint_zone_ids){
                                                vj.ignored_routing_contraint_zone_ids.map((exclusion, j) =>{
                                                  let found = false
                                                  uniqExclusions.map((id, i)=>{
                                                    if(id == parseInt(exclusion)){
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 3 hrs to fix
                                      app/packs/src/vehicle_journeys/reducers/modal.js on lines 96..108

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

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                            if(action.footnote.line_notice){
                                              if (action.isShown){
                                                newModalProps.vehicleJourney.line_notices.push(action.footnote)
                                              }else{
                                                newModalProps.vehicleJourney.line_notices = newModalProps.vehicleJourney.line_notices.filter((f) => {return f.id != action.footnote.id })
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 3 hrs to fix
                                      app/packs/src/vehicle_journeys/reducers/modal.js on lines 34..40

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

                                      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

                                            else{
                                              if (action.isShown){
                                                newModalProps.vehicleJourney.footnotes.push(action.footnote)
                                              }else{
                                                newModalProps.vehicleJourney.footnotes = newModalProps.vehicleJourney.footnotes.filter((f) => {return f.id != action.footnote.id })
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 3 hrs to fix
                                      app/packs/src/vehicle_journeys/reducers/modal.js on lines 27..33

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 97.

                                      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 'SELECT_CP_EDIT_MODAL':
                                            vehicleJourney =  _.assign({}, state.modalProps.vehicleJourney, {company: action.selectedItem})
                                            newModalProps = _.assign({}, state.modalProps, {vehicleJourney})
                                            return _.assign({}, state, {modalProps: newModalProps})
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 2 hrs to fix
                                      app/packs/src/journey_patterns/reducers/modal.js on lines 24..27

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

                                      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 'UNSELECT_CP_EDIT_MODAL':
                                            vehicleJourney =  _.assign({}, state.modalProps.vehicleJourney, {company: undefined})
                                            newModalProps = _.assign({}, state.modalProps, {vehicleJourney})
                                            return _.assign({}, state, {modalProps: newModalProps})
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 2 hrs to fix
                                      app/packs/src/journey_patterns/reducers/modal.js on lines 28..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 84.

                                      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

                                          case 'SELECT_TT_CALENDAR_MODAL':
                                            newModalProps = _.assign({}, state.modalProps, {selectedTimetable : action.selectedItem})
                                            return _.assign({}, state, {modalProps: newModalProps})
                                      Severity: Major
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 3 other locations - About 1 hr to fix
                                      app/packs/src/vehicle_journeys/reducers/filters.js on lines 44..46
                                      app/packs/src/vehicle_journeys/reducers/filters.js on lines 47..49
                                      app/packs/src/vehicle_journeys/reducers/filters.js on lines 50..52

                                      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

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

                                          case 'OPEN_CONFIRM_MODAL':
                                            $('#ConfirmModal').modal('show')
                                            return _.assign({}, state, {
                                              type: 'confirm',
                                              confirmModal: {
                                      Severity: Minor
                                      Found in app/packs/src/vehicle_journeys/reducers/modal.js and 1 other location - About 55 mins to fix
                                      app/packs/src/journey_patterns/reducers/modal.js on lines 7..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 54.

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

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

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

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

                                      Refactorings

                                      Further Reading

                                      There are no issues that match your filters.

                                      Category
                                      Status