src/brackets.js

Summary

Maintainability
D
3 days
Test Coverage

Function brackets has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
Open

var brackets = (function (UNDEF) {
  //
  // Closure data
  // --------------------------------------------------------------------------
  //
Severity: Minor
Found in src/brackets.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 brackets has 180 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var brackets = (function (UNDEF) {
  //
  // Closure data
  // --------------------------------------------------------------------------
  //
Severity: Major
Found in src/brackets.js - About 7 hrs to fix

    Function split has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _brackets.split = function split (str, tmpl, _bp) {
        // istanbul ignore next: _bp is for the compiler
        if (!_bp) _bp = _cache
    
        // Template text is easy: closing brackets are ignored, all we have to do is find
    Severity: Major
    Found in src/brackets.js - About 2 hrs to fix

      Avoid deeply nested control flow statements.
      Open

                  if (match[1]) {
                    if (match[1] === ch) ++ix
                    else if (!--ix) break
                  } else {
                    rech.lastIndex = pushQBlock(match.index, rech.lastIndex, match[2])
      Severity: Major
      Found in src/brackets.js - About 45 mins to fix

        Parsing error: The keyword 'export' is reserved
        Open

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

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

        There are no issues that match your filters.

        Category
        Status