Showing 398 of 398 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        Parser.prototype.parseImportDefaultSpecifier = function () {
            var node = this.createNode();
            var local = this.parseIdentifierName();
            return this.finalize(node, new Node.ImportDefaultSpecifier(local));
        };
Severity: Major
Found in dist/csp.tmpl.js and 1 other location - About 1 hr to fix
dist/csp.tmpl.js on lines 3164..3168

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 67.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function _parseExpr has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function _parseExpr (expr, asText, qstr) {

    expr = expr
      .replace(/\s+/g, ' ').trim()
      .replace(/\ ?([[\({},?\.:])\ ?/g, '$1')
Severity: Minor
Found in dist/es6.tmpl.js - About 1 hr to fix

    Function parse has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function parse(code, options, delegate) {
            var commentHandler = null;
            var proxyDelegate = function (node, metadata) {
                if (delegate) {
                    delegate(node, metadata);
    Severity: Minor
    Found in dist/csp.tmpl.js - About 1 hr to fix

      Function _parseExpr has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function _parseExpr (expr, asText, qstr) {
      
          expr = expr
            .replace(/\s+/g, ' ').trim()
            .replace(/\ ?([[\({},?\.:])\ ?/g, '$1');
      Severity: Minor
      Found in dist/csp.tmpl.js - About 1 hr to fix

        Function _parseExpr has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _parseExpr (expr, asText, qstr) {
        
              expr = expr
                .replace(/\s+/g, ' ').trim()
                .replace(/\ ?([[\({},?\.:])\ ?/g, '$1')
        Severity: Minor
        Found in dist/tmpl.js - About 1 hr 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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                            return {
                                type: token_1.Token.StringLiteral,
                                value: str,
                                lineNumber: this.scanner.lineNumber,
                                lineStart: this.scanner.lineStart,
            Severity: Major
            Found in dist/csp.tmpl.js and 1 other location - About 1 hr to fix
            dist/csp.tmpl.js on lines 5642..5649

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 66.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                            return {
                                type: token_1.Token.Punctuator,
                                value: value,
                                lineNumber: this.scanner.lineNumber,
                                lineStart: this.scanner.lineStart,
            Severity: Major
            Found in dist/csp.tmpl.js and 1 other location - About 1 hr to fix
            dist/csp.tmpl.js on lines 5626..5633

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 66.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function parseStatementListItem has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    Parser.prototype.parseStatementListItem = function () {
                        var statement = null;
                        this.context.isAssignmentTarget = true;
                        this.context.isBindingElement = true;
                        if (this.lookahead.type === token_1.Token.Keyword) {
            Severity: Minor
            Found in dist/csp.tmpl.js - About 1 hr to fix

              Function lex has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      Scanner.prototype.lex = function () {
                          if (this.eof()) {
                              return {
                                  type: token_1.Token.EOF,
                                  lineNumber: this.lineNumber,
              Severity: Minor
              Found in dist/csp.tmpl.js - About 1 hr to fix

                Function unexpectedTokenError has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        Parser.prototype.unexpectedTokenError = function (token, message) {
                            var msg = message || messages_1.Messages.UnexpectedToken;
                            var value;
                            if (token) {
                                if (!message) {
                Severity: Minor
                Found in dist/csp.tmpl.js - About 1 hr to fix

                  Function parseUpdateExpression has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          Parser.prototype.parseUpdateExpression = function () {
                              var expr;
                              var startToken = this.lookahead;
                              if (this.match('++') || this.match('--')) {
                                  var node = this.startNode(startToken);
                  Severity: Minor
                  Found in dist/csp.tmpl.js - About 1 hr to fix

                    Function nextJSXText has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            JSXParser.prototype.nextJSXText = function () {
                                this.startMarker.index = this.scanner.index;
                                this.startMarker.lineNumber = this.scanner.lineNumber;
                                this.startMarker.lineStart = this.scanner.lineStart;
                                var start = this.scanner.index;
                    Severity: Minor
                    Found in dist/csp.tmpl.js - About 1 hr to fix

                      Function collectComments has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              Parser.prototype.collectComments = function () {
                                  if (!this.config.comment) {
                                      this.scanner.scanComments();
                                  }
                                  else {
                      Severity: Minor
                      Found in dist/csp.tmpl.js - About 1 hr to fix

                        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

                              Identical blocks of code found in 2 locations. Consider refactoring.
                              Open

                                function _create (str) {
                                  var expr = _getTmpl(str)
                              
                                  if (expr.slice(0, 11) !== 'try{return ') expr = 'return ' + expr
                              
                              
                              Severity: Major
                              Found in dist/es6.tmpl.js and 1 other location - About 1 hr to fix
                              dist/tmpl.js on lines 370..376

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 62.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 2 locations. Consider refactoring.
                              Open

                              function objectForKey(object, key, primitives){
                                var proto = primitives.getPrototypeOf(object);
                                if (!proto || hasOwnProperty(object, key)){
                                  return object
                                } else {
                              Severity: Major
                              Found in dist/csp.tmpl.js and 1 other location - About 1 hr to fix
                              src/notevil/index.js on lines 428..435

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 62.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 2 locations. Consider refactoring.
                              Open

                              function objectForKey(object, key, primitives){
                                var proto = primitives.getPrototypeOf(object)
                                if (!proto || hasOwnProperty(object, key)){
                                  return object
                                } else {
                              Severity: Major
                              Found in src/notevil/index.js and 1 other location - About 1 hr to fix
                              dist/csp.tmpl.js on lines 7075..7082

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 62.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Severity
                              Category
                              Status
                              Source
                              Language