benfluleck/HelloBooks

View on GitHub
server/src/controllers/books.js

Summary

Maintainability
B
4 hrs
Test Coverage

File books.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import models from '../models';
import pagination from '../controllers/helpers/pagination';

const { Categories, Books, UserBooks } = models;

Severity: Minor
Found in server/src/controllers/books.js - About 3 hrs to fix

    Function addBook has 65 lines of code (exceeds 60 allowed). Consider refactoring.
    Open

      addBook(req, res) {
        Categories
          .findOne({
            where: {
              id: req.body.categoryId
    Severity: Major
    Found in server/src/controllers/books.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status