eHealthAfrica/direct-delivery-dashboard

View on GitHub

Showing 318 of 318 total issues

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

    it('should call $modalInstance.dismiss()', function () {
      expect(modalInstance.dismiss).not.toHaveBeenCalled()
      ScheduleDataImportDialogCtrl.close()
      expect(modalInstance.dismiss).toHaveBeenCalled()
    })
src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 189..193
src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 195..199
src/app/planning/schedule/schedule-round.controller.spec.js on lines 134..138
src/app/planning/schedule/schedule-round.controller.spec.js on lines 140..144

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

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

  var locationMock = [
    {
      'id': 'ZONEID-STATEID',
      'key': ['3', 'State1'],
      'value': null,
Severity: Major
Found in src/app/reports/reports.mock.js and 1 other location - About 1 hr to fix
src/app/components/db/db.service.mock.js on lines 195..208

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

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

  var locationMock = [
    {
      'id': 'ZONEID-STATEID',
      'key': ['3', 'State1'],
      'value': null,
Severity: Major
Found in src/app/components/db/db.service.mock.js and 1 other location - About 1 hr to fix
src/app/reports/reports.mock.js on lines 83..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 63.

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

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

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

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

Refactorings

Further Reading

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

              return remoteDB.put(doc, doc._id)
                .then(function (res) {
                  doc._id = res.id
                  doc._rev = res.rev
                  return doc
Severity: Major
Found in src/app/components/db/db.service.js and 1 other location - About 1 hr to fix
src/app/components/db/db.service.js on lines 110..115

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

Function applyChanges has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _this.applyChanges = function (dailyDeliveries, schedulesInfo) {
      function applyUpdate (dailyDelivery) {
        var rowHash
        var scheduleInfo
        if (angular.isArray(dailyDelivery.facilityRounds)) {
Severity: Minor
Found in src/app/planning/schedule/schedules.service.js - About 1 hr to fix

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

        it('Should call scheduleService.applyChanges(param1, param2)', function () {
          expect(scheduleService.applyChanges).not.toHaveBeenCalled()
          ScheduleDataImportDialogCtrl.applyImport()
          expect(scheduleService.applyChanges).toHaveBeenCalled()
        })
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 131..135
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 189..193
    src/app/planning/schedule/schedule-round.controller.spec.js on lines 134..138
    src/app/planning/schedule/schedule-round.controller.spec.js on lines 140..144

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

        it('Should call getProcessedCSVRows()', function () {
          expect(ScheduleDataImportDialogCtrl.getProcessedCSVRows).not.toHaveBeenCalled()
          ScheduleDataImportDialogCtrl.applyImport()
          expect(ScheduleDataImportDialogCtrl.getProcessedCSVRows).toHaveBeenCalled()
        })
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 131..135
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 195..199
    src/app/planning/schedule/schedule-round.controller.spec.js on lines 134..138
    src/app/planning/schedule/schedule-round.controller.spec.js on lines 140..144

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

              return remoteDB.put(doc, doc._id)
                .then(function (res) {
                  doc._id = res.id
                  doc._rev = res.rev
                  return doc
    Severity: Major
    Found in src/app/components/db/db.service.js and 1 other location - About 1 hr to fix
    src/app/components/db/db.service.js on lines 44..49

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

        it('Should call $modal.open()', function () {
          expect($modal.open).not.toHaveBeenCalled()
          ScheduleRoundCtrl.openImportDialog()
          expect($modal.open).toHaveBeenCalled()
        })
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 131..135
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 189..193
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 195..199
    src/app/planning/schedule/schedule-round.controller.spec.js on lines 140..144

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

        it('Should call $modal.open() with expected parameters', function () {
          expect($modal.open).not.toHaveBeenCalled()
          ScheduleRoundCtrl.openImportDialog()
          expect($modal.open).toHaveBeenCalled()
        })
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 131..135
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 189..193
    src/app/planning/schedule/import/schedule-import-dialog.spec.js on lines 195..199
    src/app/planning/schedule/schedule-round.controller.spec.js on lines 134..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 63.

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

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

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

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

    Refactorings

    Further Reading

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

    angular.module('reports')
      .config(function ($stateProvider) {
        $stateProvider.state('reports.layout.facility', {
          parent: 'reports.layout',
          url: '/facility',
    Severity: Major
    Found in src/app/reports/facility/facility-report.states.js and 2 other locations - About 1 hr to fix
    src/app/login/login.states.js on lines 3..12
    src/app/reports/packing/packing-report.states.js on lines 3..12

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

    angular.module('reports')
      .config(function ($stateProvider) {
        $stateProvider.state('reports.layout.packing', {
          parent: 'reports.layout',
          url: '/packing',
    Severity: Major
    Found in src/app/reports/packing/packing-report.states.js and 2 other locations - About 1 hr to fix
    src/app/login/login.states.js on lines 3..12
    src/app/reports/facility/facility-report.states.js on lines 3..12

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

      var injectStyles = gulp.src([
        path.join(conf.paths.tmp, '/serve/app/**/*.css'),
        path.join('!' + conf.paths.tmp, '/serve/app/vendor.css')
      ], { read: false })
    Severity: Major
    Found in gulp/inject.js and 1 other location - About 1 hr to fix
    gulp/styles.js on lines 19..22

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

    angular.module('login')
      .config(function ($stateProvider) {
        $stateProvider.state('login', {
          url: '/login',
          parent: 'index',
    Severity: Major
    Found in src/app/login/login.states.js and 2 other locations - About 1 hr to fix
    src/app/reports/facility/facility-report.states.js on lines 3..12
    src/app/reports/packing/packing-report.states.js on lines 3..12

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

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

      var injectFiles = gulp.src([
        path.join(conf.paths.src, '/app/**/*.scss'),
        path.join('!' + conf.paths.src, '/app/index.scss')
      ], { read: false })
    Severity: Major
    Found in gulp/styles.js and 1 other location - About 1 hr to fix
    gulp/inject.js on lines 13..16

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 63.

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

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

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

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

    Refactorings

    Further Reading

    Function getColor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function getColor (status) {
          var str = status.toLowerCase()
    
          var darkGreen = '#008548'
          var lightGreen = '#00a65a'
    Severity: Minor
    Found in src/app/planning/delivery-round/delivery-round.service.js - About 1 hr to fix

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

              deliveryRound: function (log, planningService, $stateParams) {
                function handleError (err) {
                  log.error('deliveryRoundNotFound', err)
                  throw err // block $state transition
                }
      Severity: Major
      Found in src/app/planning/facilities/facilities.states.js and 4 other locations - About 1 hr to fix
      src/app/planning/allocation/allocation.states.js on lines 21..28
      src/app/planning/kpi/kpi.states.js on lines 10..17
      src/app/planning/return-route/return-route.states.js on lines 17..24
      src/app/planning/schedule/schedule.states.js on lines 14..21

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 62.

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

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

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

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

      Refactorings

      Further Reading

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

              deliveryRound: function (log, planningService, $stateParams) {
                function handleError (err) {
                  log.error('deliveryRoundNotFound', err)
                  throw err // block $state transition
                }
      Severity: Major
      Found in src/app/planning/schedule/schedule.states.js and 4 other locations - About 1 hr to fix
      src/app/planning/allocation/allocation.states.js on lines 21..28
      src/app/planning/facilities/facilities.states.js on lines 11..18
      src/app/planning/kpi/kpi.states.js on lines 10..17
      src/app/planning/return-route/return-route.states.js on lines 17..24

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 62.

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

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

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

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

      Refactorings

      Further Reading

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

              deliveryRound: function (log, planningService, $stateParams) {
                function handleError (err) {
                  log.error('deliveryRoundNotFound', err)
                  throw err // block $state transition
                }
      Severity: Major
      Found in src/app/planning/allocation/allocation.states.js and 4 other locations - About 1 hr to fix
      src/app/planning/facilities/facilities.states.js on lines 11..18
      src/app/planning/kpi/kpi.states.js on lines 10..17
      src/app/planning/return-route/return-route.states.js on lines 17..24
      src/app/planning/schedule/schedule.states.js on lines 14..21

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 62.

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

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

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

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

      Refactorings

      Further Reading

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

            deliveryRound: function (log, planningService, $stateParams) {
              function handleError (err) {
                log.error('deliveryRoundNotFound', err)
                throw err // block $state transition
              }
      Severity: Major
      Found in src/app/planning/kpi/kpi.states.js and 4 other locations - About 1 hr to fix
      src/app/planning/allocation/allocation.states.js on lines 21..28
      src/app/planning/facilities/facilities.states.js on lines 11..18
      src/app/planning/return-route/return-route.states.js on lines 17..24
      src/app/planning/schedule/schedule.states.js on lines 14..21

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 62.

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

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

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

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

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language