Showing 2,008 of 4,250 total issues
Function dump
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
angular.mock.dump = function(object) {
return serialize(object);
function serialize(object) {
var out;
- 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 q.js
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/**
* @ngdoc service
* @name $q
Function selectDirective
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
var selectDirective = function() {
return {
restrict: 'E',
require: ['select', '?ngModel'],
Function $get
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.$get = ['$$animateQueue', function($$animateQueue) {
function domInsert(element, parentElement, afterElement) {
// if for some reason the previous element was removed
// from the dom sometime before this code runs then let's
// just stick to using the parent element as the anchor
Function groupAnimations
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function groupAnimations(animations) {
var preparedAnimations = [];
var refLookup = {};
forEach(animations, function(animation, index) {
var element = animation.element;
Consider simplifying this complex logical expression. Open
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && (i == 1 || i == 2 || i == 3) || vf.v == 0 && i % 10 != 4 && i % 10 != 6 && i % 10 != 9 || vf.v != 0 && vf.f % 10 != 4 && vf.f % 10 != 6 && vf.f % 10 != 9) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
Consider simplifying this complex logical expression. Open
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && (i == 1 || i == 2 || i == 3) || vf.v == 0 && i % 10 != 4 && i % 10 != 6 && i % 10 != 9 || vf.v != 0 && vf.f % 10 != 4 && vf.f % 10 != 6 && vf.f % 10 != 9) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
Consider simplifying this complex logical expression. Open
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && (i == 1 || i == 2 || i == 3) || vf.v == 0 && i % 10 != 4 && i % 10 != 6 && i % 10 != 9 || vf.v != 0 && vf.f % 10 != 4 && vf.f % 10 != 6 && vf.f % 10 != 9) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
Consider simplifying this complex logical expression. Open
if (vf.v == 0 && (i == 1 || i == 2 || i == 3) || vf.v == 0 && i % 10 != 4 && i % 10 != 6 && i % 10 != 9 || vf.v != 0 && vf.f % 10 != 4 && vf.f % 10 != 6 && vf.f % 10 != 9) {
return goog.i18n.pluralRules.Keyword.ONE;
}
Function getDirectoryListing
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDirectoryListing(path) {
if (!path.endsWith('/')) path += '/';
const getFilesOptions = {
delimiter: '/',
Function sortAnimations
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sortAnimations(animations) {
var tree = { children: [] };
var i, lookup = new $$Map();
// this is done first beforehand so that the map
Function LocationHtml5Url
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {
this.$$html5 = true;
basePrefix = basePrefix || '';
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 $$CookieWriter
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function $$CookieWriter($document, $log, $browser) {
var cookiePath = $browser.baseHref();
var rawDocument = $document[0];
function buildCookieString(name, value, options) {
- 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 $AnchorScrollProvider
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $AnchorScrollProvider() {
var autoScrollingEnabled = true;
/**
Function $watchCollectionInterceptor
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $watchCollectionInterceptor(_value) {
newValue = _value;
var newLength, key, bothNaN, newItem, oldItem;
// If the new value is undefined, then return undefined as the watch may be a one-time watch
File messages.js
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var forEach;
var isArray;
var isString;
Function TaskTracker
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TaskTracker(log) {
var self = this;
var taskCounts = {};
var taskCallbacks = [];
File injector.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/**
* @ngdoc function
* @module ng
Function compile
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
compile: function(element, attr) {
var srcExp = attr.ngInclude || attr.src,
onloadExp = attr.onload || '',
autoScrollExp = attr.autoscroll;
Function ruleInAngularExpression
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
MessageFormatParser.prototype.ruleInAngularExpression = function ruleInAngularExpression() {
var match = this.searchRe(INTERESTING_OPERATORS_RE);
var position;
if (match == null) {
if (this.angularOperatorStack.length === 0) {