Showing 82 of 90 total issues
Function object
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
object: function() {
var keys = [], valueFns = [];
if (this.peekToken().text !== '}') {
do {
if (this.peek('}')) {
- 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 equals
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function equals(o1, o2) {
if (o1 === o2) return true;
if (o1 === null || o2 === null) return false;
if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
Function readString
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
readString: function(quote) {
var start = this.index;
this.index++;
var string = '';
var rawString = quote;
Function primary
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
primary: function() {
var primary;
if (this.expect('(')) {
primary = this.filterChain();
this.consume(')');
- 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 bindJQuery
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bindJQuery() {
var originalCleanData;
if (bindJQueryFired) {
return;
Consider simplifying this complex logical expression. Open
if (t === e1 || t === e2 || t === e3 || t === e4 ||
(!e1 && !e2 && !e3 && !e4)) {
return token;
}
Function cspSafeGetterFn
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, expensiveChecks) {
ensureSafeMemberName(key0, fullExp);
ensureSafeMemberName(key1, fullExp);
ensureSafeMemberName(key2, fullExp);
ensureSafeMemberName(key3, fullExp);
Function lex
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
lex: function(text) {
this.text = text;
this.index = 0;
this.tokens = [];
Function inputsWatchDelegate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression) {
var inputExpressions = parsedExpression.$$inputs ||
(parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs, []));
var lastResult;
Function $parse
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function $parse(exp, interceptorFn, expensiveChecks) {
var parsedExpression, oneTime, cacheKey;
switch (typeof exp) {
case 'string':
Function ngEventDirectivesDecorator
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ngEventDirectivesDecorator(ngEventAttrName) {
return function ($delegate, $parse) {
var originalCompileFn = $delegate[0].compile;
$delegate[0].compile = function(element, attrs, transclude) {
Function $watch
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
scopePrototype.$watch = function (watchExpression, reactionFunction) {
// Convert the `watchExpression` to a function (if not already one).
// This is also the first thing `Scope.$watch()` does.
var parsedExpression = $parse(watchExpression);
Function shallowCopy
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function shallowCopy(src, dst) {
if (isArray(src)) {
dst = dst || [];
for (var i = 0, ii = src.length; i < ii; i++) {
- 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
primary: function() {
var primary;
if (this.expect('(')) {
primary = this.filterChain();
this.consume(')');
Function functionCall
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
functionCall: function(fnGetter, contextGetter) {
var argsFn = [];
if (this.peekToken().text !== ')') {
do {
argsFn.push(this.expression());
Function object
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
object: function() {
var keys = [], valueFns = [];
if (this.peekToken().text !== '}') {
do {
if (this.peek('}')) {
Function readNumber
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
readNumber: function() {
var number = '';
var start = this.index;
while (this.index < this.text.length) {
var ch = lowercase(this.text.charAt(this.index));
Function scopeDescriptor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function scopeDescriptor (elt, scope) {
var val,
theseTypes = [],
noDataDefault = 'scope.$id=' + scope.$id,
type;
Function filter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
filter: function(inputFn) {
var fn = this.$filter(this.consume().text);
var argsFn;
var args;
- 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 getterFn
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getterFn(path, options, fullExp) {
var expensiveChecks = options.expensiveChecks;
var getterFnCache = (expensiveChecks ? getterFnCacheExpensive : getterFnCacheDefault);
var fn = getterFnCache[path];
if (fn) return fn;