eHealthAfrica/direct-delivery-dashboard

View on GitHub

Showing 318 of 318 total issues

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

  it('should have a switchLocationLga method', function () {
    expect(calculationsCtrl.switchLocationLga).toBeDefined()
    expect(calculationsCtrl.switchLocationLga).toEqual(jasmine.any(Function))
  })
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 73..76
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 81..84
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 85..88
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 44..47
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 57..60
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 61..64

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

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

  it('should have a switchLocationState method', function () {
    expect(calculationsCtrl.switchLocationState).toBeDefined()
    expect(calculationsCtrl.switchLocationState).toEqual(jasmine.any(Function))
  })
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 77..80
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 81..84
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 85..88
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 44..47
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 57..60
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 61..64

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

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

  it('should have a getAllocations method', function () {
    expect(calculationService.getAllocations).toBeDefined()
    expect(calculationService.getAllocations).toEqual(jasmine.any(Function))
  })
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 73..76
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 77..80
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 81..84
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 85..88
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 44..47
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 61..64

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

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

  it('should have a changeDataView method', function () {
    expect(calculationsCtrl.changeDataView).toBeDefined()
    expect(calculationsCtrl.changeDataView).toEqual(jasmine.any(Function))
  })
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 73..76
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 77..80
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 85..88
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 44..47
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 57..60
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 61..64

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

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

  it('should have a addCustomAssumption method', function () {
    expect(calculationsCtrl.addCustomAssumption).toBeDefined()
    expect(calculationsCtrl.addCustomAssumption).toEqual(jasmine.any(Function))
  })
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 73..76
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 77..80
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 81..84
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 44..47
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 57..60
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 61..64

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

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

  it('should expose switchState', function (done) {
    expect(ConfigFacilityListCtrl.switchState).toBeDefined()
    ConfigFacilityListCtrl.switchState()
    done()

src/app/configurations/facilities/list/facilities.list.controller.spec.js on lines 19..25
src/app/configurations/facilities/list/facilities.list.controller.spec.js on lines 63..69

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

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

  it('should have a getTargetPopulation method', function () {
    expect(calculationService.getTargetPop).toBeDefined()
    expect(calculationService.getTargetPop).toEqual(jasmine.any(Function))
  })
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 73..76
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 77..80
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 81..84
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 85..88
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 57..60
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 61..64

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

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

        update: function (doc) {
          var deferred = $q.defer()
          deferred.resolve(angular.extend(doc, {
            _rev: '1-01'
          }))
Severity: Major
Found in src/app/components/db/db.service.mock.js and 1 other location - About 1 hr to fix
src/app/components/db/db.service.mock.js on lines 527..533

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

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

  it('should have a getMonthlyRequirement method', function () {
    expect(calculationService.getMonthlyRequirement).toBeDefined()
    expect(calculationService.getMonthlyRequirement).toEqual(jasmine.any(Function))
  })
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 73..76
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 77..80
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 81..84
src/app/configurations/allocations/calculations/calculations.controller.spec.js on lines 85..88
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 44..47
src/app/configurations/allocations/calculations/calculations.service.spec.js on lines 57..60

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

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

  it('should expose getLgas', function (done) {
    expect(ConfigFacilityListCtrl.getLgas).toBeDefined()
    ConfigFacilityListCtrl.getLgas()
    done()

src/app/configurations/facilities/list/facilities.list.controller.spec.js on lines 27..33
src/app/configurations/facilities/list/facilities.list.controller.spec.js on lines 63..69

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

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

        save: function (doc) {
          var deferred = $q.defer()
          deferred.resolve(angular.extend(doc, {
            _rev: '1-01'
          }))
Severity: Major
Found in src/app/components/db/db.service.mock.js and 1 other location - About 1 hr to fix
src/app/components/db/db.service.mock.js on lines 542..548

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

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

  it('should expose getFacilities', function (done) {
    expect(ConfigFacilityListCtrl.getFacilities).toBeDefined()
    ConfigFacilityListCtrl.getFacilities()
    done()

src/app/configurations/facilities/list/facilities.list.controller.spec.js on lines 19..25
src/app/configurations/facilities/list/facilities.list.controller.spec.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 58.

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

        packingStores: function (log, deliveryRound, returnRouteService) {
          return returnRouteService.getPackingStoreBy(deliveryRound._id)
            .catch(function (err) {
              log.error('getPackingStoresErr', err)
              return []
Severity: Major
Found in src/app/planning/return-route/return-route.states.js and 1 other location - About 1 hr to fix
src/app/planning/return-route/return-route.states.js on lines 25..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 58.

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

    {
      'id': 'product1',
      'key': 'product1',
      'value': null,
      'doc': {
Severity: Major
Found in src/app/components/db/db.service.mock.js and 1 other location - About 1 hr to fix
src/app/components/db/db.service.mock.js on lines 430..443

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

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

        deliveryReturnRoutes: function (log, returnRouteService, $stateParams) {
          return returnRouteService.getBy($stateParams.roundId)
            .catch(function (err) {
              log.error('getReturnRoutesErr', err)
              return []
Severity: Major
Found in src/app/planning/return-route/return-route.states.js and 1 other location - About 1 hr to fix
src/app/planning/return-route/return-route.states.js on lines 32..38

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

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

    {
      id: 'driver2@a.com',
      key: 'driver2@a.com',
      doc: {
        _id: 'driver2@a.com',
Severity: Major
Found in src/app/users/users.mock.js and 1 other location - About 1 hr to fix
src/app/users/users.mock.js on lines 22..35

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

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

    {
      'id': 'product2',
      'key': 'product2',
      'value': null,
      'doc': {
Severity: Major
Found in src/app/components/db/db.service.mock.js and 1 other location - About 1 hr to fix
src/app/components/db/db.service.mock.js on lines 416..429

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

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

    {
      id: 'driver1@a.com',
      key: 'driver1@a.com',
      doc: {
        _id: 'driver1@a.com',
Severity: Major
Found in src/app/users/users.mock.js and 1 other location - About 1 hr to fix
src/app/users/users.mock.js on lines 36..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 58.

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 setTimeline has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    vm.setTimeline = function () {
      if (!vm.roundReport.timeline) {
        return
      }
      var endDateLastHour = 82799000
Severity: Minor
Found in src/app/home/home.controller.js - About 1 hr to fix

    Function updateFromTemplate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _this.updateFromTemplate = function (rows, templateAllocs) {
          var allocByFacilityId = {}
          templateAllocs.forEach(function (alloc) {
            if (alloc && alloc.MR && alloc._id) {
              allocByFacilityId[alloc._id] = alloc.MR
    Severity: Minor
    Found in src/app/planning/allocation/delivery-allocation.service.js - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language