codenautas/self-explain

View on GitHub

Showing 254 of 254 total issues

Function join has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function join(aRoot, aPath) {
        if (aRoot === '') {
          aRoot = '.';
        }
        if (aPath === '') {
Severity: Minor
Found in dist/escodegen.browser.js - About 1 hr to fix

    Function IndexedSourceMapConsumer_parseMappings has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
            this.__generatedMappings = [];
            this.__originalMappings = [];
            for (var i = 0; i < this._sections.length; i++) {
              var section = this._sections[i];
    Severity: Minor
    Found in dist/escodegen.browser.js - About 1 hr to fix

      Function VariableDeclaration has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              VariableDeclaration: function (stmt, flags) {
                var result, i, iz, node, bodyFlags, that = this;
                result = [stmt.kind];
                bodyFlags = flags & F_ALLOW_IN ? S_TFFF : S_FFFF;
                function block() {
      Severity: Minor
      Found in dist/escodegen.browser.js - About 1 hr to fix

        Function join has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function join(left, right) {
                var leftSource, rightSource, leftCharCode, rightCharCode;
                leftSource = toSourceNodeWhenNeeded(left).toString();
                if (leftSource.length === 0) {
                  return [right];
        Severity: Minor
        Found in dist/escodegen.browser.js - About 1 hr to fix

          Function SourceMapConsumer_eachMapping has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
                  var context = aContext || null;
                  var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
                  var mappings;
                  switch (order) {
          Severity: Minor
          Found in dist/escodegen.browser.js - About 1 hr to fix

            Function IfStatement has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    IfStatement: function (stmt, flags) {
                      var result, bodyFlags, semicolonOptional, that = this;
                      withIndent(function () {
                        result = [
                          'if' + space + '(',
            Severity: Minor
            Found in dist/escodegen.browser.js - About 1 hr to fix

              Function define has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    function define(id, deps, factory) {
                      if (Array.isArray(id)) {
                        factory = deps;
                        deps = id;
                        id = undefined;
              Severity: Minor
              Found in dist/escodegen.browser.js - About 1 hr to fix

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

                      module.exports = {
                        isKeywordES5: isKeywordES5,
                        isKeywordES6: isKeywordES6,
                        isReservedWordES5: isReservedWordES5,
                        isReservedWordES6: isReservedWordES6,
                Severity: Major
                Found in dist/escodegen.browser.js and 1 other location - About 1 hr to fix
                dist/escodegen.browser.js on lines 4050..4060

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

                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

                      module.exports = {
                        isDecimalDigit: isDecimalDigit,
                        isHexDigit: isHexDigit,
                        isOctalDigit: isOctalDigit,
                        isWhiteSpace: isWhiteSpace,
                Severity: Major
                Found in dist/escodegen.browser.js and 1 other location - About 1 hr to fix
                dist/escodegen.browser.js on lines 3963..3973

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

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

                      BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
                        var needle = {
                            generatedLine: util.getArg(aArgs, 'line'),
                            generatedColumn: util.getArg(aArgs, 'column')
                          };
                Severity: Minor
                Found in dist/escodegen.browser.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode) || leftCharCode === 47 && rightCharCode === 105) {
                            return [
                              left,
                              noEmptySpace(),
                              right
                  Severity: Major
                  Found in dist/escodegen.browser.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                              } else if (!esutils.code.isIdentifierPartES5(code) && (json && code < 32 || !json && !escapeless && (code < 32 || code > 126))) {
                                result += escapeAllowedCharacter(code, str.charCodeAt(i + 1));
                                continue;
                              }
                    Severity: Major
                    Found in dist/escodegen.browser.js - About 1 hr to fix

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

                              if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode) || leftCharCode === 47 && rightCharCode === 105) {
                      Severity: Minor
                      Found in dist/escodegen.browser.js and 1 other location - About 55 mins to fix
                      dist/escodegen.browser.js on lines 1665..1665

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

                      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 ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode)) {
                      Severity: Minor
                      Found in dist/escodegen.browser.js and 1 other location - About 55 mins to fix
                      dist/escodegen.browser.js on lines 466..466

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

                      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

                              case 6:
                                return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import';
                      Severity: Minor
                      Found in dist/escodegen.browser.js and 1 other location - About 50 mins to fix
                      dist/escodegen.browser.js on lines 3886..3887

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

                      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(timesDiffer) {
                                      rv.push(' ');
                                      rv.push(aas.substr(11, a.getMilliseconds()?12:8));
                                  }
                      Severity: Minor
                      Found in lib/self-explain.js and 1 other location - About 50 mins to fix
                      lib/self-explain.js on lines 539..542

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

                      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

                              case 4:
                                return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum';
                      Severity: Minor
                      Found in dist/escodegen.browser.js and 1 other location - About 50 mins to fix
                      dist/escodegen.browser.js on lines 3890..3891

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

                      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(timesDiffer) {
                                      rv.push(' ');
                                      rv.push(bbs.substr(11, b.getMilliseconds()?12:8));
                                  }
                      Severity: Minor
                      Found in lib/self-explain.js and 1 other location - About 50 mins to fix
                      lib/self-explain.js on lines 533..536

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

                      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

                      Avoid deeply nested control flow statements.
                      Open

                                      if (ch === 47) {
                                        result += '\\';
                                      } else if (ch === 91) {
                                        characterInBrack = true;
                                      }
                      Severity: Major
                      Found in dist/escodegen.browser.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        while ((current2 -= 1) >= 0) {
                                          if (!candidate[current2]) {
                                            continue;
                                          }
                                          if (isProperty(nodeType, candidates[current])) {
                        Severity: Major
                        Found in dist/escodegen.browser.js - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language