codenautas/self-explain

View on GitHub

Showing 99 of 254 total issues

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

              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

                      Function codenautasModuleDefinition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      (function codenautasModuleDefinition(root, name, factory) {
                          /* global define */
                          /* istanbul ignore next */
                          if(typeof root.globalModuleName !== 'string'){
                              root.globalModuleName = name;
                      Severity: Minor
                      Found in lib/self-explain.js - About 35 mins 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

                      Avoid too many return statements within this function.
                      Open

                                return '\\x' + '00'.slice(hex.length) + hex;
                      Severity: Major
                      Found in dist/escodegen.browser.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return joined;
                        Severity: Major
                        Found in dist/escodegen.browser.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                    return aLow < 0 ? -1 : aLow;
                          Severity: Major
                          Found in dist/escodegen.browser.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                      return '\\x0B';
                            Severity: Major
                            Found in dist/escodegen.browser.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return new SourceNode(node.loc.start.line, node.loc.start.column, sourceMap === true ? node.loc.source || null : sourceMap, generated, node.name || null);
                              Severity: Major
                              Found in dist/escodegen.browser.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                          return cmp;
                                Severity: Major
                                Found in dist/escodegen.browser.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                            return null;
                                  Severity: Major
                                  Found in dist/escodegen.browser.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return true;
                                    Severity: Major
                                    Found in dist/escodegen.browser.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                  return '.substr('+firstDiff+','+maxDiff+'): "'+a.substr(firstDiff, maxDiff)+'" != "'+b.substr(firstDiff,maxDiff)+'"';
                                      Severity: Major
                                      Found in lib/self-explain.js - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language