Showing 16 of 25 total issues
Function forEach
has a Cognitive Complexity of 60 (exceeds 20 allowed). Consider refactoring. Open
forEach(options) {
if ( options.value !== undefined ) {
for ( let i in this ) {
switch ( options.action ) {
case 'attr': this[i].setAttribute(options.name, options.value); break;
- 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 eval
has a Cognitive Complexity of 58 (exceeds 20 allowed). Consider refactoring. Open
eval(model, item, property) {
if ( item === undefined )
item = this.tree;
let value, tmp, number, type = typeof item;
switch ( type ) {
- 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 parse_tree
has a Cognitive Complexity of 57 (exceeds 20 allowed). Consider refactoring. Open
parse_tree(tokens, item) {
if ( item === undefined )
item = {};
if ( item.params === undefined )
item.params = [];
- 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 EventeExpression.js
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
const EventeModel = require('./EventeModel');
const EventePipes = require('./EventePipes');
const EventeStrings = require('./EventeStrings');
/**
Function parse_tree
has 88 lines of code (exceeds 50 allowed). Consider refactoring. Open
parse_tree(tokens, item) {
if ( item === undefined )
item = {};
if ( item.params === undefined )
item.params = [];
Function dealias
has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring. Open
dealias(node, alias, base) {
let value,
regexp = new RegExp('(^|[^a-z])' + alias.replace(/\./g, '\\.') + '([^a-z]|$)', 'gim'),
test = new RegExp('{{');
if ( node instanceof Text ) {
- 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 forEach
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
forEach(options) {
if ( options.value !== undefined ) {
for ( let i in this ) {
switch ( options.action ) {
case 'attr': this[i].setAttribute(options.name, options.value); break;
Function eval
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
eval(model, item, property) {
if ( item === undefined )
item = this.tree;
let value, tmp, number, type = typeof item;
switch ( type ) {
Function dealias
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
dealias(node, alias, base) {
let value,
regexp = new RegExp('(^|[^a-z])' + alias.replace(/\./g, '\\.') + '([^a-z]|$)', 'gim'),
test = new RegExp('{{');
if ( node instanceof Text ) {
Avoid deeply nested control flow statements. Open
if ( EventeExpression.operations[item.type].priority >= EventeExpression.operations['.'].priority )
item = {type: '.', params: [item, token]};
else
item.params.push({type: '.', params: [item.params.pop(), token]});
Avoid too many return
statements within this function. Open
if ( !tmp ) return false;
Avoid too many return
statements within this function. Open
return item;
Avoid too many return
statements within this function. Open
if ( !tmp ) return false;
Avoid too many return
statements within this function. Open
if ( tmp ) return true;
Function handle
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
handle(route, push) {
route = this.normalize(route);
if ( this.routes[route] !== undefined ) {
if ( push )
window.history.pushState({}, '', '/' + route);
- 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 unlink
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
unlink(node, property) {
if ( property === undefined ) {
if ( node.e_links !== undefined ) {
for ( let link of node.e_links )
this.unlink(node, link);
- 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"