eHealthAfrica/direct-delivery-dashboard

View on GitHub

Showing 52 of 318 total issues

Function applyUpdate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function exports has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function () {
      var prefix = 'direct_delivery_dashboard'
      var roles = {
        admin: {
          roles: [
    Severity: Minor
    Found in lib/roles.js - About 1 hr to fix

      Function save has 32 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++) {
              if (results[i].name) {

        Function collateReport has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _this.collateReport = function (res, deliveryRounds, zones) {
              // TODO: move this collation to reduce view if possible
              var rows = res.rows
        
              var index = rows.length
        Severity: Minor
        Found in src/app/reports/reports.service.js - About 1 hr to fix

          Function zoneReportToArray has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function zoneReportToArray (roundReport) {
                var collatedZones = []
                var statusByZone = []
                var statusReport
                for (var status in roundReport.status) {
          Severity: Minor
          Found in src/app/planning/delivery-round/delivery-round.service.js - About 1 hr to fix

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

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

              Function getBiWeekly has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  service.getBiWeekly = function (facilities) {
                    function setBWMax (MMax) {
                      var r = {}
                      for (var i in MMax) {
                        if (MMax[i] === 'NA') {

                Function compile has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    compile: function (tElem, tAttrs) {
                      var position = tAttrs.floatNav || 'right'
                      if (position === 'left') {
                        tElem.removeClass('navbar-right').addClass('navbar-left')
                      } else {
                Severity: Minor
                Found in src/app/components/navbar/navbar.directive.js - About 1 hr to fix

                  Function getMonthlyRequirement has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      service.getMonthlyRequirement = function (facilities) {
                        return service.getAllocations(facilities, service.template.products)
                          .then(service.getTargetPop)
                          .then(function (r) {
                            for (var i in facilities) {

                    Function exports has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function (config) {
                      var configuration = {
                        files: listFiles(),
                    
                        singleRun: true,
                    Severity: Minor
                    Found in karma.conf.js - About 1 hr to fix

                      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

                          Function get has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function get () {
                                var seen = {}
                                var states = $state.get()
                                function hasLabel (state) {
                                  return !state.abstract && state.data && state.data.label
                          Severity: Minor
                          Found in src/app/components/navbar/navbar.service.js - About 1 hr to fix

                            Function copyFromRoundDialog has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                vm.copyFromRoundDialog = function () {
                                  var copyRoundDialog = $modal.open({
                                    animation: true,
                                    templateUrl: 'app/planning/facilities/dialogs/copy-round/copy-round.html',
                                    controller: 'CopyRoundTemplateDialogCtrl',
                            Severity: Minor
                            Found in src/app/planning/facilities/manage-facilities.controller.js - About 1 hr to fix

                              Function fillInMissingKPI has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  _this.fillInMissingKPI = function (kpiList, roundId, kpiTemplate) {
                                    var view = 'kpi/deliveries-date-and-driver-by-round'
                                    var param = {
                                      key: roundId
                                    }
                              Severity: Minor
                              Found in src/app/components/kpi/kpi.service.js - About 1 hr to fix

                                Function collate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function collate (locations) {
                                      var i = locations.length
                                      var locationLevel = groupByLevel(locations)
                                      var facilities = []
                                      var zone = {}
                                Severity: Minor
                                Found in src/app/facility/facility.service.js - About 1 hr to fix

                                  Function getChartData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      vm.getChartData = function (zoneData) {
                                        var graphData = [
                                          {
                                            'key': 'Success',
                                            'color': 'green',
                                  Severity: Minor
                                  Found in src/app/reports/delivery/delivery-report.controller.js - About 1 hr to fix

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

                                        vm.save = function () {
                                          var locations = []
                                          var results = vm.csv.result
                                    
                                          for (var i in results) {

                                      Function getAlertReceiversForRound has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          _this.getAlertReceiversForRound = function (deliveryRound) {
                                            var stateCode = deliveryRound.roundCode && deliveryRound.roundCode.split('-')[0] || deliveryRound.id.split('-')[0]
                                            var view = 'dashboard-delivery-rounds/alert-receivers'
                                            var options = {include_docs: true, keys: ['all', stateCode]}
                                      
                                      
                                      Severity: Minor
                                      Found in src/app/planning/schedule/schedules.service.js - About 1 hr to fix

                                        Function csvUpload has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            vm.csvUpload = function (data) {
                                              var modalInstance = $modal.open({
                                                animation: true,
                                                templateUrl: 'app/configurations/allocations/targetpop/upload/upload-csv-form.html',
                                                controller: 'TargetPopCSVUploadCtrl',
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language