haroldtreen/epub-press

View on GitHub

Showing 7 of 62 total issues

Book has 30 functions (exceeds 20 allowed). Consider refactoring.
Open

class Book {
    static find(id, filetype) {
        return new Promise((resolve, reject) => {
            BookModel.findOne({ where: { uid: id } }).then((bookModel) => {
                if (!bookModel) {
Severity: Minor
Found in lib/book.js - About 3 hrs to fix

    HtmlProcessor has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class HtmlProcessor {
        /*
         *   Image extraction
         */
    
    
    Severity: Minor
    Found in lib/html-processor.js - About 3 hrs to fix

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

      const path = require('path');
      const Url = require('url');
      
      const cheerio = require('cheerio');
      const stringDirection = require('string-direction');
      Severity: Minor
      Found in lib/html-processor.js - About 2 hrs to fix

        File book.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        
        const fs = require('fs');
        
        const shortid = require('shortid');
        Severity: Minor
        Found in lib/book.js - About 2 hrs to fix

          File book-services.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          'use strict';
          
          const { exec } = require('child_process');
          const request = require('request-promise').defaults({ gzip: true });
          const { tidy } = require('htmltidy2');
          Severity: Minor
          Found in lib/book-services.js - About 2 hrs to fix

            Function writeEpub has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                writeEpub() {
                    this._ebook = Book.getEpubWriter(this.getMetadata());
            
                    this.getSections().forEach((section) => {
                        if (section.title && section.xhtml) {
            Severity: Minor
            Found in lib/book.js - About 1 hr to fix

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

              function bookFromBody(body) {
                  return new Promise((resolve) => {
                      const sections = [];
                      if (body.urls) {
                          log.verbose('Urls request');
              Severity: Minor
              Found in routes/api/books-beta.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language