codenautas/self-explain

View on GitHub

Showing 254 of 254 total issues

File escodegen.browser.js has 4937 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Generated by CommonJS Everywhere 0.9.7
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Severity: Major
Found in dist/escodegen.browser.js - About 2 wks to fix

    Function clone has 767 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        }(this, function clone(exports) {
          'use strict';
          var Syntax, isArray, VisitorOption, VisitorKeys, objectCreate, objectKeys, BREAK, SKIP, REMOVE;
          function ignoreJSHintError() {
          }
    Severity: Major
    Found in dist/escodegen.browser.js - About 3 days to fix

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

              traverse(tree, {
                leave: function (node) {
                  var comment;
                  while (cursor < comments.length) {
                    comment = comments[cursor];
      Severity: Major
      Found in dist/escodegen.browser.js and 1 other location - About 1 day to fix
      dist/escodegen.browser.js on lines 4891..4916

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

      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

              traverse(tree, {
                enter: function (node) {
                  var comment;
                  while (cursor < comments.length) {
                    comment = comments[cursor];
      Severity: Major
      Found in dist/escodegen.browser.js and 1 other location - About 1 day to fix
      dist/escodegen.browser.js on lines 4918..4943

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

      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

      File self-explain.js has 551 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      "use strict";
      
      (function codenautasModuleDefinition(root, name, factory) {
          /* global define */
          /* istanbul ignore next */
      Severity: Major
      Found in lib/self-explain.js - About 1 day to fix

        Function amdefine has 188 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function amdefine(module, requireFn) {
              'use strict';
              var defineCache = {}, loaderCache = {}, alreadyCalled = false, path = require('path', module), makeRequire, stringRequire;
              function trimDots(ary) {
                var i, part;
        Severity: Major
        Found in dist/escodegen.browser.js - About 7 hrs to fix

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

                  ClassExpression: function (expr, precedence, flags) {
                    var result, fragment;
                    result = ['class'];
                    if (expr.id) {
                      result = join(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT));
          Severity: Major
          Found in dist/escodegen.browser.js and 1 other location - About 5 hrs to fix
          dist/escodegen.browser.js on lines 979..992

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

          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

                  ClassDeclaration: function (stmt, flags) {
                    var result, fragment;
                    result = ['class'];
                    if (stmt.id) {
                      result = join(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT));
          Severity: Major
          Found in dist/escodegen.browser.js and 1 other location - About 5 hrs to fix
          dist/escodegen.browser.js on lines 1759..1772

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

          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 (stmt.handlers) {
                      for (i = 0, iz = stmt.handlers.length; i < iz; ++i) {
                        result = join(result, this.generateStatement(stmt.handlers[i], S_TFFF));
                        if (stmt.finalizer || i + 1 !== iz) {
                          result = this.maybeBlockSuffix(stmt.handlers[i].body, result);
          Severity: Major
          Found in dist/escodegen.browser.js and 1 other location - About 4 hrs to fix
          dist/escodegen.browser.js on lines 1276..1288

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

          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 (isArray(stmt.handler)) {
                          for (i = 0, iz = stmt.handler.length; i < iz; ++i) {
                            result = join(result, this.generateStatement(stmt.handler[i], S_TFFF));
                            if (stmt.finalizer || i + 1 !== iz) {
                              result = this.maybeBlockSuffix(stmt.handler[i].body, result);
          Severity: Major
          Found in dist/escodegen.browser.js and 1 other location - About 4 hrs to fix
          dist/escodegen.browser.js on lines 1260..1290

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

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

                Controller.prototype.replace = function replace(root, visitor) {
                  function removeElem(element) {
                    var i, key, nextElem, parent;
                    if (element.ref.remove()) {
                      key = element.ref.key;
          Severity: Major
          Found in dist/escodegen.browser.js - About 4 hrs to fix

            Function differences has 105 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            selfExplain.assert.differences = function differences(a, b, opts, prefix){
                opts = opts || {};
                prefix = prefix || '';
                var delta = opts.delta || 0;
                var format = selfExplain.assert.formatDiff;
            Severity: Major
            Found in lib/self-explain.js - About 4 hrs to fix

              Function addComments has 103 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    function addComments(stmt, result) {
                      var i, len, comment, save, tailingToStatement, specialBase, fragment, extRange, range, prevRange, prefix, infix, suffix, count;
                      if (stmt.leadingComments && stmt.leadingComments.length > 0) {
                        save = result;
                        if (preserveBlankLines) {
              Severity: Major
              Found in dist/escodegen.browser.js - About 4 hrs to fix

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

                var Precedence = {
                    Sequence: 0,
                    Yield: 1,
                    Await: 1,
                    Assignment: 1,
                Severity: Major
                Found in lib/self-explain.js and 1 other location - About 4 hrs to fix
                dist/escodegen.browser.js on lines 94..118

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

                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

                      Precedence = {
                        Sequence: 0,
                        Yield: 1,
                        Await: 1,
                        Assignment: 1,
                Severity: Major
                Found in dist/escodegen.browser.js and 1 other location - About 4 hrs to fix
                lib/self-explain.js on lines 85..109

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

                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

                                for (i = 0, iz = stmt.specifiers.length; i < iz; ++i) {
                                  result.push(indent);
                                  result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT));
                                  if (i + 1 < iz) {
                                    result.push(',' + newline);
                Severity: Major
                Found in dist/escodegen.browser.js and 1 other location - About 3 hrs to fix
                dist/escodegen.browser.js on lines 1849..1855

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

                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

                              for (i = 1, iz = expr.properties.length; i < iz; ++i) {
                                result.push(indent);
                                result.push(that.generateExpression(expr.properties[i], Precedence.Sequence, E_TTT));
                                if (i + 1 < iz) {
                                  result.push(',' + newline);
                Severity: Major
                Found in dist/escodegen.browser.js and 1 other location - About 3 hrs to fix
                dist/escodegen.browser.js on lines 1058..1064

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

                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

                        WhileStatement: function (stmt, flags) {
                          var result, that = this;
                          withIndent(function () {
                            result = [
                              'while' + space + '(',
                Severity: Major
                Found in dist/escodegen.browser.js and 1 other location - About 3 hrs to fix
                dist/escodegen.browser.js on lines 1505..1516

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

                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

                        WithStatement: function (stmt, flags) {
                          var result, that = this;
                          withIndent(function () {
                            result = [
                              'with' + space + '(',
                Severity: Major
                Found in dist/escodegen.browser.js and 1 other location - About 3 hrs to fix
                dist/escodegen.browser.js on lines 1493..1504

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

                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

                        ExportSpecifier: function (expr, precedence, flags) {
                          var local = expr.local;
                          var result = [local.name];
                          var exported = expr.exported;
                          if (exported && exported.name !== local.name) {
                Severity: Major
                Found in dist/escodegen.browser.js and 1 other location - About 3 hrs to fix
                dist/escodegen.browser.js on lines 1929..1937

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

                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