src/tmpl.js

Summary

Maintainability
D
2 days
Test Coverage

Function tmpl has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
Open

var tmpl = (function () {
  //
  // Closure data
  // --------------------------------------------------------------------------
  var _cache = {}
Severity: Minor
Found in src/tmpl.js - About 1 day to fix

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

var tmpl = (function () {
  //
  // Closure data
  // --------------------------------------------------------------------------
  var _cache = {}
Severity: Major
Found in src/tmpl.js - About 6 hrs to fix

    Function _parseExpr has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    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
    Severity: Minor
    Found in src/tmpl.js - About 1 hr to fix

      Function _getTmpl has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      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
      
      
      Severity: Minor
      Found in src/tmpl.js - About 1 hr to fix

        Function _wrapExpr has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function _wrapExpr (expr, asText, key) {
            var tb
        
            expr = expr.replace(JS_VARNAME, function (match, p, mvar, pos, s) {
              if (mvar) {
        Severity: Minor
        Found in src/tmpl.js - About 1 hr to fix

          Parsing error: The keyword 'export' is reserved
          Open

          export
          Severity: Minor
          Found in src/tmpl.js by eslint

          For more information visit Source: http://eslint.org/docs/rules/

          There are no issues that match your filters.

          Category
          Status