Showing 398 of 398 total issues

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

  function _wrapExpr (expr, asText, key) {
    var tb;

    expr = expr.replace(JS_VARNAME, function (match, p, mvar, pos, s) {
      if (mvar) {
Severity: Major
Found in dist/csp.tmpl.js and 2 other locations - About 1 day to fix
dist/es6.tmpl.js on lines 496..531
dist/tmpl.js on lines 491..526

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

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 _wrapExpr (expr, asText, key) {
      var tb

      expr = expr.replace(JS_VARNAME, function (match, p, mvar, pos, s) {
        if (mvar) {
Severity: Major
Found in dist/tmpl.js and 2 other locations - About 1 day to fix
dist/csp.tmpl.js on lines 7666..7701
dist/es6.tmpl.js on lines 496..531

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

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 _wrapExpr (expr, asText, key) {
    var tb

    expr = expr.replace(JS_VARNAME, function (match, p, mvar, pos, s) {
      if (mvar) {
Severity: Major
Found in dist/es6.tmpl.js and 2 other locations - About 1 day to fix
dist/csp.tmpl.js on lines 7666..7701
dist/tmpl.js on lines 491..526

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

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 87 (exceeds 5 allowed). Consider refactoring.
Open

var brackets = (function (UNDEF) {

  var
    REGLOB = 'g',

Severity: Minor
Found in dist/es6.tmpl.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

Function tmpl has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
Open

var tmpl = (function () {
  //
  // Closure data
  // --------------------------------------------------------------------------
  var _cache = {}
Severity: Minor
Found in src/tmpl.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

Function evaluateAst has 299 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function evaluateAst(tree, context){

  var safeFunction = FunctionFactory(context);
  var primitives = Primitives(context);

Severity: Major
Found in dist/csp.tmpl.js - About 1 day to fix

    Function evaluateAst has 299 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function evaluateAst(tree, context){
    
      var safeFunction = FunctionFactory(context)
      var primitives = Primitives(context)
    
    
    Severity: Major
    Found in src/notevil/index.js - About 1 day to fix

      Function tmpl has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
      Open

      var tmpl = (function () {
      
        var _cache = {}
      
        function _tmpl (str, data) {
      Severity: Minor
      Found in dist/es6.tmpl.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

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

        function walk(node){
          if (!node) return
      
          switch (node.type) {
      
      
      Severity: Major
      Found in dist/csp.tmpl.js - About 1 day to fix

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

          function walk(node){
            if (!node) return
        
            switch (node.type) {
        
        
        Severity: Major
        Found in src/notevil/index.js - About 1 day to fix

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

          function getFunction(body, params, parentContext){
            return function(){
              var context = Object.create(parentContext),
                g = getGlobal()
          
          
          Severity: Major
          Found in src/notevil/index.js and 1 other location - About 1 day to fix
          dist/csp.tmpl.js on lines 7127..7154

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

          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 getFunction(body, params, parentContext){
            return function(){
              var context = Object.create(parentContext),
                g = getGlobal();
          
          
          Severity: Major
          Found in dist/csp.tmpl.js and 1 other location - About 1 day to fix
          src/notevil/index.js on lines 480..507

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

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

          var brackets = (function (UNDEF) {
            //
            // Closure data
            // --------------------------------------------------------------------------
            //
          Severity: Major
          Found in src/brackets.js - About 7 hrs to fix

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

                function _logErr (err, ctx) {
            
                  err.riotData = {
                    tagName: ctx && ctx.__ && ctx.__.tagName,
                    _riot_id: ctx && ctx._riot_id  //eslint-disable-line camelcase
            Severity: Major
            Found in dist/tmpl.js and 2 other locations - About 6 hrs to fix
            dist/csp.tmpl.js on lines 7527..7543
            dist/es6.tmpl.js on lines 357..373

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

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

              function _logErr (err, ctx) {
            
                err.riotData = {
                  tagName: ctx && ctx.__ && ctx.__.tagName,
                  _riot_id: ctx && ctx._riot_id  //eslint-disable-line camelcase
            Severity: Major
            Found in dist/csp.tmpl.js and 2 other locations - About 6 hrs to fix
            dist/es6.tmpl.js on lines 357..373
            dist/tmpl.js on lines 352..368

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

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

              function _logErr (err, ctx) {
            
                err.riotData = {
                  tagName: ctx && ctx.__ && ctx.__.tagName,
                  _riot_id: ctx && ctx._riot_id  //eslint-disable-line camelcase
            Severity: Major
            Found in dist/es6.tmpl.js and 2 other locations - About 6 hrs to fix
            dist/csp.tmpl.js on lines 7527..7543
            dist/tmpl.js on lines 352..368

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

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

            var brackets = (function (UNDEF) {
            
              var
                REGLOB = 'g',
            
            
            Severity: Major
            Found in dist/csp.tmpl.js - About 6 hrs to fix

              Function brackets has 173 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var brackets = (function (UNDEF) {
              
                var
                  REGLOB = 'g',
              
              
              Severity: Major
              Found in dist/es6.tmpl.js - About 6 hrs to fix

                Function brackets has 173 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var brackets = (function (UNDEF) {
                
                    var
                      REGLOB = 'g',
                
                
                Severity: Major
                Found in dist/tmpl.js - About 6 hrs to fix

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

                  function FunctionFactory(parentContext){
                    var context = Object.create(parentContext || {});
                    return function Function() {
                      // normalize arguments array
                      var args = Array.prototype.slice.call(arguments);
                  Severity: Major
                  Found in dist/csp.tmpl.js and 1 other location - About 6 hrs to fix
                  src/notevil/index.js on lines 20..34

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

                  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