src/tmpl.js
Function tmpl
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
Open
var tmpl = (function () {
//
// Closure data
// --------------------------------------------------------------------------
var _cache = {}
- 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 tmpl
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var tmpl = (function () {
//
// Closure data
// --------------------------------------------------------------------------
var _cache = {}
Function _parseExpr
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _parseExpr (expr, asText, qstr) {
// Non-empty quoted strings and literal regexes are hidden at this point.
//
// Now, this function converts whitespace into compacted spaces and trims
Function _getTmpl
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _getTmpl (str) {
var parts = brackets.split(str.replace(RE_DQUOTE, '"'), 1)// get text/expr parts
var qstr = parts.qblocks // hidden qblocks
var expr
Function _wrapExpr
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _wrapExpr (expr, asText, key) {
var tb
expr = expr.replace(JS_VARNAME, function (match, p, mvar, pos, s) {
if (mvar) {
Parsing error: The keyword 'export' is reserved Open
Open
export
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/