bbottema/js-epub-maker

View on GitHub

Showing 31 of 47 total issues

Function Beautifier has 799 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Beautifier(html_source, options, js_beautify, css_beautify) {
    //Wrapper function to invoke all the necessary constructors and deal with the output.
    html_source = html_source || '';

    var multi_parser,
Severity: Major
Found in demo/js/vendor/beautify-html.js - About 3 days to fix

    Function Parser has 587 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function Parser() {
    
            this.pos = 0; //Parser position
            this.token = '';
            this.current_mode = 'CONTENT'; //reflects the current Parser mode: TAG/CONTENT
    Severity: Major
    Found in demo/js/vendor/beautify-html.js - About 2 days to fix

      File beautify-html.js has 887 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*jshint curly:false, eqeqeq:true, laxbreak:true, noempty:false */
      /* AUTO-GENERATED. DO NOT MODIFY. */
      /*
      
        The MIT License (MIT)
      Severity: Major
      Found in demo/js/vendor/beautify-html.js - About 2 days to fix

        Function get_tag has 197 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                this.get_tag = function(peek) { //function to get a full tag and parse its type
                    var input_char = '',
                        content = [],
                        comment = '',
                        space = false,
        Severity: Major
        Found in demo/js/vendor/beautify-html.js - About 7 hrs to fix

          Function Builder has 154 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var Builder = function() {
          
                  this.make = function(epubConfig) {
                      console.debug('building epub', epubConfig);
                      var zip = new JSZip();
          Severity: Major
          Found in src/js/template-builders/lightnovel-builder.js - About 6 hrs to fix

            Function beautify has 135 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.beautify = function() {
                    multi_parser = new Parser(); //wrapping functions Parser
                    multi_parser.printer(html_source, indent_character, indent_size, wrap_line_length, brace_style); //initialize starting values
                    while (true) {
                        var t = multi_parser.get_token();
            Severity: Major
            Found in demo/js/vendor/beautify-html.js - About 5 hrs to fix

              Function EpubMaker has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var EpubMaker = function () {
                      var self = this;
                      var epubConfig = { toc: [], landmarks: [], sections: [], stylesheet: {}, additionalFiles: [], options: {} };
              
                      this.withUuid = function(uuid) {
              Severity: Major
              Found in src/js-epub-maker.js - About 3 hrs to fix

                Function Builder has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var Builder = function() {
                        
                        this.make = function(epubConfig) {
                            console.debug('building epub', epubConfig);
                            var zip = new JSZip();
                Severity: Major
                Found in src/js/template-builders/idpf-wasteland-builder.js - About 3 hrs to fix

                  Function printer has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          this.printer = function(js_source, indent_character, indent_size, wrap_line_length, brace_style) { //handles input/output and some other printing functions
                  
                              this.input = js_source || ''; //gets the input for the Parser
                  
                              // HACK: newline parsing inconsistent. This brute force normalizes the input.
                  Severity: Major
                  Found in demo/js/vendor/beautify-html.js - About 2 hrs to fix

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

                            this.get_comment = function(start_pos) { //function to return comment content in its entirety
                                // this is will have very poor perf, but will work for now.
                                var comment = '',
                                    delimiter = '>',
                                    matched = false;
                    Severity: Minor
                    Found in demo/js/vendor/beautify-html.js - About 1 hr to fix

                      Function get_content has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              this.get_content = function() { //function to capture regular content between tags
                                  var input_char = '',
                                      content = [],
                                      handlebarsStarted = 0;
                      
                      
                      Severity: Minor
                      Found in demo/js/vendor/beautify-html.js - About 1 hr to fix

                        Function createTestEpub has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function createTestEpub(header, preface, ch1, ch2, ch3, ch4, rn1, rn2) {
                            new EpubMaker()
                                .withUuid('github.com/bbottema/js-epub-maker::it-came-from::example-using-idpf-wasteland')
                                .withTemplate('idpf-wasteland')
                                .withAuthor('T. Est')
                        Severity: Minor
                        Found in src/test/test-script.js - About 1 hr to fix

                          Function createTestEpub has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function createTestEpub(header, preface, ch1, ch2, ch3, ch4, rn1, rn2) {
                              return new EpubMaker()
                                  .withUuid('github.com/bbottema/js-epub-maker::it-came-from::example-using-idpf-wasteland')
                                  .withTemplate('idpf-wasteland')
                                  .withAuthor('T. Est')
                          Severity: Minor
                          Found in demo/js/script.js - About 1 hr to fix

                            Function get_unformatted has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    this.get_unformatted = function(delimiter, orig_tag) { //function to return unformatted content in its entirety
                                        if (orig_tag && orig_tag.toLowerCase().indexOf(delimiter) !== -1) {
                                            return '';
                                        }
                                        var input_char = '';
                            Severity: Minor
                            Found in demo/js/vendor/beautify-html.js - About 1 hr to fix

                              Function Section has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  EpubMaker.Section = function(epubType, id, content, includeInToc, includeInLandmarks) {
                                      var self = this;
                                      this.epubType = epubType;
                                      this.id = id;
                                      this.content = content;
                              Severity: Minor
                              Found in src/js-epub-maker.js - About 1 hr to fix

                                Function get_token has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        this.get_token = function() { //initial handler for token-retrieval
                                            var token;
                                
                                            if (this.last_token === 'TK_TAG_SCRIPT' || this.last_token === 'TK_TAG_STYLE') { //check if we need to format javascript
                                                var type = this.last_token.substr(7);
                                Severity: Minor
                                Found in demo/js/vendor/beautify-html.js - About 1 hr to fix

                                  Function createTestEpub has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  function createTestEpub(header, preface, ch1, ch2, ch3, ch4, rn1, rn2) {
                                  Severity: Major
                                  Found in src/test/test-script.js - About 1 hr to fix

                                    Function createTestEpub has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    function createTestEpub(header, preface, ch1, ch2, ch3, ch4, rn1, rn2) {
                                    Severity: Major
                                    Found in demo/js/script.js - About 1 hr to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                  if (multi_parser.output[lastCheckedOutput].match(/{{#if/)) {
                                                                      foundIfOnCurrentLine = true;
                                                                      break;
                                                                  }
                                      Severity: Major
                                      Found in demo/js/vendor/beautify-html.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                        if (!peek) {
                                                            this.record_tag(tag_check);
                                                            this.tag_type = 'STYLE';
                                                        }
                                        Severity: Major
                                        Found in demo/js/vendor/beautify-html.js - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language