codenautas/self-explain

View on GitHub

Showing 99 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

      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

          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

                Function assert has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                selfExplain.assert = function assert(value){
                    if(value===true){
                        return '';
                    }
                    return (function(stack){
                Severity: Major
                Found in lib/self-explain.js - About 3 hrs to fix

                  Function SourceNode_toStringWithSourceMap has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
                          var generated = {
                              code: '',
                              line: 1,
                              column: 0
                  Severity: Major
                  Found in dist/escodegen.browser.js - About 3 hrs to fix

                    Function attachComments has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          function attachComments(tree, providedComments, tokens) {
                            var comments = [], comment, len, i, cursor;
                            if (!tree.range) {
                              throw new Error('attachComments needs range information');
                            }
                    Severity: Major
                    Found in dist/escodegen.browser.js - About 3 hrs to fix

                      Function traverse has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            Controller.prototype.traverse = function traverse(root, visitor) {
                              var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel;
                              this.__initialize(root, visitor);
                              sentinel = {};
                              worklist = this.__worklist;
                      Severity: Major
                      Found in dist/escodegen.browser.js - About 2 hrs to fix

                        Function BlockStatement has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                BlockStatement: function (stmt, flags) {
                                  var range, content, result = [
                                      '{',
                                      newline
                                    ], that = this;
                        Severity: Major
                        Found in dist/escodegen.browser.js - About 2 hrs to fix

                          Function generate has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                function generate(node, options) {
                                  var defaultOptions = getDefaultOptions(), result, pair;
                                  if (options != null) {
                                    if (typeof options.indent === 'string') {
                                      defaultOptions.format.indent.style = options.indent;
                          Severity: Major
                          Found in dist/escodegen.browser.js - About 2 hrs to fix

                            Function SourceNode_fromStringWithSourceMap has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
                                    var node = new SourceNode;
                                    var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
                                    var shiftNextLine = function () {
                                      var lineContents = remainingLines.shift();
                            Severity: Major
                            Found in dist/escodegen.browser.js - About 2 hrs to fix

                              Consider simplifying this complex logical expression.
                              Open

                                      } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
                                        return;
                                      } else {
                                        throw new Error('Invalid mapping: ' + JSON.stringify({
                                          generated: aGenerated,
                              Severity: Critical
                              Found in dist/escodegen.browser.js - About 2 hrs to fix

                                Function SourceMapConsumer_parseMappings has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
                                        var generatedLine = 1;
                                        var previousGeneratedColumn = 0;
                                        var previousOriginalLine = 0;
                                        var previousOriginalColumn = 0;
                                Severity: Major
                                Found in dist/escodegen.browser.js - About 2 hrs to fix

                                  Function SourceMapGenerator_applySourceMap has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
                                          var sourceFile = aSourceFile;
                                          if (aSourceFile == null) {
                                            if (aSourceMapConsumer.file == null) {
                                              throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.');
                                  Severity: Major
                                  Found in dist/escodegen.browser.js - About 2 hrs to fix

                                    Function ImportDeclaration has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            ImportDeclaration: function (stmt, flags) {
                                              var result, cursor, that = this;
                                              if (stmt.specifiers.length === 0) {
                                                return [
                                                  'import',
                                    Severity: Major
                                    Found in dist/escodegen.browser.js - About 2 hrs to fix

                                      Function separateParts has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function separateParts(previousResult, expressions){
                                          var result={changes:false};
                                          var newParts=[];
                                          var registerNewNode=function(part){
                                              // console.log('pre generate',part);
                                      Severity: Major
                                      Found in lib/self-explain.js - About 2 hrs to fix

                                        Function ExpressionStatement has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                ExpressionStatement: function (stmt, flags) {
                                                  var result, fragment;
                                                  function isClassPrefixed(fragment) {
                                                    var code;
                                                    if (fragment.slice(0, 5) !== 'class') {
                                        Severity: Major
                                        Found in dist/escodegen.browser.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language