eHealthAfrica/direct-delivery-dashboard

View on GitHub

Showing 318 of 318 total issues

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

    packingReportService.getPackingReport('2015-01-01', '2015-01-01', state)
      .then(function (response) {
        expect(response.group).toBeDefined()
        expect(response.products).toBeDefined()
        expect(angular.isArray(response.products)).toBeTruthy()
Severity: Major
Found in src/app/reports/packing/packing-report.service.spec.js and 1 other location - About 5 hrs to fix
src/app/reports/packing/packing-report.service.spec.js on lines 37..47

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

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

File schedule-service.mock.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict'

angular.module('scheduleMock', [])
  .constant('headerMock', {
    uuid: {
Severity: Minor
Found in src/app/planning/schedule/schedule-service.mock.js - About 5 hrs to fix

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

        service.removeAccount = function (account) {
          var deferred = $q.defer()
    
          if (account) {
            service.userDB.remove(account)
    Severity: Major
    Found in src/app/users/users.service.js and 1 other location - About 4 hrs to fix
    src/app/users/users.service.js on lines 86..102

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

    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

        service.removeProfile = function (profile) {
          var deferred = $q.defer()
    
          if (profile) {
            service.db.remove(profile)
    Severity: Major
    Found in src/app/users/users.service.js and 1 other location - About 4 hrs to fix
    src/app/users/users.service.js on lines 104..120

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

    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

    File delivery-round.service.js has 342 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict'
    
    angular.module('planning')
      .service('deliveryRoundService', function (
        dbService,
    Severity: Minor
    Found in src/app/planning/delivery-round/delivery-round.service.js - About 4 hrs to fix

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

        it('should return total rows found in delivery rounds query', function (done) {
          reportsService.getRoundsCount()
            .then(function (deliveryRoundCount) {
              var mock = deliveryRounds
              var rows = deliveryRoundCount.rows
      Severity: Major
      Found in src/app/reports/reports.service.spec.js and 1 other location - About 4 hrs to fix
      src/app/reports/reports.service.spec.js on lines 74..85

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

      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

        it('should return total rows found in daily delivery query', function (done) {
          reportsService.getDailyDeliveriesCount()
            .then(function (deliveryCount) {
              var mock = dailyDeliveries
              var rows = deliveryCount.rows
      Severity: Major
      Found in src/app/reports/reports.service.spec.js and 1 other location - About 4 hrs to fix
      src/app/reports/reports.service.spec.js on lines 61..72

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

      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

        it('should expose hasNext and hasPrev to return true or false when page condition is met', function () {
          ReportsRoundCtrl.pagination.page = 1
          expect(ReportsRoundCtrl.hasPrev()).toBeFalsy()
          ReportsRoundCtrl.pagination.page = 3
          expect(ReportsRoundCtrl.hasPrev()).toBeTruthy()
      Severity: Major
      Found in src/app/reports/invoice/round/round.controller.spec.js and 1 other location - About 4 hrs to fix
      src/app/reports/invoice/invoice.controller.spec.js on lines 39..46

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

      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

        it('should expose hasNext and hasPrev to return true or false when page condition is met', function () {
          ReportsAllCtrl.pagination.page = 1
          expect(ReportsAllCtrl.hasPrev()).toBeFalsy()
          ReportsAllCtrl.pagination.page = 3
          expect(ReportsAllCtrl.hasPrev()).toBeTruthy()
      Severity: Major
      Found in src/app/reports/invoice/invoice.controller.spec.js and 1 other location - About 4 hrs to fix
      src/app/reports/invoice/round/round.controller.spec.js on lines 50..57

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

      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

                  .forEach(function (facRnd) {
                    rowHash = _this.hashRow(dailyDelivery.deliveryRoundID, facRnd.facility.id, dailyDelivery._id)
                    scheduleInfo = schedulesInfo[rowHash]
                    if (scheduleInfo) {
                      facRnd.drop = scheduleInfo.drop
      Severity: Major
      Found in src/app/planning/schedule/schedules.service.js and 1 other location - About 3 hrs to fix
      src/app/planning/schedule/schedules.service.js on lines 240..249

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

      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 {
                rowHash = _this.hashRow(dailyDelivery.deliveryRoundID, dailyDelivery.facility.id, dailyDelivery._id)
                scheduleInfo = schedulesInfo[rowHash]
                if (scheduleInfo) {
                  dailyDelivery.drop = scheduleInfo.drop
      Severity: Major
      Found in src/app/planning/schedule/schedules.service.js and 1 other location - About 3 hrs to fix
      src/app/planning/schedule/schedules.service.js on lines 230..239

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

      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

        it('should expose selectPage to increment or decrease page number', function () {
          ReportsAllCtrl.pagination.page = 3
          ReportsAllCtrl.selectPage('next')
          expect(ReportsAllCtrl.pagination.page).toEqual(4)
          ReportsAllCtrl.selectPage('prev')
      Severity: Major
      Found in src/app/reports/invoice/invoice.controller.spec.js and 1 other location - About 3 hrs to fix
      src/app/reports/invoice/round/round.controller.spec.js on lines 40..48

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

      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

        it('should expose selectPage to increment or decrease page number', function () {
          ReportsRoundCtrl.pagination.page = 3
          ReportsRoundCtrl.selectPage('next')
          expect(ReportsRoundCtrl.pagination.page).toEqual(4)
          ReportsRoundCtrl.selectPage('prev')
      Severity: Major
      Found in src/app/reports/invoice/round/round.controller.spec.js and 1 other location - About 3 hrs to fix
      src/app/reports/invoice/invoice.controller.spec.js on lines 29..37

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

      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

          it('Should return TRUE if facility list is not Empty and product list is Empty Object', function () {
            DeliveryAllocationCtrl.facAllocInfo.productList = []
            expect(DeliveryAllocationCtrl.facAllocInfo.rows.length).toBeGreaterThan(0)
            expect(DeliveryAllocationCtrl.facAllocInfo.productList.length).toBe(0)
            expect(DeliveryAllocationCtrl.hasNoAllocation()).toBeTruthy()
      src/app/planning/allocation/delivery-allocation.controller.spec.js on lines 134..139

      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

          it('Should return FALSE if facility list is EMPTY and product list is NOT EMPTY Object', function () {
            DeliveryAllocationCtrl.facAllocInfo.rows = []
            expect(DeliveryAllocationCtrl.facAllocInfo.rows.length).toBe(0)
            expect(DeliveryAllocationCtrl.facAllocInfo.productList.length).toBeGreaterThan(0)
            expect(DeliveryAllocationCtrl.hasNoAllocation()).toBeFalsy()
      src/app/planning/allocation/delivery-allocation.controller.spec.js on lines 127..132

      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

      File schedules.service.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict'
      
      angular.module('planning')
        .service('scheduleService', function (dbService, log, utility, pouchUtil, $filter) {
          var _this = this
      Severity: Minor
      Found in src/app/planning/schedule/schedules.service.js - About 3 hrs to fix

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

            var facilities = [
              {
                '_id': 'NG-NW-KN-NASSARAWA-GEZAWA-BABAWA-BABAWA_MODEL_PRIMARY_HEALTH_CARE',
                '_rev': '1-6ee0af5fd02c8b8a5d9c3ab9774a5f61',
                'ancestors': [
        Severity: Major
        Found in src/app/components/utility/modal.mock.js and 1 other location - About 3 hrs to fix
        src/app/planning/facilities/manage-facilities.controller.spec.js on lines 12..39

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

        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 facilityList = [
            {
              '_id': 'NG-NW-KN-NASSARAWA-GEZAWA-BABAWA-BABAWA_MODEL_PRIMARY_HEALTH_CARE',
              '_rev': '1-6ee0af5fd02c8b8a5d9c3ab9774a5f61',
              'ancestors': [
        src/app/components/utility/modal.mock.js on lines 5..32

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

        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

          it('should log error message if $stateChangeError event is triggered with unauthorized', function () {
            expect(indexService.bootstrap).toBeDefined()
            spyOn(log, 'error')
            var event = rootScope.$emit('$stateChangeError', '', '', '', '', 'unauthorized')
            indexService.bootstrap()
        Severity: Major
        Found in src/app/index.service.spec.js and 1 other location - About 3 hrs to fix
        src/app/index.service.spec.js on lines 38..45

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

        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

          it('should log error message if $stateChangeError event is triggered with unknownError', function () {
            expect(indexService.bootstrap).toBeDefined()
            spyOn(log, 'error')
            var event = rootScope.$emit('$stateChangeError', '', '', '', '', 'unknownError')
            indexService.bootstrap()
        Severity: Major
        Found in src/app/index.service.spec.js and 1 other location - About 3 hrs to fix
        src/app/index.service.spec.js on lines 29..36

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

        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