Showing 398 of 398 total issues

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/tmpl.js and 1 other location - About 1 hr to fix
dist/es6.tmpl.js on lines 375..381

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

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

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

                if (this.matchJSX(':')) {
                    var namespace = identifier;
                    this.expectJSX(':');
                    var name_2 = this.parseJSXIdentifier();
                    attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2));
    Severity: Major
    Found in dist/csp.tmpl.js and 1 other location - About 1 hr to fix
    dist/csp.tmpl.js on lines 5777..5790

    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 61.

    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

                else if (token.type === token_1.Token.Punctuator && token.value === '*' && lookaheadPropertyKey) {
                    kind = 'init';
                    computed = this.match('[');
                    key = this.parseObjectPropertyKey();
                    value = this.parseGeneratorMethod();
    Severity: Major
    Found in dist/csp.tmpl.js and 1 other location - About 1 hr to fix
    dist/csp.tmpl.js on lines 3112..3118

    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 61.

    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

                if (this.matchJSX(':')) {
                    var namespace = elementName;
                    this.expectJSX(':');
                    var name_1 = this.parseJSXIdentifier();
                    elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1));
    Severity: Major
    Found in dist/csp.tmpl.js and 1 other location - About 1 hr to fix
    dist/csp.tmpl.js on lines 5797..5805

    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 61.

    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

                else if (token.type === token_1.Token.Punctuator && token.value === '*' && lookaheadPropertyKey) {
                    kind = 'init';
                    computed = this.match('[');
                    key = this.parseObjectPropertyKey();
                    value = this.parseGeneratorMethod();
    Severity: Major
    Found in dist/csp.tmpl.js and 1 other location - About 1 hr to fix
    dist/csp.tmpl.js on lines 1225..1268

    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 61.

    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 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

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

                  var token = {
                      type: JSXToken.Text,
                      value: text,
                      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 5680..5687

      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 60.

      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: JSXToken.Identifier,
                          value: id,
                          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 5729..5736

      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 60.

      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 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

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

            export function getGlobal (str) {
              var ctx = (typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this)
              return typeof str !== 'undefined' ? ctx[str] : ctx
            }
            Severity: Major
            Found in src/notevil/helpers.js and 1 other location - About 1 hr to fix
            dist/csp.tmpl.js on lines 23..26

            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 59.

            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 3 locations. Consider refactoring.
            Open

                    Parser.prototype.matchContextualKeyword = function (keyword) {
                        return this.lookahead.type === token_1.Token.Identifier && this.lookahead.value === keyword;
                    };
            Severity: Major
            Found in dist/csp.tmpl.js and 2 other locations - About 1 hr to fix
            dist/csp.tmpl.js on lines 891..893
            dist/csp.tmpl.js on lines 895..897

            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 59.

            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 3 locations. Consider refactoring.
            Open

                    Parser.prototype.matchKeyword = function (keyword) {
                        return this.lookahead.type === token_1.Token.Keyword && this.lookahead.value === keyword;
                    };
            Severity: Major
            Found in dist/csp.tmpl.js and 2 other locations - About 1 hr to fix
            dist/csp.tmpl.js on lines 891..893
            dist/csp.tmpl.js on lines 900..902

            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 59.

            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 3 locations. Consider refactoring.
            Open

                    Parser.prototype.match = function (value) {
                        return this.lookahead.type === token_1.Token.Punctuator && this.lookahead.value === value;
                    };
            Severity: Major
            Found in dist/csp.tmpl.js and 2 other locations - About 1 hr to fix
            dist/csp.tmpl.js on lines 895..897
            dist/csp.tmpl.js on lines 900..902

            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 59.

            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

            function getGlobal (str) {
              var ctx = (typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this);
              return typeof str !== 'undefined' ? ctx[str] : ctx
            }
            Severity: Major
            Found in dist/csp.tmpl.js and 1 other location - About 1 hr to fix
            src/notevil/helpers.js on lines 1..4

            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 59.

            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 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 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
                Severity
                Category
                Status
                Source
                Language