hueitan/angular-validation

View on GitHub

Showing 17 of 21 total issues

Function Validator has 278 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function Validator($injector) {
    var $validationProvider = $injector.get('$validation');
    var $q = $injector.get('$q');
    var $timeout = $injector.get('$timeout');
    var $compile = $injector.get('$compile');
Severity: Major
Found in src/validator.directive.js - About 1 day to fix

    Function Provider has 156 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function Provider() {
        var $injector;
        var $scope;
        var $http;
        var $q;
    Severity: Major
    Found in src/provider.js - About 6 hrs to fix

      Function link has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            link: function(scope, element, attrs, ctrl) {
              /**
               * All attributes
               */
              var useViewValue = attrs.useViewValue !== 'false';
      Severity: Major
      Found in src/validator.directive.js - About 4 hrs to fix

        Function exports has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(grunt) {
          require('time-grunt')(grunt);
        
          // Grunt Config
          grunt.initConfig({
        Severity: Major
        Found in Gruntfile.js - About 4 hrs to fix

          File validator.directive.js has 286 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          (function() {
            angular
              .module('validation.directive')
              .directive('validator', Validator);
          
          
          Severity: Minor
          Found in src/validator.directive.js - About 2 hrs to fix

            Function checkValidation has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var checkValidation = function(scope, element, attrs, ctrl, validation, value) {
                  var validators = validation.slice(0);
                  var validatorExpr = validators[0].trim();
                  var paramIndex = validatorExpr.indexOf('=');
                  var validator = paramIndex === -1 ? validatorExpr : validatorExpr.substr(0, paramIndex);
            Severity: Major
            Found in src/validator.directive.js - About 2 hrs to fix

              Function validate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  this.validate = function(form) {
                    var deferred = $q.defer();
                    var idx = 0;
              
                    if (form === undefined) {
              Severity: Minor
              Found in src/provider.js - About 1 hr to fix

                Function invalidFunc has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    var invalidFunc = function(element, validMessage, validation, scope, ctrl, attrs, param) {
                Severity: Major
                Found in src/validator.directive.js - About 50 mins to fix

                  Function validFunc has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      var validFunc = function(element, validMessage, validation, scope, ctrl, attrs, param) {
                  Severity: Major
                  Found in src/validator.directive.js - About 50 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              } else if (validationGroup) {
                                groups[validationGroup][ctrl.$name] = false;
                    
                                // Whenever the element is invalid, we'll check whether one of the elements inside the its group valid or not.
                                // If there is a valid element, its invalid message won't be shown, Otherwise, shows its invalid message.
                    Severity: Major
                    Found in src/validator.directive.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  if (validationGroup) {
                                    groups[validationGroup][ctrl.$name] = true;
                                    setValidationGroup(scope, validationGroup, true);
                                  }
                      Severity: Major
                      Found in src/validator.directive.js - About 45 mins to fix

                        Function checkValidation has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            var checkValidation = function(scope, element, attrs, ctrl, validation, value) {
                        Severity: Minor
                        Found in src/validator.directive.js - About 45 mins to fix

                          Function minlength has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  minlength: function(value, scope, element, attrs, param) {
                          Severity: Minor
                          Found in src/rule.js - About 35 mins to fix

                            Function maxlength has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    maxlength: function(value, scope, element, attrs, param) {
                            Severity: Minor
                            Found in src/rule.js - About 35 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                        } else return valid.error();
                              Severity: Major
                              Found in src/validator.directive.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      } else return valid.error();
                                Severity: Major
                                Found in src/validator.directive.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                return valid.error();
                                  Severity: Major
                                  Found in src/validator.directive.js - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language