Showing 52 of 150 total issues
Function controller
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
controller: function ($scope, $filter, currentFacility, uomList, productTypes, facilities, loggedInUser, programs, $stateParams, $state, ordersFactory) {
Function exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
Function save
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.save = function() {
$scope.isSaving = true;
$scope.activeCCE.ccuProfile = JSON.parse($scope.selectedProfile);
$scope.switchActiveCCE();
Function canConnect
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var canConnect = function() {
var deferred = $q.defer();
var testDb = 'connection_test';
var counter = 0;
var reason;
Function startBackgroundSync
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.startBackgroundSync = function() {
var completedBackgroundSync = true;
if (backgroundSyncInProgress === true) {
var deferred = $q.defer();
deferred.reject('background sync in progress.');
Function compare
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.compare = function() {
$scope.syncing = true;
var remote = pouchdb.create(config.api.url + '/stock-count');
remote.allDocs()
.then(function(remotes) {
Function getConfirmDialogBox
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getConfirmDialogBox = function(title, bodyText, buttonLabels) {
var confirmDialog = $modal.open({
templateUrl: 'views/notification-service/confirm-dialog.html',
backdrop: 'static',
keyboard: false,
Function saveAndBroadcastStockOut
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var saveAndBroadcastStockOut = function(productList) {
var deferred = $q.defer();
var addNextStockLevelAndSave = function(productList, index) {
var nextIndex = index - 1;
Function getBatchGroupedByProductCategory
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getBatchGroupedByProductCategory = function(productProfiles){
var groupedList = {};
var NOT_FOUND = -1;
var existingGroups = [];
for (var index in productProfiles) {
Function getWardsByLgas
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getWardsByLgas = function(lgas) {
return pouchStorageService.getRemoteDB(storageService.LOCATIONS)
.then(function(db){
var lgaView = 'lga/by_id';
var wardView = 'ward/by_id';
Function save
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.save = function () {
$scope.isSaving = true;
var surveyResponse = {
Function wasteCountByType
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
wasteCountByType: function(wasteCount, facilityProductProfiles){
var arr = [];
if(Object.prototype.toString.call(wasteCount) === '[object Object]'){
for(var i in wasteCount.discarded){
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
var collections = {};
grunt.registerMultiTask('fixtures', 'Load fixtures', function() {
Function getStockCountDueDate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getStockCountDueDate = function(interval, reminderDay, date){
var today = new Date();
var currentDate = date || today;
var countDate;
interval = parseInt(interval);
Function getProductTypes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getProductTypes = function() {
return getAppConfigFromMemoryOrStorage()
.then(function(appConfig) {
var facilityStockListProductTypes = [];
var uuidListOfProductTypesAlreadyRecorded = [];
Function loadFilesIntoCache
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 = {};
Function validateBundle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function validateBundle(bundleLine){
var indicator = 0;
$scope.bundle.bundleLines.filter(function(bundleLine){
Function getSelectedFacility
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getSelectedFacility = function(key, e){
if(e.target.checked) {
var view = 'facilities/by_lga';
var options = {
include_docs : false,
Function controller
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
controller: function($scope, $window, i18n, appConfigService, deviceInfoFactory, backgroundSyncService, analyticsSyncService) {
$scope.states = {
online: i18n('online'),
offline: i18n('offline')
Function getPendingSurveys
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getPendingSurveys = function (facilityUUID) {
//TODO: make reminder to work by interval
var deferred = $q.defer();
storageService.all(storageService.SURVEY_RESPONSE)
.then(function (surveyResponses) {