Showing 17 of 21 total issues
Function Validator
has 278 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Validator($injector) {
var $validationProvider = $injector.get('$validation');
var $q = $injector.get('$q');
var $timeout = $injector.get('$timeout');
var $compile = $injector.get('$compile');
Function Provider
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Provider() {
var $injector;
var $scope;
var $http;
var $q;
Function link
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, element, attrs, ctrl) {
/**
* All attributes
*/
var useViewValue = attrs.useViewValue !== 'false';
Function exports
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
require('time-grunt')(grunt);
// Grunt Config
grunt.initConfig({
File validator.directive.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function() {
angular
.module('validation.directive')
.directive('validator', Validator);
Function checkValidation
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function validate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.validate = function(form) {
var deferred = $q.defer();
var idx = 0;
if (form === undefined) {
Function invalidFunc
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var invalidFunc = function(element, validMessage, validation, scope, ctrl, attrs, param) {
Function validFunc
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var validFunc = function(element, validMessage, validation, scope, ctrl, attrs, param) {
Avoid deeply nested control flow statements. Open
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.
Function checkValidation
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var checkValidation = function(scope, element, attrs, ctrl, validation, value) {
Avoid deeply nested control flow statements. Open
Open
if (validationGroup) {
groups[validationGroup][ctrl.$name] = true;
setValidationGroup(scope, validationGroup, true);
}
Function minlength
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
minlength: function(value, scope, element, attrs, param) {
Function maxlength
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
maxlength: function(value, scope, element, attrs, param) {
Avoid too many return
statements within this function. Open
Open
return valid.error();
Avoid too many return
statements within this function. Open
Open
} else return valid.error();
Avoid too many return
statements within this function. Open
Open
} else return valid.error();