LaunchPadLab/fuel

View on GitHub
app/assets/javascripts/fuel/to-markdown.js

Summary

Maintainability
F
4 days
Test Coverage

File to-markdown.js has 558 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.toMarkdown = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*
 * to-markdown - an HTML to Markdown converter
 *
 * Copyright 2011-15, Dom Christie
Severity: Major
Found in app/assets/javascripts/fuel/to-markdown.js - About 1 day to fix

    Function 1 has 195 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.toMarkdown = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    /*
     * to-markdown - an HTML to Markdown converter
     *
     * Copyright 2011-15, Dom Christie
    Severity: Major
    Found in app/assets/javascripts/fuel/to-markdown.js - About 7 hrs to fix

      Function 3 has 129 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{}],3:[function(require,module,exports){
      'use strict';
      
      module.exports = [
        {
      Severity: Major
      Found in app/assets/javascripts/fuel/to-markdown.js - About 5 hrs to fix

        Function 2 has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{"./lib/gfm-converters":2,"./lib/md-converters":3,"collapse-whitespace":4,"jsdom":7}],2:[function(require,module,exports){
        'use strict';
        
        function cell(content, node) {
          var index = Array.prototype.indexOf.call(node.parentNode.childNodes, node);
        Severity: Major
        Found in app/assets/javascripts/fuel/to-markdown.js - About 3 hrs to fix

          Function 4 has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{}],4:[function(require,module,exports){
          'use strict';
          
          var voidElements = require('void-elements');
          Object.keys(voidElements).forEach(function (name) {
          Severity: Major
          Found in app/assets/javascripts/fuel/to-markdown.js - About 2 hrs to fix

            Function collapseWhitespace has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function collapseWhitespace(elem, isBlock) {
              if (!elem.firstChild || elem.nodeName === 'PRE') return;
            
              if (typeof isBlock !== 'function') {
                isBlock = isBlockElem;
            Severity: Minor
            Found in app/assets/javascripts/fuel/to-markdown.js - About 1 hr to fix

              Function 5 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              },{"block-elements":5,"void-elements":6}],5:[function(require,module,exports){
              /**
               * This file automatically generated from `build.js`.
               * Do not manually edit.
               */
              Severity: Minor
              Found in app/assets/javascripts/fuel/to-markdown.js - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                        if (prevText) {
                          prevText.data = prevText.data.replace(/ $/, '');
                        }
                Severity: Major
                Found in app/assets/javascripts/fuel/to-markdown.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                        } else if (isVoid(node)) {
                          // Avoid trimming space around non-block, non-BR void elements.
                          prevText = null;
                          prevVoid = true;
                        }
                  Severity: Major
                  Found in app/assets/javascripts/fuel/to-markdown.js - About 45 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status