src/Renatomefi/FormBundle/Resources/public/angular/form/controllers/protocolControllers.js
File protocolControllers.js
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
angular.module('sammui.protocolControllers', ['ngRoute'])
.controller('formFillingMain', ['$rootScope', '$scope', '$route', '$routeParams', '$location', 'formProtocolManage', 'protocolData', 'formProtocolLock',
function ($rootScope, $scope, $route, $routeParams, $location, formProtocolManage, protocolData, formProtocolLock) {
Function checkDependenciesSatisfied
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.checkDependenciesSatisfied = function () {
if ($scope.controllerReady === false) {
return true;
}
Function saveFields
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.saveFields = function () {
$scope.savingForm = true;
var fieldsToSend = $scope.$parent.protocol.data.form.fields.filter(function (field) {
var fieldValue = null;
Avoid deeply nested control flow statements. Open
Open
if (field.options[cValue] &&
field.value !== null && field.value !== undefined &&
Object.getOwnPropertyNames(field.value).length > 0 &&
field.value[cValue] === true) {
return false;