Showing 193 of 398 total issues

Function tmpl has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var tmpl = (function () {

  var _cache = {};

  function _tmpl (str, data) {
Severity: Major
Found in dist/csp.tmpl.js - About 5 hrs to fix

    Function tmpl has 149 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var tmpl = (function () {
    
      var _cache = {}
    
      function _tmpl (str, data) {
    Severity: Major
    Found in dist/es6.tmpl.js - About 5 hrs to fix

      Function tmpl has 148 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var tmpl = (function () {
      
          var _cache = {}
      
          function _tmpl (str, data) {
      Severity: Major
      Found in dist/tmpl.js - About 5 hrs to fix

        Function parseForStatement has 144 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                Parser.prototype.parseForStatement = function () {
                    var init = null;
                    var test = null;
                    var update = null;
                    var forIn = true;
        Severity: Major
        Found in dist/csp.tmpl.js - About 5 hrs to fix

          Function CommentHandler has 140 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var CommentHandler = (function () {
                  function CommentHandler() {
                      this.attach = false;
                      this.comments = [];
                      this.stack = [];
          Severity: Major
          Found in dist/csp.tmpl.js - About 5 hrs to fix

            File tmpl.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            
            /* riot-tmpl v3.0.8, @license MIT, (c) 2015 Muut Inc. + contributors */
            ;(function (window) {     // eslint-disable-line no-extra-semi
              'use strict'
            
            
            Severity: Minor
            Found in dist/tmpl.js - About 5 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                          if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
                                              str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
                                              str === '++' || str === '--' || str === '<<' || str === '>>' ||
                                              str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
                                              str === '<=' || str === '>=' || str === '=>' || str === '**') {
              Severity: Critical
              Found in dist/csp.tmpl.js - About 5 hrs to fix

                File es6.tmpl.js has 382 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                
                /**
                 * The riot template engine
                 * @version v3.0.8
                 */
                Severity: Minor
                Found in dist/es6.tmpl.js - About 5 hrs to fix

                  Function scanTemplate has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          Scanner.prototype.scanTemplate = function () {
                              var cooked = '';
                              var terminated = false;
                              var start = this.index;
                              var head = (this.source[start] === '`');
                  Severity: Major
                  Found in dist/csp.tmpl.js - About 4 hrs to fix

                    Function skipRegex has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var skipRegex = (function () { //eslint-disable-line no-unused-vars
                    
                      var beforeReChars = '[{(,;:?=|&!^~>%*/'
                    
                      var beforeReWords = [
                    Severity: Minor
                    Found in dist/es6.tmpl.js - About 4 hrs 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 skipRegex has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var skipRegex = (function () { //eslint-disable-line no-unused-vars
                    
                      // safe characters to precced a regex (including `=>`, `**`, and `...`)
                      var beforeReChars = '[{(,;:?=|&!^~>%*/'
                    
                    
                    Severity: Minor
                    Found in src/skip-regex.js - About 4 hrs 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 parseGroupExpression has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            Parser.prototype.parseGroupExpression = function () {
                                var expr;
                                this.expect('(');
                                if (this.match(')')) {
                                    this.nextToken();
                    Severity: Major
                    Found in dist/csp.tmpl.js - About 4 hrs to fix

                      Function parsePrimaryExpression has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              Parser.prototype.parsePrimaryExpression = function () {
                                  var node = this.createNode();
                                  var expr;
                                  var value, token, raw;
                                  switch (this.lookahead.type) {
                      Severity: Major
                      Found in dist/csp.tmpl.js - About 3 hrs to fix

                        Function scanStringLiteral has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                Scanner.prototype.scanStringLiteral = function () {
                                    var start = this.index;
                                    var quote = this.source[start];
                                    assert_1.assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote');
                                    ++this.index;
                        Severity: Major
                        Found in dist/csp.tmpl.js - About 3 hrs to fix

                          Function lexJSX has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  JSXParser.prototype.lexJSX = function () {
                                      var cp = this.scanner.source.charCodeAt(this.scanner.index);
                                      // < > / : = { }
                                      if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
                                          var value = this.scanner.source[this.scanner.index++];
                          Severity: Major
                          Found in dist/csp.tmpl.js - About 3 hrs to fix

                            Function parseExportDeclaration has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    Parser.prototype.parseExportDeclaration = function () {
                                        if (this.context.inFunctionBody) {
                                            this.throwError(messages_1.Messages.IllegalExportDeclaration);
                                        }
                                        var node = this.createNode();
                            Severity: Major
                            Found in dist/csp.tmpl.js - About 3 hrs to fix

                              Function parseStatement has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      Parser.prototype.parseStatement = function () {
                                          var statement = null;
                                          switch (this.lookahead.type) {
                                              case token_1.Token.BooleanLiteral:
                                              case token_1.Token.NullLiteral:
                              Severity: Major
                              Found in dist/csp.tmpl.js - About 3 hrs to fix

                                Function parseClassElement has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        Parser.prototype.parseClassElement = function (hasConstructor) {
                                            var token = this.lookahead;
                                            var node = this.createNode();
                                            var kind;
                                            var key;
                                Severity: Major
                                Found in dist/csp.tmpl.js - About 3 hrs to fix

                                  Function parseObjectProperty has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          Parser.prototype.parseObjectProperty = function (hasProto) {
                                              var node = this.createNode();
                                              var token = this.lookahead;
                                              var kind;
                                              var key;
                                  Severity: Major
                                  Found in dist/csp.tmpl.js - About 3 hrs to fix

                                    Function Parser has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            function Parser(code, options, delegate) {
                                                if (options === void 0) { options = {}; }
                                                this.config = {
                                                    range: (typeof options.range === 'boolean') && options.range,
                                                    loc: (typeof options.loc === 'boolean') && options.loc,
                                    Severity: Major
                                    Found in dist/csp.tmpl.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language