Showing 41 of 71 total issues
Function on_multi
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
StaticMerger.prototype.on_multi = function(exps) {
var res = ['multi'], node;
for (var i = 1, l = exps.length; i < l; i++) {
var exp = exps[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 _parseLine
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
p._parseLine = function() {
if (emptyLineRe.test(this._line)) {
this._pushOnTop(['newline']);
return;
}
- 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 _parseJSCode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
p._parseJSCode = function(outerDelimeter) {
var code = '', count = 0, delimiter, closeDelimiter, m;
// Attribute ends with space or attribute delimiter
var endRe = new RegExp('^[\\s' + this._escapeRegExp(outerDelimeter) + ']');
Function assertHtml
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
exports.assertHtml = function(template, src, result, options) {
if (Array.isArray(src)) {
src = src.join('\n');
}
- 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 content
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
VMProto.content = function() {
var cb, mod, name;
switch (arguments.length) {
case 0: // return main content
return safe(this.res);
Function _parseLine
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
p._parseLine = function() {
if (emptyLineRe.test(this._line)) {
this._pushOnTop(['newline']);
return;
}
Function on_html_attr
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
p.on_html_attr = function(exps) {
var name = exps[2], value = exps[3];
if (value[0] === 'slm' && value[1] === 'attrvalue' && !this._mergeAttrs[name]) {
// We handle the attribute as a boolean attribute
var escape = value[2], code = value[3];
Function on_slm_interpolate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
p.on_slm_interpolate = function(exps) {
var str = exps[2], m, code;
// Interpolate variables in text (${variable}).
// Split the text into multiple dynamic and static parts.
- 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 __express
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
slm.__express = function(path, options, fn) {
FS.readFile(path, 'utf-8', function (err, src) {
if (err) {
return fn(new Error(err));
}
- 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 on_multi
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
MultiFlattener.prototype.on_multi = function(exps) {
// If the multi contains a single element, just return the element
var len = exps.length;
if (len === 2) {
return this.compile(exps[1]);
- 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
Avoid deeply nested control flow statements. Open
if (j) {
exp.push(['static', delimiter]);
}
Function _isContainNonEmptyStatic
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
p._isContainNonEmptyStatic = function(exp) {
switch (exp[0]) {
case 'multi':
for (var i = 1, l = exp.length; i < l; i++) {
if (this._isContainNonEmptyStatic(exp[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 on_html_doctype
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
p.on_html_doctype = function(exps) {
var type = exps[2];
var html = '<!DOCTYPE html>';
- 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 _isEmptyExp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
p._isEmptyExp = function(exp) {
switch (exp[0]) {
case 'multi':
for (var i = 1, l = exp.length; i < l; i++) {
if (!this._isEmptyExp(exp[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 on_html_attrs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
p.on_html_attrs = function(exps) {
var names = [], values = {};
for (var i = 2, l = exps.length; i < l; i++) {
var attr = exps[i];
var name = attr[2].toString(), val = attr[3];
- 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 on_html_tag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
p.on_html_tag = function(exps) {
var name = exps[2].toString(), attrs = exps[3], content = exps[4];
var closed = !content || (this._isEmptyExp(content) && (this._format === 'xml' || this._autoclose.indexOf(name) !== -1));
- 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 _resolvePath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
p._resolvePath = function(path) {
var basename = Path.basename,
dirname = Path.dirname,
join = Path.join;
- 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 content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
VMProto.content = function() {
var cb, mod, name;
switch (arguments.length) {
case 0: // return main content
return safe(this.res);
- 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 _parseExpression
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
p._parseExpression = function(str) {
for (var count = 1, i = 0, l = str.length; i < l && count; i++) {
if (str[i] === '{') {
count++;
} else if (str[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 _expandCode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
p._expandCode = function(code, postCode) {
var index, m = callbackRe.exec(code);
if (m) {
index = m.index + m[1].length;
postCode += code.slice(index);
- 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"