Showing 15 of 72 total issues
Function exports
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
File valdrMessage-directive.spec.js
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
describe('valdrMessage input directive', function () {
var $scope, $compile;
beforeEach(module('valdr'));
Function valdrFormItemDirectiveDefinitionFactory
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
var valdrFormItemDirectiveDefinitionFactory = function (restrict) {
return ['valdrEvents', 'valdr', 'valdrUtil', function (valdrEvents, valdr, valdrUtil) {
return {
restrict: restrict,
require: ['?^valdrType', '?^ngModel', '?^valdrFormGroup', '?^valdrEnabled'],
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function $get
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ($log, $injector, $rootScope, $http, valdrEvents, valdrUtil, valdrClasses) {
// inject all validators
angular.forEach(validatorNames, function (validatorName) {
var validator = $injector.get(validatorName);
Function valdrFormGroupDirectiveDefinition
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
['valdrClasses', 'valdrConfig', function (valdrClasses, valdrConfig) {
return {
restrict: 'EA',
link: function (scope, element) {
if (valdrConfig.addFormGroupClass) {
Function link
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function (scope, element, attrs, controllers) {
var formController = controllers[0],
valdrTypeController = controllers[1] || nullValdrType;
var updateTranslations = function () {
Function controller
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
controller: ['$scope', '$element', function ($scope, $element) {
var formItems = [],
messageElements = {};
Function valdrFormItemDirectiveDefinitionFactory
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var valdrFormItemDirectiveDefinitionFactory = function (restrict) {
return ['valdrEvents', 'valdr', 'valdrUtil', function (valdrEvents, valdr, valdrUtil) {
return {
restrict: restrict,
require: ['?^valdrType', '?^ngModel', '?^valdrFormGroup', '?^valdrEnabled'],
Function $get
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.$get = ['$templateCache', '$injector', function ($templateCache, $injector) {
var angularMessagesEnabled = false;
function getTranslateService() {
Function link
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function (scope, element, attrs, controllers) {
var valdrTypeController = controllers[0],
ngModelController = controllers[1],
valdrFormGroupController = controllers[2] || nullValdrFormGroupController,
Function runFormItemCommonTests
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function runFormItemCommonTests() {
it('should set the validity to false on ngModelController if validation fails', function () {
// when
$scope.$apply(function () {
$scope.myObject.field = 'invalid';
Function validate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
validate: function (typeName, fieldName, value) {
var validResult = { valid: true },
typeConstraints = constraintsForType(typeName);
Function valdrFormGroupDirectiveDefinition
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
['valdrClasses', 'valdrConfig', function (valdrClasses, valdrConfig) {
return {
restrict: 'EA',
link: function (scope, element) {
if (valdrConfig.addFormGroupClass) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function exports
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config) {
config.set({
basePath: '',
Function $get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function ($log, $injector, $rootScope, $http, valdrEvents, valdrUtil, valdrClasses) {