Showing 2,008 of 4,250 total issues
Function ngViewFactory
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ngViewFactory($route, $anchorScroll, $animate) {
return {
restrict: 'ECA',
terminal: true,
priority: 400,
prototype
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
NgModelController.prototype = {
$$initGetterSetters: function() {
if (this.$options.getOption('getterSetter')) {
var invokeModelGetter = this.$$parse(this.$$attr.ngModel + '()'),
invokeModelSetter = this.$$parse(this.$$attr.ngModel + '($$$p)');
Function bootstrap
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bootstrap(element, modules, config) {
if (!isObject(config)) config = {};
var defaultConfig = {
strictDi: false
};
Function bind
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
bind: function(element, eventHandlers, pointerTypes) {
// Absolute total movement, used to control swipe vs. scroll.
var totalX, totalY;
// Coordinates of the start position.
var startCoords;
Function $SceProvider
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $SceProvider() {
var enabled = true;
/**
* @ngdoc method
Function areAnimationsAllowed
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function areAnimationsAllowed(node, parentNode, event) {
var bodyNode = $document[0].body;
var rootNode = getDomNode($rootElement);
var bodyNodeDetected = (node === bodyNode) || node.nodeName === 'HTML';
Function $process
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
$process: function(docs) {
// We are only interested in docs that are in an area
var pages = _.filter(docs, function(doc) {
return doc.area;
Function $TimeoutProvider
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function $TimeoutProvider() {
this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',
function($rootScope, $browser, $q, $$q, $exceptionHandler) {
var deferreds = {};
- 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 roundNumber
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {
var digits = parsedNumber.d;
var fractionLen = digits.length - parsedNumber.i;
// determine fractionSize if it is not specified; `+fractionSize` converts it to a number
- 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 $SnifferProvider
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function $SnifferProvider() {
this.$get = ['$window', '$document', function($window, $document) {
var eventSupport = {},
// Chrome Packaged Apps are not allowed to access `history.pushState`.
// If not sandboxed, they can be detected by the presence of `chrome.app.runtime`
- 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 $RootScopeDecorator
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
var $rootScopePrototype = Object.getPrototypeOf($delegate);
$rootScopePrototype.$countChildScopes = countChildScopes;
- 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 attr
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
attr: function(element, name, value) {
var ret;
var nodeType = element.nodeType;
if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT ||
!element.getAttribute) {
- 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 compile
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
compile: function(ast) {
var self = this;
this.state = {
nextId: 0,
filters: {},
Function $watchGroup
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
$watchGroup: function(watchExpressions, listener) {
var oldValues = new Array(watchExpressions.length);
var newValues = new Array(watchExpressions.length);
var deregisterFns = [];
var self = this;
Function link
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element, attrs, ngMessagesCtrl, $transclude) {
var commentNode, records, staticExp, dynamicExp;
if (!isDefault) {
commentNode = element[0];
Function $LogProvider
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
angular.mock.$LogProvider = function() {
var debug = true;
function concat(array1, array2, index) {
return array1.concat(Array.prototype.slice.call(array2, index));
Function ngPluralizeDirective
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, $interpolate, $log) {
var BRACE = /{}/g,
IS_WHEN = /^when(Minus)?(.+)$/;
return {
Function $set
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
$set: function(key, value, writeAttr, attrName) {
// TODO: decide whether or not to throw an error if "class"
// is set through this function since it may cause $updateClass to
// become unstable.
Function $LogProvider
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $LogProvider() {
var debug = true,
self = this;
/**
Consider simplifying this complex logical expression. Open
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (vf.v == 0 && i != 1 && i % 10 >= 0 && i % 10 <= 1 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 12 && i % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}