Function SelectController
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
['$element', '$scope', /** @this */ function($element, $scope) {
var self = this,
optionsMap = new NgMap();
- 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 SelectController
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
['$element', '$scope', /** @this */ function($element, $scope) {
var self = this,
optionsMap = new NgMap();
File select.js
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* exported selectDirective, optionDirective */
var noopNgModelController = { $setViewValue: noop, $render: noop };
Function registerOption
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.registerOption = function(optionScope, optionElement, optionAttrs, interpolateValueFn, interpolateTextFn) {
if (optionAttrs.$attr.ngValue) {
// The value attribute is set by ngValue
var oldVal, hashedVal;
Function selectDirective
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
var selectDirective = function() {
return {
restrict: 'E',
require: ['select', '?ngModel'],
Function selectDirective
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
var selectDirective = function() {
return {
restrict: 'E',
require: ['select', '?ngModel'],
- 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 selectPreLink
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function selectPreLink(scope, element, attr, ctrls) {
var selectCtrl = ctrls[0];
var ngModelCtrl = ctrls[1];
Function registerOption
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
self.registerOption = function(optionScope, optionElement, optionAttrs, interpolateValueFn, interpolateTextFn) {
Function optionDirective
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var optionDirective = ['$interpolate', function($interpolate) {
return {
restrict: 'E',
priority: 100,
compile: function(element, attr) {
- 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"