eHealthAfrica/LMIS-Chrome

View on GitHub

Showing 52 of 150 total issues

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

module.exports = function(grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

Severity: Major
Found in Gruntfile.js - About 2 days to fix

    File bundle.js has 496 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    angular.module('lmisChromeApp')
      .config(function($stateProvider) {
        $stateProvider
    Severity: Minor
    Found in app/scripts/controllers/bundle.js - About 7 hrs to fix

      File Gruntfile.js has 460 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Generated on 2014-03-02 using generator-angular 0.7.1
      'use strict';
      
      module.exports = function(grunt) {
      
      
      Severity: Minor
      Found in Gruntfile.js - About 7 hrs to fix

        File app-config.js has 458 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        
        angular.module('lmisChromeApp')
          .config(function($stateProvider) {
            $stateProvider
        Severity: Minor
        Found in app/scripts/controllers/app-config.js - About 7 hrs to fix

          Function trackingService has 116 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            .service('trackingService', function trackingService($q, $log, $window, $rootScope, config, utility, storageService, deviceInfoFactory, appConfigService) {
              var tracker = {
                sendAppView: function() {},
                sendException: function() {},
                sendEvent: function() {},
          Severity: Major
          Found in app/scripts/services/tracking-service.js - About 4 hrs to fix

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

                        controller: function($q, $log, mostRecentCount, productProfileFactory, $scope, $window, i18n, storageService, dashboardfactory, inventoryRulesFactory, productTypeFactory, appConfig, appConfigService, cacheService, stockOutList, utility, $rootScope, isStockCountReminderDue, stockCountFactory) {
            
                          var keys = [
                            {
                              key: 'stockBelowReorder',
            Severity: Major
            Found in app/scripts/controllers/home.js - About 4 hrs to fix

              File home.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              angular.module('lmisChromeApp')
                .config(function($urlRouterProvider, $stateProvider) {
                  // Initial state
              Severity: Minor
              Found in app/scripts/controllers/home.js - About 3 hrs to fix

                File inventoryrulesfactory.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                'use strict';
                
                angular.module('lmisChromeApp')
                  .factory('inventoryRulesFactory', function($q, utility, $rootScope, bundleService, storageService, productProfileFactory, stockCountFactory) {
                
                
                Severity: Minor
                Found in app/scripts/services/inventoryrulesfactory.js - About 2 hrs to fix

                  File fixture-loader-service.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  'use strict';
                  
                  angular.module('lmisChromeApp')
                    .service('fixtureLoaderService', function($q, $http, locationService, facilityFactory, $rootScope, memoryStorageService, config, storageService, utility, pouchdb, syncService, pouchStorageService) {
                  
                  
                  Severity: Minor
                  Found in app/scripts/services/fixture-loader-service.js - About 2 hrs to fix

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

                                controller: function($q, $log, mostRecentCount, productProfileFactory, $scope, $window, i18n, storageService, dashboardfactory, inventoryRulesFactory, productTypeFactory, appConfig, appConfigService, cacheService, stockOutList, utility, $rootScope, isStockCountReminderDue, stockCountFactory) {
                    Severity: Major
                    Found in app/scripts/controllers/home.js - About 2 hrs to fix

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

                                    var getProductTypeCounts = function($q, $log, inventoryRulesFactory, productTypeFactory, appConfig, appConfigService) {
                      
                                      if (typeof appConfig === 'undefined') {
                                        var productTypeInfo = {};
                                        return $q.when(productTypeInfo);
                      Severity: Major
                      Found in app/scripts/controllers/home.js - About 2 hrs to fix

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

                            $scope.save = function() {
                        
                              $scope.isSaving = true;
                        
                              var saveAndBroadcastStockOut = function(productList) {
                        Severity: Major
                        Found in app/scripts/controllers/stock-out-broadcast.js - About 2 hrs to fix

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

                                        controller: function($q, $log, $scope, i18n, config, pouchdb, localDocs, growl) {
                                          var dbName = 'stock-count',
                                              remote = config.api.url + '/' + dbName;
                          
                                          var updateCounts = function() {
                          Severity: Major
                          Found in app/scripts/controllers/stock-count-sync-stat.js - About 2 hrs to fix

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

                                controller: function ($stateParams, $state, $scope, surveyFactory, growl, appConfig, i18n, alertFactory) {
                            
                                  if(!$stateParams.surveyUUID){
                                    growl.error(i18n('surveyNotFound'), {persistent: true});
                                    return;
                            Severity: Minor
                            Found in app/scripts/controllers/survey.js - About 1 hr to fix

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

                                  var getStockLevel = function(facility, productType) {
                                    var deferred = $q.defer();
                                    var promises = [];
                                    promises.push(stockCountFactory.get.byFacility(facility));
                                    promises.push(productProfileFactory.getByProductType(productType));
                              Severity: Minor
                              Found in app/scripts/services/inventoryrulesfactory.js - About 1 hr to fix

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

                                    $scope.finalSave = function() {
                                      var bundle = angular.copy($scope.bundle);
                                      $scope.isSaving = true;
                                      var successMsg = '';
                                      if ($stateParams.type === logIncoming) {
                                Severity: Minor
                                Found in app/scripts/controllers/bundle.js - About 1 hr to fix

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

                                      function loadAppConfig() {
                                        //TODO: figure out a better way of knowing if the app has been configured or not.
                                  
                                        return storageService.all(storageService.APP_CONFIG)
                                          .then(function(res) {
                                  Severity: Minor
                                  Found in app/scripts/controllers/app-config.js - About 1 hr to fix

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

                                        $scope.save = function() {
                                          $scope.isSaving = true;
                                          var productType = JSON.parse($scope.stockOutForm.productType);
                                          var confirmationTitle = i18n('confirmStockOutHeader', productType.code);
                                          var confirmationQuestion = i18n('dialogConfirmationQuestion');
                                    Severity: Minor
                                    Found in app/scripts/controllers/stock-out-broadcast.js - About 1 hr to fix

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

                                                    controller: function($log, $scope, localDocs, config, pouchdb) {
                                                      $scope.locals = localDocs.rows.map(function(local) {
                                                        return local.id;
                                                      });
                                      
                                      
                                      Severity: Minor
                                      Found in app/scripts/controllers/stock-count-sync-stat.js - About 1 hr to fix

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

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