codenautas/self-explain

View on GitHub

Showing 254 of 254 total issues

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

          if (!candidates) {
            if (this.__fallback) {
              candidates = objectKeys(node);
            } else {
              throw new Error('Unknown node type ' + nodeType + '.');
Severity: Minor
Found in dist/escodegen.browser.js and 1 other location - About 45 mins to fix
dist/escodegen.browser.js on lines 4692..4698

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

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

            if (!candidates) {
              if (this.__fallback) {
                candidates = objectKeys(node);
              } else {
                throw new Error('Unknown node type ' + nodeType + '.');
Severity: Minor
Found in dist/escodegen.browser.js and 1 other location - About 45 mins to fix
dist/escodegen.browser.js on lines 4800..4806

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

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 (!candidate[current2]) {
                  continue;
                }
Severity: Major
Found in dist/escodegen.browser.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    if (isProperty(nodeType, candidates[current])) {
                      element = new Element(candidate[current2], [
                        key,
                        current2
                      ], 'Property', new Reference(candidate, current2));
    Severity: Major
    Found in dist/escodegen.browser.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                    } else if (isNode(candidate)) {
                      worklist.push(new Element(candidate, key, null, null));
                    }
      Severity: Major
      Found in dist/escodegen.browser.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                          if (stmt.finalizer || i + 1 !== iz) {
                            result = this.maybeBlockSuffix(stmt.handler[i].body, result);
                          }
        Severity: Major
        Found in dist/escodegen.browser.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          if (i === 0) {
                            result = [
                              result,
                              indent
                            ];
          Severity: Major
          Found in dist/escodegen.browser.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                            if (ch === 93) {
                              characterInBrack = false;
                            }
            Severity: Major
            Found in dist/escodegen.browser.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if (content[0] === '\n') {
                                    result = ['{'];
                                  }
              Severity: Major
              Found in dist/escodegen.browser.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if (i + 1 < iz) {
                                      result.push(',' + newline);
                                    }
                Severity: Major
                Found in dist/escodegen.browser.js - About 45 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ((temp.length < result.length || hexadecimal && value > 1e12 && Math.floor(value) === value && (temp = '0x' + value.toString(16)).length < result.length) && +temp === value) {
                            result = temp;
                          }
                  Severity: Major
                  Found in dist/escodegen.browser.js - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (node.type === Syntax.ArrowFunctionExpression && !node.rest && (!node.defaults || node.defaults.length === 0) && node.params.length === 1 && node.params[0].type === Syntax.Identifier) {
                              result = [
                                generateAsyncPrefix(node, true),
                                generateIdentifier(node.params[0])
                              ];
                    Severity: Major
                    Found in dist/escodegen.browser.js - About 40 mins to fix

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

                            exports.encode = function base64_encode(aNumber) {
                              if (aNumber in intToCharMap) {
                                return intToCharMap[aNumber];
                              }
                              throw new TypeError('Must be between 0 and 63: ' + aNumber);
                      Severity: Minor
                      Found in dist/escodegen.browser.js and 1 other location - About 40 mins to fix
                      dist/escodegen.browser.js on lines 3324..3329

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

                      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

                            exports.decode = function base64_decode(aChar) {
                              if (aChar in charToIntMap) {
                                return charToIntMap[aChar];
                              }
                              throw new TypeError('Not a valid base 64 digit: ' + aChar);
                      Severity: Minor
                      Found in dist/escodegen.browser.js and 1 other location - About 40 mins to fix
                      dist/escodegen.browser.js on lines 3318..3323

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

                      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 recursiveSearch has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                            function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
                      Severity: Minor
                      Found in dist/escodegen.browser.js - About 35 mins to fix

                        Function SourceNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                              function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
                        Severity: Minor
                        Found in dist/escodegen.browser.js - About 35 mins to fix

                          Function generateAssignment has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                CodeGenerator.prototype.generateAssignment = function (left, right, operator, precedence, flags) {
                          Severity: Minor
                          Found in dist/escodegen.browser.js - About 35 mins to fix

                            Function _findMapping has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                  BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator) {
                            Severity: Minor
                            Found in dist/escodegen.browser.js - About 35 mins to fix

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

                                        return {
                                          line: util.getArg(mapping, 'generatedLine', null),
                                          column: util.getArg(mapping, 'generatedColumn', null),
                                          lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
                                        };
                              Severity: Minor
                              Found in dist/escodegen.browser.js and 1 other location - About 35 mins to fix
                              dist/escodegen.browser.js on lines 3431..3435

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

                              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

                                    if (!isArray) {
                                      isArray = function isArray(array) {
                                        return Object.prototype.toString.call(array) === '[object Array]';
                                      };
                                    }
                              Severity: Minor
                              Found in dist/escodegen.browser.js and 1 other location - About 35 mins to fix
                              dist/escodegen.browser.js on lines 197..201

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

                              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