eHealthAfrica/direct-delivery-dashboard

View on GitHub

Showing 52 of 318 total issues

File db.service.mock.js has 627 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

(function (angular) {
  var deliveryRounds = [
    {
Severity: Major
Found in src/app/components/db/db.service.mock.js - About 1 day to fix

    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

      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

        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

          Function pouchDB has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                return function pouchDB (url) {
                  var parts = url.split('/')
                  var db = parts[parts.length - 1]
          
                  return {
          Severity: Major
          Found in src/app/users/users.mock.js - About 2 hrs to fix

            Function getAncestors has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function getAncestors () {
                  var keys = [
                    ['5', vm.state]
                  ]
            
            

              Function collateRows has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function collateRows (rows) {
                    var index = rows.length
                    var workingCCETotal = 0
                    var roundReport = _this.getDefaultReport()
                    roundReport.total = rows.length
              Severity: Major
              Found in src/app/planning/delivery-round/delivery-round.service.js - About 2 hrs to fix

                Function getView has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        getView: function (view) {
                          var response = null
                          if (['reports/delivery-rounds', 'dashboard-delivery-rounds/by-state-and-end-date', 'delivery-rounds/by-state-code'].indexOf(view) !== -1) {
                            response = {
                              rows: deliveryRounds
                Severity: Major
                Found in src/app/components/db/db.service.mock.js - About 2 hrs to fix

                  File delivery-allocation.mock.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  'use strict'
                  
                  angular.module('deliveryAllocationMock', [])
                    .constant('facilityAllocationInfoMock', {
                      rows: [{
                  Severity: Minor
                  Found in src/app/planning/allocation/delivery-allocation.mock.js - About 2 hrs to fix

                    Function prepareData has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function prepareData () {
                          paginateRounds(vm.currentPage).forEach(function (r) {
                            rnd.push(
                              deliveryService.getByRoundId(r)
                                .then(function (data) {
                    Severity: Major
                    Found in src/app/reports/utility/report.utility.controller.js - About 2 hrs to fix

                      Function save has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          vm.save = function (form) {
                            vm.submitted = true
                      
                            if (form.$valid) {
                              vm.user.profile._id = vm.user.profile.email
                      Severity: Minor
                      Found in src/app/users/form/form.controller.js - About 1 hr to fix

                        Function getView has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                getView: function (view) {
                                  var response = null
                        
                                  switch (view) {
                                    case 'reports/delivery-rounds':
                        Severity: Minor
                        Found in src/app/reports/reports.mock.js - About 1 hr to fix

                          Function save has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              vm.save = function () {
                                var locations = []
                                var results = vm.csv.result
                          
                                for (var i = 0; i < results.length; i++) {

                            Function addCustomAssumption has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                vm.addCustomAssumption = function (data) {
                                  var product
                                  var emptyTemplate = {
                                    name: data.name,
                                    products: {},

                              Function getAllocationBy has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  _this.getAllocationBy = function (roundId, lga) {
                                    var uniqueProductList = []
                                    var lgaList = []
                                    var presentationsByProduct = {}
                                    var view = 'dashboard-delivery-rounds/facility-allocation-by-round'
                              Severity: Minor
                              Found in src/app/planning/allocation/delivery-allocation.service.js - About 1 hr to fix

                                Function getAllocations has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    service.getAllocations = function (facilities) {
                                      function fillwithTemplate (facility, template) {
                                        for (var i in template.products) { // Todo: adjust this to suit the new template structure
                                          var coverage = parseFloat(template.products[i].coverage, 10)
                                          var wastage = parseFloat(template.products[i].wastage, 10)

                                  Function saveRow has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      vm.saveRow = function (data, row) {
                                        // TODO: simplify once old data model has been deprecated in favor of one doc per facility per driver delivery.
                                        var updatedRow = {
                                          deliveryDate: new Date(data.deliveryDate).toJSON(),
                                          distance: data.distance,
                                  Severity: Minor
                                  Found in src/app/planning/schedule/schedule-round.controller.js - About 1 hr to fix

                                    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

                                      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

                                        Function openForm has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            this.openForm = function (data, templateType) {
                                              return $modal.open({
                                                animation: true,
                                                templateUrl: 'app/configurations/allocations/assumptions/assumption-template/new-template.html',
                                                controller: 'AssumptionsTemplateAddCtrl',
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language