Showing 31 of 47 total issues
Function Beautifier
has 799 lines of code (exceeds 25 allowed). Consider refactoring. Open
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,
Function Parser
has 587 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Parser() {
this.pos = 0; //Parser position
this.token = '';
this.current_mode = 'CONTENT'; //reflects the current Parser mode: TAG/CONTENT
File beautify-html.js
has 887 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*jshint curly:false, eqeqeq:true, laxbreak:true, noempty:false */
/* AUTO-GENERATED. DO NOT MODIFY. */
/*
The MIT License (MIT)
Function get_tag
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.get_tag = function(peek) { //function to get a full tag and parse its type
var input_char = '',
content = [],
comment = '',
space = false,
Function Builder
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Builder = function() {
this.make = function(epubConfig) {
console.debug('building epub', epubConfig);
var zip = new JSZip();
Function beautify
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
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();
Function EpubMaker
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var EpubMaker = function () {
var self = this;
var epubConfig = { toc: [], landmarks: [], sections: [], stylesheet: {}, additionalFiles: [], options: {} };
this.withUuid = function(uuid) {
Function Builder
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Builder = function() {
this.make = function(epubConfig) {
console.debug('building epub', epubConfig);
var zip = new JSZip();
Function printer
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.
Function get_comment
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function get_content
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.get_content = function() { //function to capture regular content between tags
var input_char = '',
content = [],
handlebarsStarted = 0;
Function createTestEpub
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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')
Function createTestEpub
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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')
Function get_unformatted
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 = '';
Function Section
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
EpubMaker.Section = function(epubType, id, content, includeInToc, includeInLandmarks) {
var self = this;
this.epubType = epubType;
this.id = id;
this.content = content;
Function get_token
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function createTestEpub
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function createTestEpub(header, preface, ch1, ch2, ch3, ch4, rn1, rn2) {
Function createTestEpub
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function createTestEpub(header, preface, ch1, ch2, ch3, ch4, rn1, rn2) {
Avoid deeply nested control flow statements. Open
Open
if (content[i] === ' ') {
first_attr = false;
break;
}
Avoid deeply nested control flow statements. Open
Open
} else if (tag_check.charAt(0) === '!') { //peek for <! comment
// for comments content is already correct.
if (!peek) {
this.tag_type = 'SINGLE';
this.traverse_whitespace();