eHealthAfrica/direct-delivery-dashboard

View on GitHub
src/app/planning/delivery-round/delivery-round.service.js

Summary

Maintainability
D
1 day
Test Coverage

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

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

          Avoid too many return statements within this function.
          Open

                  return lightOrange
          Severity: Major
          Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return 'A_week_late'
            Severity: Major
            Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return 'More_than_a_week_late'
              Severity: Major
              Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return darkOrange
                Severity: Major
                Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return black // unknown or unexpected status
                  Severity: Major
                  Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return orange
                    Severity: Major
                    Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return darkRed
                      Severity: Major
                      Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return red
                        Severity: Major
                        Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return lightRed
                          Severity: Major
                          Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return 'A_day_late'
                            Severity: Major
                            Found in src/app/planning/delivery-round/delivery-round.service.js - About 30 mins to fix

                              There are no issues that match your filters.

                              Category
                              Status