Showing 2,008 of 4,250 total issues
Function $IntervalProvider
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
angular.mock.$IntervalProvider = function() {
this.$get = ['$browser', '$$intervalFactory',
function($browser, $$intervalFactory) {
var repeatFns = [],
nextRepeatId = 0,
- 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 findConstantAndWatchExpressions
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
var allConstants;
var argsToWatch;
var isStatelessFilter;
Function $watchCollection
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
$watchCollection: function(obj, listener) {
// Mark the interceptor as
// ... $$pure when literal since the instance will change when any input changes
$watchCollectionInterceptor.$$pure = $parse(obj).literal;
// ... $stateful when non-literal since we must read the state of the collection
Function generateVersionDocProcessor
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function generateVersionDocProcessor(gitData) {
return {
$runAfter: ['generatePagesDataProcessor'],
$runBefore: ['rendering-docs'],
// Remove rogue builds that are in the npm repository but not on code.angularjs.org
Function browserTrigger
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.browserTrigger = function browserTrigger(element, eventType, eventData) {
if (element && !element.nodeName) element = element[0];
if (!element) return;
eventData = eventData || {};
Function LocationHashbangUrl
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
parseAbsoluteUrl(appBase, this);
- 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 rangeInputType
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {
badInputChecker(scope, element, attr, ctrl, 'range');
numberFormatterParser(ctrl);
baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
Function initializeBinding
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
forEach(bindings, function initializeBinding(definition, scopeName) {
var attrName = definition.attrName,
optional = definition.optional,
mode = definition.mode, // @, =, <, or &
lastValue,
File animation.js
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* exported $$AnimationProvider */
var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
Function ngModule
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ngModule($provide) {
// $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
$provide.provider({
$$sanitizeUri: $$SanitizeUriProvider
});
Function classDirective
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
function classDirective(name, selector) {
name = 'ngClass' + name;
var indexWatchExpression;
return ['$parse', function($parse) {
Function $http
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $http(requestConfig) {
if (!isObject(requestConfig)) {
throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig);
}
Function $AnimateProvider
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $AnimateProvider = ['$provide', /** @this */ function($provide) {
var provider = this;
var classNameFilter = null;
var customFilter = null;
Function $process
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
$process: function(docs) {
var ignoredBuilds = this.ignoredBuilds;
var currentVersion = require('../../../build/version.json');
var output = exec('yarn info angular versions --json', { silent: true }).stdout.split('\n')[0];
Function recurse
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
var left, right, self = this, args, expression, computed;
recursionFn = recursionFn || noop;
if (!skipWatchIdCheck && isDefined(ast.watchId)) {
intoId = intoId || this.nextId();
- 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 findConstantAndWatchExpressions
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
var allConstants;
var argsToWatch;
var isStatelessFilter;
- 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 recurse
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
recurse: function(ast, context, create) {
var left, right, self = this, args;
if (ast.input) {
return this.inputs(ast.input, ast.watchId);
}
- 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
File filters.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var MAX_DIGITS = 22;
var DECIMAL_SEP = '.';
var ZERO_CHAR = '0';
Function compileTemplateUrl
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compileTemplateUrl(directives, $compileNode, tAttrs,
$rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {
var linkQueue = [],
afterTemplateNodeLinkFn,
afterTemplateChildLinkFn,
Function $CacheFactoryProvider
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $CacheFactoryProvider() {
this.$get = function() {
var caches = {};