eHealthAfrica/LMIS-Chrome

View on GitHub

Showing 52 of 150 total issues

Function controller has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

        controller: function ($scope, $filter, currentFacility, uomList, productTypes, facilities, loggedInUser, programs, $stateParams, $state, ordersFactory) {
Severity: Major
Found in app/scripts/controllers/orders.js - About 1 hr to fix

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

    module.exports = function(config) {
      config.set({
        // base path, that will be used to resolve files and exclude
        basePath: '',
    
    
    Severity: Minor
    Found in karma.conf.js - About 1 hr to fix

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

          $scope.save = function() {
            $scope.isSaving = true;
             $scope.activeCCE.ccuProfile = JSON.parse($scope.selectedProfile);
            $scope.switchActiveCCE();
      
      
      Severity: Minor
      Found in app/scripts/controllers/cold-chain-units.js - About 1 hr to fix

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

            var canConnect = function() {
              var deferred = $q.defer();
              var testDb = 'connection_test';
              var counter = 0;
              var reason;
        Severity: Minor
        Found in app/scripts/services/device-info-factory.js - About 1 hr to fix

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

              this.startBackgroundSync = function() {
                var completedBackgroundSync = true;
                if (backgroundSyncInProgress === true) {
                  var deferred = $q.defer();
                  deferred.reject('background sync in progress.');
          Severity: Minor
          Found in app/scripts/services/background-sync-service.js - About 1 hr to fix

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

                            $scope.compare = function() {
                              $scope.syncing = true;
                              var remote = pouchdb.create(config.api.url + '/stock-count');
                              remote.allDocs()
                                .then(function(remotes) {
            Severity: Minor
            Found in app/scripts/controllers/stock-count-sync-stat.js - About 1 hr to fix

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

                var getConfirmDialogBox = function(title, bodyText, buttonLabels) {
                  var confirmDialog = $modal.open({
                    templateUrl: 'views/notification-service/confirm-dialog.html',
                    backdrop: 'static',
                    keyboard: false,
              Severity: Minor
              Found in app/scripts/services/notification-service.js - About 1 hr to fix

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

                      var saveAndBroadcastStockOut = function(productList) {
                        var deferred = $q.defer();
                
                        var addNextStockLevelAndSave = function(productList, index) {
                          var nextIndex = index - 1;
                Severity: Minor
                Found in app/scripts/controllers/stock-out-broadcast.js - About 1 hr to fix

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

                      var getBatchGroupedByProductCategory = function(productProfiles){
                        var groupedList = {};
                        var NOT_FOUND = -1;
                        var existingGroups = [];
                        for (var index in productProfiles) {
                  Severity: Minor
                  Found in app/scripts/services/product-profile-factory.js - About 1 hr to fix

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

                        this.getWardsByLgas = function(lgas) {
                          return pouchStorageService.getRemoteDB(storageService.LOCATIONS)
                            .then(function(db){
                              var lgaView = 'lga/by_id';
                              var wardView = 'ward/by_id';
                    Severity: Minor
                    Found in app/scripts/services/fixture-loader-service.js - About 1 hr to fix

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

                            $scope.save = function () {
                      
                              $scope.isSaving = true;
                      
                              var surveyResponse = {
                      Severity: Minor
                      Found in app/scripts/controllers/survey.js - About 1 hr to fix

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

                              wasteCountByType: function(wasteCount, facilityProductProfiles){
                                var arr = [];
                        
                                if(Object.prototype.toString.call(wasteCount) === '[object Object]'){
                                  for(var i in wasteCount.discarded){
                        Severity: Minor
                        Found in app/scripts/services/waste-count-factory.js - About 1 hr to fix

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

                          module.exports = function(grunt) {
                          
                            var collections = {};
                          
                            grunt.registerMultiTask('fixtures', 'Load fixtures', function() {
                          Severity: Minor
                          Found in tasks/fixtures.js - About 1 hr to fix

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

                                var getStockCountDueDate = function(interval, reminderDay, date){
                                  var today = new Date();
                                  var currentDate = date || today;
                                  var countDate;
                                  interval = parseInt(interval);
                            Severity: Minor
                            Found in app/scripts/services/stock-count-factory.js - About 1 hr to fix

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

                                this.getProductTypes = function() {
                                  return getAppConfigFromMemoryOrStorage()
                                    .then(function(appConfig) {
                                      var facilityStockListProductTypes = [];
                                      var uuidListOfProductTypesAlreadyRecorded = [];
                              Severity: Minor
                              Found in app/scripts/services/app-config-service.js - About 1 hr to fix

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

                                    var loadFilesIntoCache = function(fileNames) {
                                      //TODO: deprecate ASAP, if we stop using fixture files.
                                      $rootScope.$emit('START_LOADING', {started: true});
                                      var deferred = $q.defer();
                                      var promises = {};
                                Severity: Minor
                                Found in app/scripts/services/fixture-loader-service.js - About 1 hr to fix

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

                                      function validateBundle(bundleLine){
                                  
                                        var indicator = 0;
                                  
                                        $scope.bundle.bundleLines.filter(function(bundleLine){
                                  Severity: Minor
                                  Found in app/scripts/controllers/bundle.js - About 1 hr to fix

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

                                      this.getSelectedFacility = function(key, e){
                                        if(e.target.checked) {
                                         var view = 'facilities/by_lga';
                                         var options = {
                                           include_docs : false,
                                    Severity: Minor
                                    Found in app/scripts/services/app-config-service.js - About 1 hr to fix

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

                                                  controller: function($scope, $window, i18n, appConfigService, deviceInfoFactory, backgroundSyncService, analyticsSyncService) {
                                      
                                                    $scope.states = {
                                                      online: i18n('online'),
                                                      offline: i18n('offline')
                                      Severity: Minor
                                      Found in app/scripts/controllers/index.js - About 1 hr to fix

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

                                              var getPendingSurveys = function (facilityUUID) {
                                                //TODO: make reminder to work by interval
                                                var deferred = $q.defer();
                                                storageService.all(storageService.SURVEY_RESPONSE)
                                                    .then(function (surveyResponses) {
                                        Severity: Minor
                                        Found in app/scripts/services/survey-factory.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language