Showing 398 of 398 total issues

Function esprima has 5947 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var esprima = createCommonjsModule(function (module, exports) {
(function webpackUniversalModuleDefinition(root, factory) {
/* istanbul ignore next */
    module.exports = factory();
})(commonjsGlobal, function() {
Severity: Major
Found in dist/csp.tmpl.js - About 1 mo to fix

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

    (function (global, factory) {
        typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
        typeof define === 'function' && define.amd ? define(['exports'], factory) :
        (factory((global.cspTmpl = global.cspTmpl || {})));
    }(this, (function (exports) { 'use strict';
    Severity: Major
    Found in dist/csp.tmpl.js - About 2 wks to fix

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

      function evaluateAst(tree, context){
      
        var safeFunction = FunctionFactory(context);
        var primitives = Primitives(context);
      
      
      Severity: Major
      Found in dist/csp.tmpl.js and 1 other location - About 2 wks to fix
      src/notevil/index.js on lines 43..417

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

      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 evaluateAst(tree, context){
      
        var safeFunction = FunctionFactory(context)
        var primitives = Primitives(context)
      
      
      Severity: Major
      Found in src/notevil/index.js and 1 other location - About 2 wks to fix
      dist/csp.tmpl.js on lines 6690..7064

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

      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 Parser has 2764 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var Parser = (function () {
              function Parser(code, options, delegate) {
                  if (options === void 0) { options = {}; }
                  this.config = {
                      range: (typeof options.range === 'boolean') && options.range,
      Severity: Major
      Found in dist/csp.tmpl.js - About 1 wk to fix

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

        var brackets = (function (UNDEF) {
        
          var
            REGLOB = 'g',
        
        
        Severity: Major
        Found in dist/es6.tmpl.js and 2 other locations - About 1 wk to fix
        dist/csp.tmpl.js on lines 7268..7493
        dist/tmpl.js on lines 93..318

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

        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

        var brackets = (function (UNDEF) {
        
          var
            REGLOB = 'g',
        
        
        Severity: Major
        Found in dist/csp.tmpl.js and 2 other locations - About 1 wk to fix
        dist/es6.tmpl.js on lines 97..322
        dist/tmpl.js on lines 93..318

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

        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

          var brackets = (function (UNDEF) {
        
            var
              REGLOB = 'g',
        
        
        Severity: Major
        Found in dist/tmpl.js and 2 other locations - About 1 wk to fix
        dist/csp.tmpl.js on lines 7268..7493
        dist/es6.tmpl.js on lines 97..322

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

        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 Scanner has 1052 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var Scanner = (function () {
                function Scanner(code, handler) {
                    this.source = code;
                    this.errorHandler = handler;
                    this.trackComment = false;
        Severity: Major
        Found in dist/csp.tmpl.js - About 5 days to fix

          Function evaluateAst has a Cognitive Complexity of 155 (exceeds 5 allowed). Consider refactoring.
          Open

          function evaluateAst(tree, context){
          
            var safeFunction = FunctionFactory(context)
            var primitives = Primitives(context)
          
          
          Severity: Minor
          Found in src/notevil/index.js - About 3 days 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 skipRegex = (function () { //eslint-disable-line no-unused-vars
          
            var beforeReChars = '[{(,;:?=|&!^~>%*/';
          
            var beforeReWords = [
          Severity: Major
          Found in dist/csp.tmpl.js and 1 other location - About 2 days to fix
          dist/es6.tmpl.js on lines 7..83

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

          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

          var skipRegex = (function () { //eslint-disable-line no-unused-vars
          
            var beforeReChars = '[{(,;:?=|&!^~>%*/'
          
            var beforeReWords = [
          Severity: Major
          Found in dist/es6.tmpl.js and 1 other location - About 2 days to fix
          dist/csp.tmpl.js on lines 7179..7255

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

          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

              function _parseExpr (expr, asText, qstr) {
          
                expr = expr
                  .replace(/\s+/g, ' ').trim()
                  .replace(/\ ?([[\({},?\.:])\ ?/g, '$1')
          Severity: Major
          Found in dist/tmpl.js and 2 other locations - About 2 days to fix
          dist/csp.tmpl.js on lines 7608..7658
          dist/es6.tmpl.js on lines 438..488

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

          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

            function _parseExpr (expr, asText, qstr) {
          
              expr = expr
                .replace(/\s+/g, ' ').trim()
                .replace(/\ ?([[\({},?\.:])\ ?/g, '$1');
          Severity: Major
          Found in dist/csp.tmpl.js and 2 other locations - About 2 days to fix
          dist/es6.tmpl.js on lines 438..488
          dist/tmpl.js on lines 433..483

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

          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

            function _parseExpr (expr, asText, qstr) {
          
              expr = expr
                .replace(/\s+/g, ' ').trim()
                .replace(/\ ?([[\({},?\.:])\ ?/g, '$1')
          Severity: Major
          Found in dist/es6.tmpl.js and 2 other locations - About 2 days to fix
          dist/csp.tmpl.js on lines 7608..7658
          dist/tmpl.js on lines 433..483

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

          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 JSXParser has 470 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var JSXParser = (function (_super) {
                  __extends(JSXParser, _super);
                  function JSXParser(code, options, delegate) {
                      _super.call(this, code, options, delegate);
                  }
          Severity: Major
          Found in dist/csp.tmpl.js - About 2 days to fix

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

              function _getTmpl (str) {
                var parts = brackets.split(str.replace(RE_DQUOTE, '"'), 1)
                var qstr = parts.qblocks
                var expr
            
            
            Severity: Major
            Found in dist/es6.tmpl.js and 2 other locations - About 1 day to fix
            dist/csp.tmpl.js on lines 7556..7598
            dist/tmpl.js on lines 381..423

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

            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

              function _getTmpl (str) {
                var parts = brackets.split(str.replace(RE_DQUOTE, '"'), 1);
                var qstr = parts.qblocks;
                var expr;
            
            
            Severity: Major
            Found in dist/csp.tmpl.js and 2 other locations - About 1 day to fix
            dist/es6.tmpl.js on lines 386..428
            dist/tmpl.js on lines 381..423

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

            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

                function _getTmpl (str) {
                  var parts = brackets.split(str.replace(RE_DQUOTE, '"'), 1)
                  var qstr = parts.qblocks
                  var expr
            
            
            Severity: Major
            Found in dist/tmpl.js and 2 other locations - About 1 day to fix
            dist/csp.tmpl.js on lines 7556..7598
            dist/es6.tmpl.js on lines 386..428

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

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

            Severity
            Category
            Status
            Source
            Language