Showing 371 of 463 total issues
Function $setValidity
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
form.$setValidity = function(validationToken, isValid, control) {
var queue = errors[validationToken];
if (isValid) {
if (queue) {
Function getType
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getType(ct, url) {
if (ct === undefined) {
return 'oth';
}
ct = ct.toLowerCase();
Function load
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
Function splice
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Array.prototype.splice = function(start, deleteCount) {
var result
, args = _Array_slice_.call(arguments, 2)
, addElementsCount = args.length
;
Function style
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
Function getOwnPropertyDescriptor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
if ((typeof object != "object" && typeof object != "function") || object === null) {
throw new TypeError(ERR_NON_OBJECT + object);
}
Function reduce
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Array.prototype.reduce = function reduce(fun /*, initial*/) {
var object = toObject(this),
self = splitString && _toString(this) == "[object String]" ?
this.split("") :
object,
Function UIString
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
WebInspector.UIString = function(string, vararg)
{
if (Preferences.localizeUI) {
if (window.localizedStrings && string in window.localizedStrings)
string = window.localizedStrings[string];
- 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 primary
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function primary() {
var primary;
if (expect('(')) {
primary = filterChain();
consume(')');
Function cookies
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.cookies = function(name, value) {
var cookieLength, cookieArray, cookie, i, index;
if (name) {
if (value === undefined) {
Function HAREntry
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function HAREntry(entry, id, start_time, data) {
this._entry = entry;
this._id = id;
// Response
Function compile
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compile: function() {
return {
pre: function(scope, formElement, attr, controller) {
if (!attr.action) {
// we can't use jq events because if a form is destroyed during submission the default
Function $get
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function($rootScope, $browser, $q, $exceptionHandler) {
var deferreds = {};
/**
Function url
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
url: function(params) {
var self = this,
url = this.template,
val,
encodedVal;
Function LocationHashbangUrl
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function LocationHashbangUrl(url, hashPrefix, appBaseUrl) {
var basePath;
/**
* Parse given hashbang url into properties
Function when
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var when = function(value, callback, errback) {
var result = defer(),
done;
var wrappedCallback = function(value) {
Function handlers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handlers: function( event, handlers ) {
var i, matches, sel, handleObj,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
Function attr
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
attr: function( elem, name, value ) {
var hooks, ret,
nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
Function $get
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.$get = function () {
var $log = {
log: function() { $log.log.logs.push(concat([], arguments, 0)); },
warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },
info: function() { $log.info.logs.push(concat([], arguments, 0)); },
Function parseHash
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var parseHash = ui.parseHash = function parseHash() {
var hashes = location.hash.slice(1).split('&'),
parameters = this.parameters || (this.parameters = {});
// Clear original parameters.