Showing 52 of 318 total issues
Function applyUpdate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function applyUpdate (dailyDelivery) {
var rowHash
var scheduleInfo
if (angular.isArray(dailyDelivery.facilityRounds)) {
dailyDelivery.facilityRounds
Function exports
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function () {
var prefix = 'direct_delivery_dashboard'
var roles = {
admin: {
roles: [
Function save
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
_this.collateReport = function (res, deliveryRounds, zones) {
// TODO: move this collation to reduce view if possible
var rows = res.rows
var index = rows.length
Function zoneReportToArray
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function zoneReportToArray (roundReport) {
var collatedZones = []
var statusByZone = []
var statusReport
for (var status in roundReport.status) {
Function save
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
Open
compile: function (tElem, tAttrs) {
var position = tAttrs.floatNav || 'right'
if (position === 'left') {
tElem.removeClass('navbar-right').addClass('navbar-left')
} else {
Function getMonthlyRequirement
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
module.exports = function (config) {
var configuration = {
files: listFiles(),
singleRun: true,
Function setTimeline
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.setTimeline = function () {
if (!vm.roundReport.timeline) {
return
}
var endDateLastHour = 82799000
Function updateFromTemplate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_this.updateFromTemplate = function (rows, templateAllocs) {
var allocByFacilityId = {}
templateAllocs.forEach(function (alloc) {
if (alloc && alloc.MR && alloc._id) {
allocByFacilityId[alloc._id] = alloc.MR
Function get
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get () {
var seen = {}
var states = $state.get()
function hasLabel (state) {
return !state.abstract && state.data && state.data.label
Function copyFromRoundDialog
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.copyFromRoundDialog = function () {
var copyRoundDialog = $modal.open({
animation: true,
templateUrl: 'app/planning/facilities/dialogs/copy-round/copy-round.html',
controller: 'CopyRoundTemplateDialogCtrl',
Function fillInMissingKPI
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_this.fillInMissingKPI = function (kpiList, roundId, kpiTemplate) {
var view = 'kpi/deliveries-date-and-driver-by-round'
var param = {
key: roundId
}
Function collate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function collate (locations) {
var i = locations.length
var locationLevel = groupByLevel(locations)
var facilities = []
var zone = {}
Function getChartData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.getChartData = function (zoneData) {
var graphData = [
{
'key': 'Success',
'color': 'green',
Function save
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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]}
Function csvUpload
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.csvUpload = function (data) {
var modalInstance = $modal.open({
animation: true,
templateUrl: 'app/configurations/allocations/targetpop/upload/upload-csv-form.html',
controller: 'TargetPopCSVUploadCtrl',