Showing 52 of 318 total issues
File db.service.mock.js
has 627 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
(function (angular) {
var deliveryRounds = [
{
File schedule-service.mock.js
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict'
angular.module('scheduleMock', [])
.constant('headerMock', {
uuid: {
File delivery-round.service.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict'
angular.module('planning')
.service('deliveryRoundService', function (
dbService,
File schedules.service.js
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict'
angular.module('planning')
.service('scheduleService', function (dbService, log, utility, pouchUtil, $filter) {
var _this = this
Function pouchDB
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function pouchDB (url) {
var parts = url.split('/')
var db = parts[parts.length - 1]
return {
Function getAncestors
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getAncestors () {
var keys = [
['5', vm.state]
]
Function collateRows
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function collateRows (rows) {
var index = rows.length
var workingCCETotal = 0
var roundReport = _this.getDefaultReport()
roundReport.total = rows.length
Function getView
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getView: function (view) {
var response = null
if (['reports/delivery-rounds', 'dashboard-delivery-rounds/by-state-and-end-date', 'delivery-rounds/by-state-code'].indexOf(view) !== -1) {
response = {
rows: deliveryRounds
File delivery-allocation.mock.js
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict'
angular.module('deliveryAllocationMock', [])
.constant('facilityAllocationInfoMock', {
rows: [{
Function prepareData
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function prepareData () {
paginateRounds(vm.currentPage).forEach(function (r) {
rnd.push(
deliveryService.getByRoundId(r)
.then(function (data) {
Function save
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.save = function (form) {
vm.submitted = true
if (form.$valid) {
vm.user.profile._id = vm.user.profile.email
Function getView
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getView: function (view) {
var response = null
switch (view) {
case 'reports/delivery-rounds':
Function save
has 47 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++) {
Function addCustomAssumption
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.addCustomAssumption = function (data) {
var product
var emptyTemplate = {
name: data.name,
products: {},
Function getAllocationBy
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_this.getAllocationBy = function (roundId, lga) {
var uniqueProductList = []
var lgaList = []
var presentationsByProduct = {}
var view = 'dashboard-delivery-rounds/facility-allocation-by-round'
Function getAllocations
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
service.getAllocations = function (facilities) {
function fillwithTemplate (facility, template) {
for (var i in template.products) { // Todo: adjust this to suit the new template structure
var coverage = parseFloat(template.products[i].coverage, 10)
var wastage = parseFloat(template.products[i].wastage, 10)
Function saveRow
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.saveRow = function (data, row) {
// TODO: simplify once old data model has been deprecated in favor of one doc per facility per driver delivery.
var updatedRow = {
deliveryDate: new Date(data.deliveryDate).toJSON(),
distance: data.distance,
Function applyChanges
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_this.applyChanges = function (dailyDeliveries, schedulesInfo) {
function applyUpdate (dailyDelivery) {
var rowHash
var scheduleInfo
if (angular.isArray(dailyDelivery.facilityRounds)) {
Function getColor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getColor (status) {
var str = status.toLowerCase()
var darkGreen = '#008548'
var lightGreen = '#00a65a'
Function openForm
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.openForm = function (data, templateType) {
return $modal.open({
animation: true,
templateUrl: 'app/configurations/allocations/assumptions/assumption-template/new-template.html',
controller: 'AssumptionsTemplateAddCtrl',