renatomefidf/sammui

View on GitHub
src/Renatomefi/FormBundle/Resources/public/angular/form/controllers/protocolControllers.js

Summary

Maintainability
C
1 day
Test Coverage

File protocolControllers.js has 400 lines of code (exceeds 250 allowed). Consider refactoring.
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

            $scope.checkDependenciesSatisfied = function () {
                if ($scope.controllerReady === false) {
                    return true;
                }
    
    

      Function saveFields has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      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

                                        if (field.options[cValue] &&
                                            field.value !== null && field.value !== undefined &&
                                            Object.getOwnPropertyNames(field.value).length > 0 &&
                                            field.value[cValue] === true) {
                                            return false;

          There are no issues that match your filters.

          Category
          Status