Showing 193 of 398 total issues

Function parseComplexJSXElement has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        JSXParser.prototype.parseComplexJSXElement = function (el) {
            var stack = [];
            while (!this.scanner.eof()) {
                el.children = el.children.concat(this.parseJSXChildren());
                var node = this.createJSXChildNode();
Severity: Minor
Found in dist/csp.tmpl.js - About 1 hr to fix

    Function parsePropertyPattern has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            Parser.prototype.parsePropertyPattern = function (params, kind) {
                var node = this.createNode();
                var computed = false;
                var shorthand = false;
                var method = false;
    Severity: Minor
    Found in dist/csp.tmpl.js - About 1 hr to fix

      Function finalize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              Parser.prototype.finalize = function (meta, node) {
                  if (this.config.range) {
                      node.range = [meta.index, this.lastMarker.index];
                  }
                  if (this.config.loc) {
      Severity: Minor
      Found in dist/csp.tmpl.js - About 1 hr to fix

        Function findLeadingComments has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                CommentHandler.prototype.findLeadingComments = function (node, metadata) {
                    var leadingComments = [];
                    var target;
                    while (this.stack.length > 0) {
                        var entry = this.stack[this.stack.length - 1];
        Severity: Minor
        Found in dist/csp.tmpl.js - About 1 hr to fix

          Function reinterpretExpressionAsPattern has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  Parser.prototype.reinterpretExpressionAsPattern = function (expr) {
                      switch (expr.type) {
                          case syntax_1.Syntax.Identifier:
                          case syntax_1.Syntax.MemberExpression:
                          case syntax_1.Syntax.RestElement:
          Severity: Minor
          Found in dist/csp.tmpl.js - About 1 hr to fix

            Function canSetProperty has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function canSetProperty(object, property, primitives){
              if (property === '__proto__' || primitives.isPrimitive(object)){
                return false
              } else if (object != null){
            
            
            Severity: Minor
            Found in src/notevil/index.js - About 1 hr 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 validateParam has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    Parser.prototype.validateParam = function (options, param, name) {
                        var key = '$' + name;
                        if (this.context.strict) {
                            if (this.scanner.isRestrictedWord(name)) {
                                options.stricted = param;
            Severity: Minor
            Found in dist/csp.tmpl.js - About 1 hr to fix

              Function parseObjectPropertyKey has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      Parser.prototype.parseObjectPropertyKey = function () {
                          var node = this.createNode();
                          var token = this.nextToken();
                          var key = null;
                          switch (token.type) {
              Severity: Minor
              Found in dist/csp.tmpl.js - About 1 hr to fix

                Function scanOctalLiteral has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        Scanner.prototype.scanOctalLiteral = function (prefix, start) {
                            var number = '';
                            var octal = false;
                            if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) {
                                octal = true;
                Severity: Minor
                Found in dist/csp.tmpl.js - About 1 hr to fix

                  Function testRegExp has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          Scanner.prototype.testRegExp = function (pattern, flags) {
                              // The BMP character to use as a replacement for astral symbols when
                              // translating an ES6 "u"-flagged pattern to an ES5-compatible
                              // approximation.
                              // Note: replacing with '\uFFFF' enables false positives in unlikely
                  Severity: Minor
                  Found in dist/csp.tmpl.js - About 1 hr to fix

                    Function walk has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function walk(node){
                        var parent = parentStack[parentStack.length-1];
                        var remove = false;
                        parentStack.push(node);
                    
                    
                    Severity: Minor
                    Found in dist/csp.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);
                          var qstr = parts.qblocks;
                          var expr;
                      
                      
                      Severity: Minor
                      Found in dist/csp.tmpl.js - About 1 hr to fix

                        Function parseLeftHandSideExpression has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                Parser.prototype.parseLeftHandSideExpression = function () {
                                    assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.');
                                    var node = this.startNode(this.lookahead);
                                    var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() :
                                        this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
                        Severity: Minor
                        Found in dist/csp.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)
                              var qstr = parts.qblocks
                              var expr
                          
                          
                          Severity: Minor
                          Found in dist/es6.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)
                                  var qstr = parts.qblocks
                                  var expr
                            
                            
                            Severity: Minor
                            Found in dist/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 visitComment has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        CommentHandler.prototype.visitComment = function (node, metadata) {
                                            var type = (node.type[0] === 'L') ? 'Line' : 'Block';
                                            var comment = {
                                                type: type,
                                                value: node.value
                                Severity: Minor
                                Found in dist/csp.tmpl.js - About 1 hr to fix

                                  Function _skipRegex has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function _skipRegex (code, start) {
                                  
                                      var re = /.*/g
                                      var pos = re.lastIndex = start++
                                      var match = re.exec(code)[0].match(RE_REGEX)
                                  Severity: Minor
                                  Found in dist/es6.tmpl.js - About 1 hr to fix

                                    Function _skipRegex has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function _skipRegex (code, start) {
                                    
                                          var re = /.*/g
                                          var pos = re.lastIndex = start++
                                          var match = re.exec(code)[0].match(RE_REGEX)
                                    Severity: Minor
                                    Found in dist/tmpl.js - About 1 hr to fix

                                      Function _skipRegex has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function _skipRegex (code, start) {
                                      
                                          var re = /.*/g;
                                          var pos = re.lastIndex = start++;
                                          var match = re.exec(code)[0].match(RE_REGEX);
                                      Severity: Minor
                                      Found in dist/csp.tmpl.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language