Showing 371 of 463 total issues
Function setPrintSupport
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setPrintSupport(ownerDocument) {
var printSheet,
wrappers,
cache = getCache(ownerDocument),
namespaces = ownerDocument.namespaces,
Function push
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function push() {
var name,
value,
browserCookies,
updated;
Function ParsedURL
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
WebInspector.ParsedURL = function(url)
{
this.isValid = false;
this.url = url;
this.scheme = "";
- 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 compositeLinkFn
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function compositeLinkFn(scope, nodeList, $rootElement, boundTranscludeFn) {
var nodeLinkFn, childLinkFn, node, childScope, childTranscludeFn, i, ii, n;
// copy nodeList so that linking doesn't break due to live list updates.
var stableNodeList = [];
Function $emit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$emit: function(name, args) {
var empty = [],
namedListeners,
scope = this,
stopPropagation = false,
Function dispatch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event );
Function access
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
Function $LogProvider
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
angular.mock.$LogProvider = function() {
function concat(array1, array2, index) {
return array1.concat(Array.prototype.slice.call(array2, index));
}
Function $TimeoutProvider
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function $TimeoutProvider() {
this.$get = ['$rootScope', '$browser', '$q', '$exceptionHandler',
function($rootScope, $browser, $q, $exceptionHandler) {
var deferreds = {};
Function $get
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.$get = ['$window', function($window){
return {
/**
* @ngdoc method
* @name ng.$log#log
Function reduceRight
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
var object = toObject(this),
self = splitString && _toString(this) == "[object String]" ?
this.split("") :
object,
Function MockXhr
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function MockXhr() {
// hack for testing $http, $httpBackend
MockXhr.$$lastInstance = this;
Consider simplifying this complex logical expression. Open
Open
if (type == 'mouseenter' || type == 'mouseleave') {
var contains = document.body.contains || document.body.compareDocumentPosition ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
Consider simplifying this complex logical expression. Open
Open
if (t==e1 || t==e2 || t==e3 || t==e4 ||
(!e1 && !e2 && !e3 && !e4)) {
return token;
}
Consider simplifying this complex logical expression. Open
Open
if ( start && start[ 3 ] !== unit ) {
// Trust units reported by jQuery.css
unit = unit || start[ 3 ];
// Make sure we update the tween properties later on
Consider simplifying this complex logical expression. Open
Open
} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
diff = cache[1];
// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
} else {
Function compile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compile: function(element, attr) {
var srcExp = attr.ngInclude || attr.src,
onloadExp = attr.onload || '',
autoScrollExp = attr.autoscroll;
Function copy
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function copy(source, destination){
if (isWindow(source) || isScope(source)) throw Error("Can't copy Window or Scope");
if (!destination) {
destination = source;
if (source) {
Function setOffset
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setOffset: function( elem, options, i ) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css( elem, "position" ),
curElem = jQuery( elem ),
props = {};
Function registerDirective
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.directive = function registerDirective(name, directiveFactory) {
if (isString(name)) {
assertArg(directiveFactory, 'directive');
if (!hasDirectives.hasOwnProperty(name)) {
hasDirectives[name] = [];